What is CSS Color Mix Generator?
The CSS color-mix() function mixes two colors in a specified color space. It creates color variations directly in CSS without a preprocessor like Sass. Using oklab produces more perceptually uniform results than srgb. Common use cases include hover states, borders, subtle backgrounds, and muted text -- all derived from a single base color.
Quick answer
Use color-mix() to blend two colors in a specified color space, such as oklab or srgb. It is useful for creating tint, shade, and hover variants from a single base color without a preprocessor.
Limitations
- color-mix() requires Chrome 111+, Edge 111+, Safari 16.2+, and Firefox 113+. Older browsers do not support it and will ignore the declaration.
- The oklab color space produces more perceptually uniform results than srgb. Mixing in srgb can create muddy intermediates.
- color-mix() may not reference CSS custom properties that contain color-mix() output in some older browser versions due to property cycle detection.
How to use this tool
- Enter a base color as a hex value.
- Review the calculated color-mix() variants using white, black, or transparent.
- Copy each color-mix() declaration into your CSS.
- Use the generated custom properties for consistent color theming.
What you can use it for
- Create hover states by mixing a color with white or black.
- Generate subtle background tints from a brand color.
- Build border colors that are slightly darker than the background.