In part 1, a color was #RRGGBB. #FF0000 is red.

But what if you want red that's only half visible? That's what alpha is for. You've probably seen codes like these:

#80FF0000 #80000000 #80FFFFFF 

The extra two characters aren't another color. They're alpha.

What alpha does

RGB says what color it is. Alpha says how opaque it is, meaning how much of it shows over whatever is behind. It uses the same range as the other channels, 0 to 255, or 00 to FF in hex:

00 = fully transparent FF = fully opaque 

Opacity vs transparency

These are opposites, and mixing them up causes real bugs.

100% opaque = 0% transparent 50% opaque = 50% transparent 20% opaque = 80% transparent 

If a designer says "make it 20% transparent", that's 80% opaque. Ask which one they mean.

ARGB

A common 32-bit layout puts alpha first:

#AARRGGBB 

So #80FF0000 splits into:

80 FF 00 00 A R G B 

It's red, at roughly 50% opacity.

Why 80 is about 50%

Alpha runs from 0 to 255, so:

alpha = opacity × 255 / 100 

For 50% that's 127.5, which rounds to 128, which is 0x80 in hex. For 25% it's 63.75, rounded to 64, which is 0x40. So #40FF0000 is about 25% opaque red.

Here's a cheat table so you don't have to do the math each time:

100% FF 50% 80 90% E6 40% 66 80% CC 30% 4D 70% B3 20% 33 60% 99 10% 1A 0% 00 

Going the other way

opacity = alpha × 100 / 255 

Take B3. That's 11 × 16 + 3 = 179, and 179 × 100 / 255 is about 70%.

Decoding a few

#80FFFFFF splits into 80 FF FF FF. Alpha is about 50%, RGB is white. So: half-opaque white.

#80000000 is 80 00 00 00. Half-opaque black. This one shows up constantly as an overlay.

Here's the one that started this series for me, #B4555555:

B4 55 55 55 A R G B 

The color is #555555, a mid-dark gray. Alpha is B4, which is 180, which is about 71%. So it's 71% opaque gray.

Why deleting characters changes everything

Say you take #B4555555 and chop off the last two characters, hoping to drop the transparency:

#B45555 

That doesn't remove alpha. It changes how the string is parsed. Six digits means RRGGBB, so now red is B4, green is 55, blue is 55, and nothing says anything about alpha. You've got a fully opaque, reddish color. It's a different color entirely.

Count the digits and split first. Don't edit hex by feel.

Opacity isn't a color

#FF0000 and #80FF0000 are the same color: red. The only difference is that the second one says how much of it to show. RGB is what color, alpha is how opaque.

Where it matters

A transparent color needs something behind it to be useful. Put 50% black over a blue background and you get a darker blue. The black doesn't replace the blue, it blends with it. That's how image overlays, modal backdrops, shadows, disabled controls and scrims work. Part 3 shows the actual math.

The ordering problem

Not everyone agrees where alpha goes. Half-opaque red can be:

#80FF0000 (AARRGGBB) #FF000080 (RRGGBBAA) 

Same components, different positions. Android uses ARGB. CSS accepts #RRGGBBAA and also rgba(255, 0, 0, 0.5). Flutter uses ARGB-style integers like 0x80FF0000. Some APIs skip hex and take alpha as a separate parameter, either 0 to 255 or 0.0 to 1.0. Check what the API you're using expects before pasting a code across.

Summary

Alpha is a fourth channel. RGB says what color, alpha says how opaque. In #AARRGGBB, #80FF0000 is 50% alpha, full red, no green, no blue. Convert with alpha = opacity × 255 / 100 and back with opacity = alpha × 100 / 255.

What's left is the question of what actually happens when a transparent color lands on another one. That's part 3.