The Math of Smooth Color

How does a computer blend one color into another? It's all math.

1

The Space Between

Pick two colors. What happens in between them?

Start Color
End Color
#9A89F0

Position: 50%

Drag the slider to travel through the gradient. At 0% you're at the start, at 100% you're at the end.

Interpolation

The computer calculates every color by mixing start and end based on your position.

2

RGB Math Revealed

Every color is just three numbers: Red, Green, and Blue. Watch what happens to each channel.

RED
128
GREEN
128
BLUE
128
color = start + (end - start) × t
Where t is your position (0 to 1). This runs separately for R, G, and B.
3

Steps to Smoothness

A gradient isn't infinite colors—it's a specific number of steps. How many do you need?

Your gradient:
256 steps:

10 Visible Bands

With fewer steps, you can see distinct bands instead of a smooth blend.

256 = Smooth

Each RGB channel has 256 values (0-255). That's why 256 steps looks perfect!

Fun Fact

The "banding" you see with few steps is called posterization—the same effect used in pop art!

4

The Easing Effect

Linear interpolation spreads colors evenly. Easing creates more of one color, less of another.

Linear (Even)

Selected Easing

Ease In (t²)

Starts slow, ends fast. More start color, quick transition to end.

Ease Out

Starts fast, ends slow. Quick start, lingers on end color.

Ease In-Out

Smooth S-curve. Gentle transitions at both ends.

5

The Dithering Trick

With few colors, you see ugly bands. Dithering mixes pixels to fake smooth transitions.

Without Dithering Sharp ugly bands
Zoomed in:
With Dithering Pixels blend smoothly
Zoomed in:

What's Happening?

Dithering adds a checkerboard pattern of alternating colors. Your eye mixes them together!

Why It Matters

6 colors + dithering looks almost as good as 256—perfect for limited palettes like GIFs!

Fun Fact

Old video games used dithering to create the illusion of more colors than the hardware could display!

Color Math Master!

You now understand how computers create smooth gradients: RGB interpolation, gradient steps, easing functions, and dithering.

0
Colors Mixed
0
Experiments
0
Time Exploring

RGB Interpolation

Blend colors by mixing their Red, Green, and Blue channels separately.

The t Parameter

Position in a gradient (0 to 1) determines how much of each color to mix.

Gradient Steps

More steps = smoother gradient. 256 steps looks perfectly smooth.

Easing Functions

Curved interpolation creates non-linear color distributions.

Dithering

Adding intermediate colors hides banding with fewer total colors.

Ready to Create?

Put your new knowledge into practice!

More Discoveries

Suggest a Correction