See how computers use binary and hexadecimal to represent millions of different colors.
Every screen you look at is secretly a collection of millions of tiny red, green, and blue lightbulbs. How do these three simple colors combine to show you a sunset, a movie, or a video game?
Digital displays use the RGB color model, an additive system where Red, Green, and Blue light are mixed to create colors. Each of these three colors is called a channel. In a standard system, each channel is allocated 8 bits of memory. Since , each color can have an intensity value ranging from (completely off) to (full brightness). When all three channels are at , you see white light; when all are at , you see black.
Quick Check
If a computer uses 8 bits for the Red channel, how many different levels of brightness can that Red light have?
Answer
256 levels (from 0 to 255).
Writing color values in binary (like for ) is tedious for humans. Instead, we use Hexadecimal (Base-16). A 6-digit hex code like #FF5733 is actually three pairs of digits. The first pair is Red, the second is Green, and the third is Blue. Because one hex digit represents 4 bits, a pair of hex digits represents exactly 8 bits (one byte). This allows us to represent the full range using just two characters, from to .
Let's break down the hex code #FF00FF: 1. Split into pairs: Red=, Green=, Blue=. 2. Convert to decimal: , . 3. Result: This color has full Red and full Blue, but no Green. This creates Magenta.
Quick Check
In the hex code #0000FF, which color channel is set to maximum brightness?
Answer
The Blue channel.
Most modern devices use 24-bit color, often called True Color. This means bits for Red, for Green, and for Blue (). To find the total number of possible colors, we multiply the possibilities of each channel together. Since each channel has options, the calculation is , or . This results in over 16.7 million unique colors—more than the human eye can even distinguish!
How many colors are possible if we only used 3 bits per channel (9-bit color)? 1. Calculate options per channel: . 2. Multiply the three channels: . 3. Total colors: unique shades.
A single 1080p image contains roughly pixels. If each pixel uses 24-bit True Color, how many bits are needed to store the uncompressed image? 1. Formula: . 2. Calculation: bits. 3. Convert to Megabytes: bytes, or MB.
Which of the following hex codes represents a shade of pure grey (where all colors are equal)?
What is the decimal value of the hex pair 'FF'?
Increasing the number of bits per channel increases the total number of colors available.
Review Tomorrow
Tomorrow, try to explain to a friend why #000000 is black and #FFFFFF is white using the concept of 'additive light'.
Practice Activity
Open a photo editor or 'Google Color Picker' and try to guess the hex code for a bright yellow or a dark purple.