RGB is the color model screens use: every color is a mix of red, green, and blue light, each set from 0 to 255. A value such as rgb(193, 79, 41) tells a display how bright each of the three channels should be, and it is the basis of nearly all on-screen color.

What Does RGB Mean?
RGB stands for Red, Green, Blue. Displays mix these three primary light colors at different intensities to reproduce the range of colors seen on screen. Because RGB works by adding light, it is an additive color model: all channels at maximum produce white, and all channels at zero produce black. The additive vs subtractive guide covers how this differs from ink.
How RGB Values Work
RGB values are written using three numbers:
rgb(R, G, B)
Each number ranges from 0 to 255:
- 0 — channel is off
- 255 — channel is at maximum intensity
Examples:
rgb(255, 0, 0) → red
rgb(0, 255, 0) → green
rgb(0, 0, 255) → blue
rgb(255, 255, 255) → white
rgb(0, 0, 0) → black
Most colors sit between these extremes. The desert sand in the photo above, rgb(193, 79, 41), is a warm rust: high red, low-to-moderate green, and low blue.
How Screens Create Color (Additive Mixing)
Each pixel on a display contains red, green, and blue subpixels. By controlling the brightness of each subpixel, the device produces a combined color that the eye perceives as a single tone.
Taking the rust color apart:
- Red: 193 (about 76% of maximum)
- Green: 79 (about 31%)
- Blue: 41 (about 16%)
Strong red with a little green pulls the color toward orange; the small amount of blue keeps it from turning pink.
Displays operate in defined color spaces, most commonly sRGB or Display P3. The same RGB values can look slightly different on two screens if their gamuts or calibration differ.
RGB vs HEX
RGB and HEX represent the same information. HEX expresses each channel as a two-digit base-16 number:
rgb(193, 79, 41) → #C14F29
193 → C1 79 → 4F 41 → 29
Most design tools display both.
How to Interpret RGB Values
The balance between the three channels predicts the color:
- All three similar — a gray; the higher they are, the lighter the gray
- One channel far above the others — a strong, saturated color
- Channels close together but not equal — a muted, desaturated color
Useful patterns:
rgb(200, 200, 200) → light gray (channels high and equal)
rgb(20, 20, 20) → near-black gray (channels low and equal)
rgb(200, 50, 50) → strong red (red far above the others)
rgb(160, 110, 110) → dusty, desaturated red (channels close together)
Why RGB Uses 0–255
Each RGB channel is stored using 8 bits of data:
2⁸ = 256 possible values (0–255)
256 × 256 × 256 = 16,777,216 possible colors
The values are not linear in brightness. sRGB applies a gamma (transfer) curve so that the 256 steps are spread roughly the way the eye perceives brightness, with more steps in the darks. As a result, rgb(128, 128, 128) is the midpoint of the number range but reflects only about 22% as much light as white.
What Is RGBA?
RGBA extends RGB with an alpha channel for transparency:
rgba(R, G, B, A)
The alpha value ranges from 0 (transparent) to 1 (opaque).
rgba(193, 79, 41, 1) → opaque
rgba(193, 79, 41, 0.5) → 50% transparent
rgba(0, 0, 0, 0.2) → subtle dark overlay
Modern CSS also accepts the space-separated form with alpha after a slash, rgb(193 79 41 / 0.5), and treats rgba() as an alias of rgb().
Comparison: RGB vs RGBA vs HEX
| Format | Channels | Range | Typical Use |
|---|---|---|---|
| RGB | R, G, B | 0–255 | Solid on-screen colors |
| RGBA | R, G, B, A | 0–255, alpha 0–1 | Overlays, shadows, transparent UI |
| HEX | R, G, B (hexadecimal) | 00–FF | CSS, brand specifications |
Common Pitfalls
- Treating
rgb(128, 128, 128)as 50% brightness. Because of gamma, its relative luminance is about 0.22, which matters for contrast calculations. - Mixing comma and space syntax:
rgb(193, 79 41)is invalid. Use all commas or all spaces. - Assuming the brightest screen colors exist in sRGB. Display P3 can show greens and reds that
rgb()cannot reach; those needcolor(display-p3 …), and older screens map them back into sRGB. - Sending RGB files to print. Saturated values such as
rgb(0, 255, 0)fall outside the CMYK gamut and print noticeably duller; see CMYK colors.
Where RGB and RGBA Are Used
RGB-based values appear in nearly all digital environments:
- CSS for web interfaces
- Design tools such as Figma, Sketch, and Photoshop
- Mobile and desktop UI frameworks
- Game rendering engines
- LED displays and digital signage
Using RGB and RGBA in Practice
Most workflows rely on color pickers or sampling rather than typing values by hand. The swatch.ing color extractor pulls RGB values straight from a photo or screenshot.
Hands-on ways to build intuition:
- Inspect elements in your browser’s dev tools and read their computed RGB values
- Raise one channel at a time from 0 to 255 and watch where the color moves
- Create a button with
rgb()and an RGBA hover overlay - Compare RGB, HEX, and HSL versions of the same sampled color