Sub topic 5
Value: how light or dark a color is
This chapter assumes you know what hue and saturation are, and that you can read short Python and CSS snippets. It covers value, the third property: how close a color is to black or to full brightness.
What value describes
Value is the lightness or darkness of a color. Dark navy and pale sky blue share a hue, but they sit at opposite ends of the value scale. Value is separate from saturation. A saturated red and a muted brick red can have the same value, because value only asks how much light the color seems to give off.
In the HSV model, value is the largest of the red, green, and blue channels, scaled from 0 to 1. A value of 0 is always black, whatever the hue. A value of 1 gives the brightest version of that hue at that saturation.
Changing value in code
The standard-library colorsys module works with values from 0 to 1. This script holds hue and saturation fixed and scales only value.
import colorsys
r, g, b = 0.2, 0.4, 0.8
h, s, v = colorsys.rgb_to_hsv(r, g, b)
for factor in (1.0, 0.75, 0.5, 0.25):
rgb = colorsys.hsv_to_rgb(h, s, v * factor)
print(factor, tuple(round(c, 2) for c in rgb))All three channels shrink by the same factor. The result is the same blue at lower brightness, and the balance between channels (and so the hue) does not change.
Two ways to get darker
Beginners often mix up lowering value and lowering saturation. They give different results.
| Action | What happens to the color | Typical use |
|---|---|---|
| Lower value | Moves toward black, stays vivid in character | Shadows, dark text, pressed buttons |
| Lower saturation | Moves toward gray, keeps its brightness | Muted backgrounds, disabled states |
| Raise value and lower saturation | Moves toward white | Pale tints, soft panels |
The next chapters build on this table when they cover tints, tones, and shades.
Value and HSL lightness
HSL uses lightness (L) in place of value. The two are not the same number. In HSL, lightness 0 is black, 100% is white, and the pure hue sits at 50%. In HSV, value 1 with full saturation is the pure hue, and white needs saturation 0. If you move a "brightness" slider in one tool and a "lightness" slider in another, the same color will not land at the same position.
.button {
background: hsl(210 80% 45%);
}
.button:hover {
background: hsl(210 80% 38%); /* same hue and saturation, lower lightness */
}Checking value by eye
Designers test value by removing hue. Convert the design to grayscale, or squint at it. If two elements merge into the same gray, they have too little value contrast, even if their hues look different. Value carries most of the structure of an image. Hue and saturation add mood on top of it.
Common mistakes
- Using saturation to darken a color. This produces a gray, flat result instead of a deeper version of the hue.
- Picking neighboring colors that differ in hue but not in value. They vibrate or blur together, and text on them is hard to read.
- Assuming HSV value and HSL lightness are interchangeable when copying numbers between tools.
Exercise
A color has RGB channels (0.9, 0.3, 0.1) on a 0 to 1 scale. What is its HSV value, and what is the value after you scale all three channels by 0.5?
Show answer
HSV value is the largest channel, so it is 0.9. After scaling by 0.5 the channels are (0.45, 0.15, 0.05) and the value is 0.45. The hue and saturation are unchanged, because the ratios between channels stay the same.