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 by Roedy Green ©1996-2009 Canadian Mind Products
index page for letter ⇒ 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)
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
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.62] The information on this page is for non-military use only.
You are visitor number 11,998. Military use includes use by defence contractors.
You can get a fresh 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