CSS/Properties/color/RGBA
RGBA(Red-Green-Blue-Alpha)
The RGB color model is extended in this specification to include “alpha” to allow specification of the opacity of a color.
The format of the RGBA Value
rgba(R,G,B,A) -integer-
The format of an RGBA value in the functional notation is ‘rgba(’ followed by a comma-separated list of three numerical values (three integer values), followed by an <alphavalue>, followed by ‘)’.
rgba(R,G,B,A) -percentage-
The format of an RGBA value in the functional notation is ‘rgba(’ followed by a comma-separated list of three numerical values (three percentage values), followed by an <alphavalue>, followed by ‘)’.
Example
Alpha | hsla(H,S,L,A) | Color | |
---|---|---|---|
0.0 | rgba(255, 0, 0, 0.0) | fully transparent | |
0.2 | rgba(255, 0, 0, 0.2) | ||
0.4 | rgba(255, 0, 0, 0.4) | ||
0.6 | rgba(255, 0, 0, 0.6) | ||
0.8 | rgba(255, 0, 0, 0.8) | ||
1.0 | rgba(255, 0, 0, 1.0) | fully opaque |
Point, Note
- If RGBA values are not supported by a user agent, they should be treated like unrecognized values per the CSS forward compatibility parsing rules ([CSS21], Chapter 4). RGBA values must not be treated as simply an RGB value with the opacity ignored.
CSS Reference
CSS Color defines the RGBA color values in 4.2.2. RGBA color values.