Click any ball to view the corresponding colour palette.
Hypertext Markup Language) 3.2’s 16 standard colours. It shows the colours displayed eight ways, (colour on white, colour on black, black on colour, white on colour) both using alpha names and hex names. You can check out your browser for Netscape colour compatibility. It shows the Standard Netscape 8.0 alpha names such as aliceblue and also the hex, RGB (Red Green Blue) an HSB (Hue Saturation Brightness) values both as HTML and raw ASCII (American Standard Code for Information Interchange) text.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 transparency png files if you use this magic combination:
It is bit like mixing poster paint in grade two art class, except that you are mixing light not pigments, so red + green = yellow (surprise); green + blue = cyan (turquoise); and blue + red = violet.
To make a colour more yellowy you increase the red and green simultaneously and reduce the blue. Do make it darker decrease all three numbers.
The color mixing rules for pigments and light have little to do with physics and a lot to with anatomy and the variable sensitivity of different cells on your retina to different frequencies of light. Other species presumably would have different rules.
You can experiment with colours by looking at the various color charts above or using the Java FontShower which shows Java fonts in various foreground and background colours.
I find the HSB system is easier to work with than RGB. Normally I want a darker shade of the same colour, or a not so circus-bright intensity version of the same colour, or I want the saturation and brightness the same, but a slightly different hue. The FontShower for Swing Applet will let you select in HSB coordinates and convert to RGB for use in Java or HTML. The right colour is subjective. You have to try a colour and live with it in context a while so see if it is right.
Unfortunately, the colour balance on my faithful Sony monitor is shot and I don’t have the money for a new one. This effectively makes me colour blind. That may explain some of the unusual colour choices on this website.
// paint background g.setColor( getBackground() ); g.fillRect( 0, 0, width, height ); // paint foreground g.setColor( getForeground() ); g.drawString( "hello", x, y );
To make your app blend with other applications, you can use the SystemColor class to select your colours. That way your app will adapt to the Look & Feel and possibly the desktop theme colours. In JDK (Java Development Kit) 1.3-, the colours had lower case names such as Color. white. Since these are static final constants, in Java version 1.4 or later, Sun gave them proper upper case names such as Color.WHITE. However, beware of using the upper case names it you want to target JDK 1.3- versions. Your programs will explode in a glory of exceptions from the missing support. The lower case names will work in any JDK version.
This page is posted |
http://mindprod.com/jgloss/colour.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\colour.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[3.139.87.113] |
| |
Feedback |
You are visitor number | |