Book a call Free rebuild
Home/Glossary/Design/RGB Color Model

RGB Color Model

April 5, 2023 Updated November 16, 2026 2 min read

Design glossaryRGB is the color model screens use: every color is a mix of red, green, and blue light, with each channel usually set from 0 to 255.

RGB stands for red, green, and blue, the three primary colors of light. Every screen, from a phone to a TV, is a grid of tiny red, green, and blue subpixels, and each color you see is those three lights glowing at different strengths. Because it builds color by adding light, RGB is called an additive model: start from black, add all three at full strength, and you get white.

How it works

In the usual 8-bit form, each channel takes a value from 0 (off) to 255 (full), which gives 256 × 256 × 256, or about 16.7 million, possible colors.

  • rgb(255 0 0) is pure red; rgb(0 0 0) is black; rgb(255 255 255) is white.
  • Red and green light make yellow, green and blue make cyan, and red and blue make magenta.
  • Equal values in all three channels always give a neutral gray, such as rgb(128 128 128).

A HEX code is the same three numbers written in base 16: #FF0000 is rgb(255 0 0). Designers who find RGB numbers hard to adjust by eye often work in HSL instead, which describes the same colors by hue, saturation, and lightness.

RGB in CSS

CSS accepts RGB colors with spaces or the older comma syntax, and an optional alpha value for transparency:

  • rgb(40 66 130) and rgb(40, 66, 130) are the same color.
  • rgb(40 66 130 / 50%) is that color at half opacity. The older rgba() form still works.

By default these colors are in sRGB, the standard color space of the web. Many modern screens can show a wider range, and CSS can reach it with functions such as color(display-p3 ...) and oklch(), but sRGB remains the safe baseline.

RGB versus CMYK

Print works the other way round. Ink subtracts light from white paper, so printers use cyan, magenta, yellow, and black (CMYK). Some bright RGB colors, especially vivid greens, blues, and oranges, have no exact CMYK equivalent and look duller when printed. Brand guides usually list each color in RGB, HEX, and CMYK, and sometimes as a Pantone spot color, for exactly this reason.

Practical tips for websites

  • Export web images in sRGB. Photos saved in CMYK or with an unusual color profile can display with shifted colors in some browsers.
  • Define colors once. In a WordPress block theme, the palette in theme.json becomes CSS custom properties that every block can use, so a color is set in one place.
  • Do not trust one screen. Displays differ in calibration and brightness, so check important colors on a few devices, and check text against its background for contrast.

Source: MDN, rgb().

WP Services

WordPress services at revolutionary pricing.

Productized WordPress services, from builds to care, delivered by Seahawk and tracked in one app. For the WordPress lovers.