Hue Saturation and Brightness (HSB) Colour Coding - School of Computer Science & Electronic Engineering - Bangor University
Hue Saturation and Brightness (HSB) Colour Coding - School of Computer Science & Electronic Engineering - Bangor University
English …
Tweet
Introduction
We have already introduced the RGB model < https://csee.bangor.ac.uk/project-
rainbow/rgb-colours/> to code colours on a computer. In that post I said:
“We can either represent a colour in values of Red, Green and Blue (known as RGB colours), or a
distance travelled along a continuous hue rainbow.“
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 1/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
In fact, there are many ways to code colours onto a computer. Back in the early days
of computing, in the 1960’s and 1970’s, computer pioneers wanted a way to
consistently record and reproduce colour. They needed ways to code colour such that
it could be displayed on a computer screen, transmitted over airwaves, and so on, in a
consistent, convenient and accurate way. HSB is also known as Hue, Saturation and
Value model (HSV) and was invented in 1978 by Alvy Ray Smith.
Coding is another way of saying “let’s change the phenomenon into a way we can store
it and manipulate it on a computer”. Consequently, colours need to be changed into
numbers and letters. On a computer we have many methods to store values: we can
use floating point values, percentages (values ranging from 0 to 100), or values
between 0 and 1, even a mix of letters and numbers. In RGB we store a colour by
values (between 0 and 255) for each of Red, Green and Blue (e.g., rgb(125, 255, 25).
Not only are there different ways to code colours, but there are different ways to
consider colours. For example, we can understand colour from mixing lights, thinking
about light wavelengths, how paints are mixed, how we perceive colours, or even
naming individual colours. Consequently, there are different ways to represent colour.
None of these ways of “thinking about colour” are better than the other; but they may
be better for specific purposes.
Scientists, however, do need ways to express their ideas, and create colour models that
abstractly describe their ideas, and define colour spaces to present their ideas.
Colour models are abstract representations of colour. Usually they include a precise
description and mathematical equation to express the colour concept, and a picture of
”
the model to help us visualise the idea.
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 2/16
”
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
Top tip.
The colour space allows us to understand one English …
model in comparison to another. Perhaps we
RGB =
can find a way to map the colour model into
two-dimensional coordinate system, or a three-
dimensional picture. These spaces not only help
red,
us visualise the colour model, but help us to
compare one model against another.
green
Throughout history many colour models have
been invented. But they have been done for one
blue.
purpose: to help people understand colour
better. Much of our understanding of colour
HSB =
begins with Isaac Newton (1642-1726). Newton
used a prism to split light into its colour
spectrum. He named the colours red, orange,
hue,
yellow, green, blue, indigo and violet (see
colours and rainbows) <
saturatio
https://csee.bangor.ac.uk/project-
rainbow/introduction-to-rainbows-and-
colours/> .
n and
brightne
represent these colours. He ordered the colours
in the order of the spectrum. But he created
uneven intervals based on musical notes.
ss.
Privacy & Cookies Policy
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 3/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
< English …
https://commons.wikimedia.org/wiki/File:Newton%27s_colour_circle.png>
For the HSB model, we position red at the top, and the spectrum colours around the
circle. Let’s now go through each of the parts: Hue, Saturation and Brightness.
Hue
In the HSB model, hue is denoted by an angle around the circle. Red is placed at the
top at 0˚, yellow-green at 90˚, cyan at 180˚, and purple at 270˚. By changing the angle,
we can choose a specific hue.
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/
” 4/16
”
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
Top tip.
English …
Try to
rememb
er some
of the
angles.
Red at
0˚,
yellow
60˚,
green
120˚,
cyan
180˚,
Privacy & Cookies Policy
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 5/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
blue English …
240˚
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 6/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 7/16
”
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
Primary and secondary colours in the HSB modelPrivacy & Cookies Policy
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 8/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
Saturation English …
Saturation is the intensity of the colour: the richness of the colour. At zero there is no
colour and white is shown, at 100 there is pure hue. Let’s choose a hue value of 240˚
to get a deep-blue colour, we can then change the saturation levels by 10% starting at
0%.
We can do the same with a value of orange. Starting with no colour and moving
towards the full colour hue.
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 9/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
English …
By increasing the hue value, we rotate around the circle clockwise. If we decrease
hue we rotate anticlockwise.
Privacy & Cookies Policy
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 10/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
If we decrease saturation we move into the center of the cylinder. This results in a
English …
less-saturated version of that colour.
To decrease the brightness (making the colour darker) we are moving down the
cylinder. Move upwards to increase the brightness.
Sliders can be used to select HSB values. Here we show a blue hue at 256˚,
with maximum saturation and brightness.
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 11/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
English …
Sliders can be used to select HSB values, in this example we reduce the
saturation and brightness to 50% with the same hue of 256˚.
Plotting in two-dimensions
Another approach is to plot two dimensions of the colour, and have the third
represented by a slider. So, for example, we can plot Saturation against Brightness, and
have the colour hue on a slider. In this way you can select the “current hue”. Then all
the shades are mapped on a 2d grid, with saturation on the x-axis and brightness on y-
axis. White is plotted on the top left and black along the bottom.
Colour picker in HSB space, with saturation and brightness plotted. The selected
colour shows HSB (256°, 50%, 50%)
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 12/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
Activities English …
In these activities we will use the Google colour picker, and the main aim is for you to
practice using the HSB model.
Google colour picker, with the chosen hue (256°, 50%, 50%)
Note. the Google colour picker also shows the colour values in three other colour
models. It shows values in RGB, CYMK, HSB and also HSL colour spaces; but let us
focus on HSB values.
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 13/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
Find, the primary colours: red, green and blue. By moving the circle, or changing
the values in the text fields, locate the primary colours (red, green and blue). You
will need to put the brightness and saturation to maximum.
Find the secondary colours: yellow, cyan and magenta. Try to get the exact values
of 60˚, 180˚ and 300˚ respectively.
The task is to reduce the saturation by 40 and then the brightness by 40. And to make
a grid of colours.
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 14/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
English …
Look further
How about doing your own research on colour.
Perhaps take a look at different colour models and where they are used.
Look at colour pickers, and see how they are used.
Try to remember some of the colour values and their values in the HSB colour
model.
By Jonathan
Jonathan is constantly designing things, educating people, and always
learning. He is professor of visualisation at the School of Computer Science
and Electronic Engineering, Bangor University, U.K. He leads the
Visualization, Data, Modelling and Graphics Group (VDMG), leads project
rainbow and is an author of the Springer book "Five Design-Sheets" sketching
design method.
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 15/16
8/24/23, 4:32 PM Learn Hue Saturation and Brightness (HSB) colour coding – School of Computer Science & Electronic Engineering – Bangor Univ…
English …
https://csee.bangor.ac.uk/project-rainbow/learn-hue-saturation-and-brightness-hsb-colour-coding/ 16/16