An alpha channel is a color value from 0 to 1 that controls transparency. An alpha of 0 is completely transparent, while 1 is completely opaque; percentages from 0% to 100% express the same range. section 7.1.1
Use alpha values with common CSS color notations:
- In rgb(), write the alpha after a slash: rgb(128 0 128 / 0.5). section 7.1.1
- In hexadecimal notation, append a two-digit alpha value: #rrggbbaa. 00 is transparent and ff is opaque. section 7.1.1
- The same slash notation works with lab(), such as lab(30% 60 -50% / 0.25). section 7.1.3
Blending a transparent blue over red
For a blue foreground with αs = 0.5 over an opaque red background, source-over compositing calculates each channel as Cout = Csαs + Cb(1 − αs). Red becomes 0.5, green 0, and blue 0.5, producing normalized (0.5, 0, 0.5), or rgb(128 0 128). section 7.6.2
h1
color: rgb(128 0 128 / 0.5);
}
Inspect the CSS listing for a semitransparent purple color expressed with rgb() alpha syntax. section 7.1.1


