RGB basics
RGB represents color as three light channels: Red (0-255), Green (0-255), Blue (0-255). Every pixel on your screen is RGB.
- rgb(255, 0, 0) = Pure red
- rgb(0, 255, 0) = Pure green
- rgb(0, 0, 255) = Pure blue
- rgb(255, 255, 255) = White (all on)
- rgb(0, 0, 0) = Black (all off)
Additive vs subtractive
RGB is additive because you add light together. Screens emit light. Print uses CMYK (subtractive) with ink.
RGBA: Adding transparency
rgba(115, 87, 246, 0.5) adds a fourth value (alpha) from 0 (transparent) to 1 (opaque).