- 1
- 2
- Colors and weights
Two colors at 25% and 75% contribute different amounts. Their alpha also participates.
- Space and path
Colors are converted to the chosen space. In a polar space, hue follows an angular path.
- Color and background
The result may be transparent. When painted, it combines with the actual background.
A value, not a layer effect
color-mix() returns a color. mix-blend-mode blends an element with its backdrop using blend modes; the operations are not interchangeable.
Check contrast at the end
Perceptual mixing does not guarantee readable text. Check the composited color against its background in every theme and state.
Use the result wherever CSS accepts a color: backgrounds, text, borders, or shadows. It does not create a gradient or blend pixels from two elements. Inputs can be hex, rgb(), hsl(), oklch(), currentColor, or variables; their notation does not set the interpolation space.