HSB : Java Glossary

go to home page H words local find full screen, hide local find menu Google search web for more information on this topic jump to foot of page translate this page with Babelfish punctuation 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 (all) ©1996-2009 Roedy Green, Canadian Mind Products
HSB
Hue Saturation Brightness. An alternative Java supports to RGB (Red Green Blue) for specifying colour. Java defines HSB as three floating point numbers between 0. and 1. Note that Java’s definition does not match Paint Shop Pro’s definition, even if you scale HSB to 0..255.

Hue

Roughly hue represents the position on the rainbow or colour wheel, only loosely related to the frequency or wavelength of the simulated colour. The colours coming from the screen are not actually varying wavelength, but combinations or red, green and lue that trick you eye into thinking they are seeing different frequencies of light. It works because of the biology of your eye’s sensor cells.


hue spectrum
frequency spectrum

Saturation

Saturation is a measure how white the colour is, how broad the spectrum. The more washed out a colour is with white, the less saturated it is.

Brightness

Subjectively brightness just measures how much light in coming from the screen when it displays that colour, the amplitude of the light waves. Java defines brightness as:
max(r, g, b) / 255
A more accurate measure for typical monitors would be:
0.2125*r/255 + 0.7154*g/255 + 0.0721*b/255
Some people define it as:
(r + g + b ) / (3 * 255)

Equivalence

You can generate an RGB-HSB equivalence table with the little application below.

You can play with Rich Franzen’s colourwheel Applet to sharpen your HSB intuition.

Click any ball to view the corresponding colour palette.

Named Colours select palette Alphabetically (113) select palette BHS: by Brightness, Hue, Saturation select palette HBS: by Hue, Brightness, Saturation select palette SBH: by Saturation, Brightness, Hue select palette Java AWT Colours (16,777,216)
select palette RGB: Numerically (113) select palette BSH: by Brightness, Saturation, Hue select palette HSB: by Hue, Saturation, Brightness select palette SHB: by Saturation, Hue, Brightness select palette Java Swing Colours (16,777,216)
Numbered Colours select palette HTML 3.2 (16) select palette Websafe (216) select palette Rainbow (4096) select palette Spectrum (401) select palette X11 (657)
Selected Colours select palette Pale (256) select palette Dark (2022) select palette Simple (105) select palette Greys (256) select palette Colour Schemes


CMP homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/hsb.html J:\mindprod\jgloss\hsb.html
CMP logofeedback Please email your feedback for publication, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.191.107]
You are visitor number 14,003.