← All notes

color-mix(): mix two colors in a chosen color space

Answer: color-mix() blends two colors and returns the result. You define the interpolation method and how much of each color to use. Different color spaces give different outcomes.

What you pass to color-mix()

Use color-mix() when you want a blend of two colors.

Mixing with white or black can lighten or darken a color.

Define the two colors, how you want them to mix, and how much of each color you want.

That “how” is the interpolation method.

Finding the average of two colors will be different depending on the color space.

If the space has a hue, you also choose a direction around the wheel.

Shorter is the default path. Longer, increasing, and decreasing are available.

Choosing a color space

The color-mix() function lets you mix colors in any of the supported color spaces.

Developers can choose which color space they mix in, and how dominant each color is.

Different color spaces can drastically change the results of a mix.

oklab is the default space for this kind of mix, and for gradients too.

You can specify alternative color spaces too, to tailor the mix.

If you want a vibrant mix result, use hsl or hwb.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: web.dev, Color; Chrome Developers, CSS color-mix(). CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: web.dev, Color; Chrome Developers, CSS color-mix(). CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC.

Cite this

Permanent ID: iil:note:7ar5evw2

iinventedlight. 2026. "color-mix(): mix two colors in a chosen color space." iinventedlight Library, iil:note:7ar5evw2, version of 2026-11-23. https://iinventedlight.com/library/notes/css-color-mix/. License: CC-BY-4.0.

@misc{iil_note_7ar5evw2,
  author = {{iinventedlight}},
  title = {{color-mix(): mix two colors in a chosen color space}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-23},
  url = {https://iinventedlight.com/library/notes/css-color-mix/},
  note = {Permanent ID iil:note:7ar5evw2. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/css-color-mix.md.