Java Glossary : HSB

CMP home Java glossary home Menu no menu 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 : H words : HSB.

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.


view


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 button Alphabetically button BHS: by Brightness, Hue, Saturation button HBS: by Hue, Brightness, Saturation button SBH: by Saturation, Brightness, Hue
button RGB: Numerically button BSH: by Brightness, Saturation, Hue button HSB: by Hue, Saturation, Brightness button SHB: by Saturation, Hue, Brightness
Numbered Colours button HTML 3.2 button Websafe button Rainbow button X11
Selected Colours button Pale button Dark button Simple button Greys button Colour Schemes


CMP logo
CMP_home
home
Canadian Mind Products CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[24.87.56.253]
Your IP:[80.134.30.163]
You are visitor number 1876.
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/hsb.html J:\mindprod\jgloss\hsb.html