Intro

RGB (Red, Green, Blue) is an additive color model in which the red, green, and blue primary colors of light are added together to form different colors.

  • Additive: colors mix by adding light → black = (0,0,0), white = (255,255,255)
  • Secondary colors: Red + Green → Yellow, Green + Blue → Cyan, Blue + Red → Magenta
  • “Useful for digital media because it directly corresponds to how screens display colors. Monitors and displays use tiny red, green, and blue pixels to create the colors you see” 1
img

A diagram demonstrating additive color with RGB

A color in the RGB model is created by combining varying intensities of red, green, and blue light. This is expressed as a triplet (R,G,B), in which each component channel is represented using an 8-bit integer value, ranging from 0 (no light/black) to 255 (full intensity/white).

Example:

  • (255, 0, 0) → pure red
  • (0, 255, 0) → pure green
  • (0, 0, 255) → pure blue
  • (255, 255, 255) → white
  • (0, 0, 0) → black
img img

An additive model where colors are created by combining red, green, and blue light at different intensities. Each pixel holds three values — one for each color channel — ranging from 0 to 255.

RGB Color Cube

RGB color cube

Footnotes

  1. https://www.freecodecamp.org/learn/responsive-web-design-v9/lecture-working-with-colors-in-css/what-is-the-rgb-color-model ↩