Glossary Design & Media

RGB

RGB describes colour as amounts of red, green and blue light, each from 0 to 255 on screens.

Last reviewed:

AdSense Placeholder
Slot: header_reference_page

In more detail

RGB is additive: light is added, so full red and full green make yellow, and all three at full strength make white. With 8 bits per channel each runs from 0 to 255, three channels give 16,777,216 colours, and hex codes are simply the three values in Hexadecimal. CSS also accepts percentages and an alpha value, as in rgb(51 102 204 / 50%). The numbers usually refer to the sRGB colour space, the standard for the web.

Why it matters

The same RGB numbers can look different on different screens: wide-gamut displays show more saturated colours unless the image carries a colour profile and the software manages colour. Printers use CMYK inks instead, and some bright screen colours, such as pure rgb(0, 255, 0), cannot be printed exactly. For choosing related shades, HSL is usually easier to reason about than raw RGB values.

Example

rgb(51, 102, 204) is the same colour as the hex code #3366cc, because 51 = 0x33, 102 = 0x66 and 204 = 0xCC. Mixing light: rgb(255, 255, 0) is yellow, rgb(255, 0, 255) magenta and rgb(128, 128, 128) a mid grey.

Common confusion

RGB mixes light (additive); CMYK mixes ink (subtractive), where adding colours makes the result darker rather than lighter. HSL is not a different colour space, only a different notation for the same RGB colours.

AdSense Placeholder
Slot: footer_leaderboard