This section illustrates you how to show all the seven colors of colors.
The Rainbow consists of seven colors known as VIBGYOR i.e. violet, indigo, blue, green, yellow, orange and red color. We are providing you an example which shows all the seven colors of rainbow.
All the visible colors can be obtained by the primary colors red, green and blue. Therefore we have defined red, green and blue colors. The height and width of image is defined.
Following code draws the image of seven colors.
|g.drawImage(bufferedImage, 0, 0, this)|
Here is the code of ShowRainbowColors.java
Output will be displayed as:
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial