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
Enter fullscreen mode
Exit fullscreen mode
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
Enter fullscreen mode
Exit fullscreen mode
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
Enter fullscreen mode
Exit fullscreen mode
If a designer says "make it 20% transparent", that's 80% opaque.…