function

Alpha() — CSS reference

Draft relative alpha function: replaces the alpha of an origin color without changing its color components. The alpha keyword can refer to the origin alpha inside the replacement expression. Here a literal rgba fallback is equivalent for the chosen red; it does not calculate from a dynamic origin.

Formal Syntax & Structure

css syntaxcss
alpha(from red / 50%)

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>alpha()</title><style>body{margin:0;background:white}#a{box-sizing:border-box}#a{color:rgb(255 0 0 / 50%);color:alpha(from red / 50%)}</style><body><div id="a">Example</div></body></html>
CSS Reference