concept
color-interpolation — CSS reference
Interpolation converts colors into a chosen space, handles missing components and hue where applicable, and combines coordinates with alpha-aware weighting. Linear-light interpolation differs from gamma-encoded interpolation. Default space depends on the consuming feature and legacy syntax, so specify a space for intentional results.
Formal Syntax & Structure
css syntaxcss
color-mix(in srgb, black, white); color-mix(in srgb-linear, black, white);Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS color lab</title><style>body {margin:0} .sample {height:12px;background:#006050}p {padding:12px;background:white;color:black;border:2px solid currentColor} #a{color:color-mix(in srgb, black, white)} #b{color:color-mix(in srgb-linear, black, white)}
</style><body><p id="a">First color sample</p><p id="b">Second color sample</p></body></html>