RGB Color Model — Definition, Formula & Example
The RGB color model is a way to describe any color on a screen as a mix of red, green, and blue light. Each color gets three numbers that say how bright each light is.
The RGB color model is an additive color model. It represents a color as an ordered triple of nonnegative intensities of the red, green, and blue primaries. In standard 8-bit digital form, each component is an integer from to , so every color is a lattice point of the cube .
Key Formula
Where:
- = Total number of distinct colors the model can represent
- = Number of possible intensity levels for each channel (256 for values 0 through 255)
How It Works
Because RGB mixes light, adding more of a channel makes the color brighter. The triple is black, meaning all lights are off. The triple is white, meaning all lights are at full strength. Full red plus full green, , gives yellow. Red plus blue gives magenta, and green plus blue gives cyan. When all three values are equal, such as , you get a shade of gray.
Worked Example
Problem: A computer screen stores each pixel's red, green, and blue values as whole numbers from 0 to 255. How many different colors can one pixel display?
Step 1: Count the possible values for one channel. The list 0 through 255 includes both endpoints.
Step 2: The red, green, and blue choices are independent. Use the multiplication principle across all three channels.
Step 3: Since , each channel uses 8 bits. That makes 24 bits per pixel, which is why this is called 24-bit color.
Answer: One pixel can display 16,777,216 different colors, or .
Why It Matters
Web designers write RGB colors as hex codes. In #FF8000, the pair FF is 255, 80 is 128, and 00 is 0, so the color is orange . Programming and graphics courses use these triples to edit photos, build video games, and code websites in HTML and CSS.
Common Mistakes
Mistake: Saying each channel has 255 possible values because the maximum is 255.
Correction: The range starts at 0, so there are values. Using 255 gives colors, which undercounts by almost 200,000.
