How color works
RGB, HSL, and the two ways color mixes — the foundation for everything that follows.
The RGB model
RGB describes color as a mix of red, green, and blue components. Each channel runs from 0 (none) to 255 (full). The value `rgb(0, 212, 160)` means zero red, strong green, moderate blue — a teal.
RGB is an additive model: it describes emitted light. All channels at full (`255, 255, 255`) produce white; all at zero produce black. This model underpins every digital display, camera sensor, and LED.
In additive color mixing, combining all RGB channels at full brightness produces…
Each RGB channel can hold how many distinct values?
Hex notation
Hex codes express RGB in base-16: `#RRGGBB`. Each pair maps to one channel from `00` (0) to `ff` (255). So `#00d4a0` = 0 red, 212 green, 160 blue — the same teal as `rgb(0, 212, 160)`.
The shorthand `#abc` expands to `#aabbcc`. Hex is the universal language of digital color — used in CSS, design tools, brand guidelines, and graphics software.
| Hex | R | G | B | Color |
|---|---|---|---|---|
| #ff0000 | 255 | 0 | 0 | Red |
| #00ff00 | 0 | 255 | 0 | Green |
| #0000ff | 0 | 0 | 255 | Blue |
| #ffffff | 255 | 255 | 255 | White |
| #000000 | 0 | 0 | 0 | Black |
The hex code `#ff0000` represents which color?
Additive vs subtractive mixing
Color mixes in two opposite ways depending on the medium. Additive mixing combines *light* — more light means brighter, toward white. Subtractive mixing combines *pigments* — more pigment absorbs more light, toward dark.
Understanding this distinction prevents costly mistakes: a vibrant screen color may look dull in print because the two systems have different gamuts and opposite mixing behavior.
Additive (light)
- Medium
- Emitted light
- Primaries
- Red, Green, Blue
- All combined
- White
- None
- Black
- Used in
- Displays, projectors, LEDs
Subtractive (pigment)
- Medium
- Reflected light
- Primaries
- Cyan, Magenta, Yellow
- All combined
- Dark brown/black
- None
- White (paper/canvas)
- Used in
- Print, paint, textiles, dyes
In subtractive color mixing (pigments), combining all primaries produces…