Last updated 2004-06-28 by Roedy
Green ©1996-2004 Canadian Mind Products
Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
You are here : home : Java Glossary : C words : colour.
Click any ball to view the corresponding colour palette.
A = alpha channel that measures opacity. 0 = 100% transparent, 255 = 100% opaque.
R = red channel that measures redness. 0 = black, 255 = intense red.
G = green channel that measures greenness. 0 = black, 255 = intense green.
B = blue channel that measures blueness. 0 = black, 255 = intense blue.
So 0.0.0.0 would be a totally transparent black colour, and 255.255.255.255 would be a totally opaque white. I have discovered by experiment that if you want transparent backgrounds that you can save variable tranparency png files if you use this magic combination:
// paint background g.setColor( getBackground() ); g.fillRect( 0, 0, width, height ); // paint foreground g.setColor( getForeground() ); g.drawString( "hello", x, y );
Color transparent = new Color( 0x00ffffff, true ); BufferedImage bufferedImage = new BufferedImage ( width, height, BufferedImage.TYPE_4BYTE_ABGR_PRE );
home |
Canadian Mind Products | |||
| mindprod.com IP:[24.87.56.253] | ||||
| Your IP:[80.134.30.163] | ||||
| You are visitor number 3516. | ||||
| Please send errors, omissions and suggestions | ||||
| to improve this page to Roedy Green. | ||||
| You can get a fresh copy of this page from: | or possibly from your local J: drive mirror: | |||
| http://mindprod.com/jgloss/colour.html | J:\mindprod\jgloss\colour.html | |||