CSS Color Function Explorer - Online Write Modern Colors
Write modern CSS color functions like oklch(), lab(), hwb() and see the rendered color with fallback. Copy compatible code.
UD5 Toolkit
Visually explore the CSS color-mix() function across different color spaces in real time.
Use this directly in your CSS for color, background-color, border-color, etc.
background-color: color-mix(in srgb, #6366f1 50%, #f59e0b 50%);
The color-mix() CSS function takes two colors and returns the result of mixing them in a specified color space, with an optional percentage for each color. It's part of the CSS Color Module Level 5 specification and allows developers to dynamically blend colors directly in CSS without preprocessors like Sass or LESS.
As of 2024, color-mix() is supported in Chrome 111+, Firefox 113+, Safari 16.2+, and Edge 111+. It has broad modern browser support (over 90% global coverage). For older browsers, consider providing fallback colors using @supports queries.
sRGB is the standard color space for the web but it's not perceptually uniform — equal numerical steps don't produce equal visual changes. OKLab is designed to be perceptually uniform, meaning gradients and mixes look more natural and smooth to the human eye. For color mixing that looks visually balanced, OKLab or OKLCh are often better choices than sRGB. Try switching between them on the gradient strip above to see the difference!
Each color in color-mix() can have an optional percentage. If both percentages are specified and sum to 100%, that's the exact ratio. If only one is specified, the other automatically becomes 100% - specified%. If neither is specified, it defaults to 50%–50%. If percentages sum to less or more than 100%, they are scaled proportionally. Example: color-mix(in srgb, red 30%, blue) → blue gets 70% automatically.
Absolutely! This is one of the most powerful use cases. You can define colors as CSS custom properties and mix them dynamically: --primary: #6366f1; --accent: #f59e0b; background: color-mix(in oklab, var(--primary) 70%, var(--accent) 30%); This enables theme systems with dynamic color blending that were previously only possible with preprocessors.
Common use cases include: creating dynamic hover/active states by mixing with white or black; generating accessible color palettes from a base color; creating semi-transparent overlays without opacity; building theme systems with CSS custom properties; generating gradient midpoints; and creating color variations for charts and data visualizations — all directly in CSS without JavaScript or preprocessors.
Write modern CSS color functions like oklch(), lab(), hwb() and see the rendered color with fallback. Copy compatible code.
Use the light‑dark() CSS function to change colors based on color scheme. Build a simple dark mode toggle with one property.
Pick a color in the Display‑P3 space and get the CSS color() function. See the difference from sRGB. For modern design.
Paste a list of hex colors and generate CSS custom properties for them. Create your design token file instantly.
Interactively create colors in HWB space and get the CSS hwb() function. Simplifies tint/shade workflows. Live preview.
Test the upcoming contrast‑color() CSS function. Get white or black automatically for a given background. See it live.
Generate a range of tints and shades from a single hex color. Ideal for data visualization, UI design systems, and Tailwind custom palette creation. Local tool.
Discover beautiful color palettes for your projects. Generate random, complementary, or trendy schemes and copy hex codes. Useful for designers and developers.
Grid of all 148 named CSS colors. Hover to see detail, click to copy the name or hex. Essential frontend reference.
Set a custom accent color for checkboxes, radios, range, and progress. See the browser’s rendering. Copy the CSS.
Style the <progress> and <meter> elements with cross‑browser CSS. Adjust colors and sizes. Copy the final styles.
Fetch a website's CSS and extract :root custom properties (‑‑color) to reveal its design token palette. For learning and inspiration.
Enter a CSS selector and see its specificity broken down into A,B,C columns with a visual weight comparison. Learn specificity.
Type a CSS color name like 'tomato' or 'mediumseagreen' and instantly get its hex code and preview. Complete named colors list.
Paste a stylesheet and extract every unique color (hex, rgb, hsl) into a palette. Swatches displayed. Copy as JSON.
Enter color in any CSS format and see all other representations. Live preview. Swatch history.
A complete, searchable list of all 140+ named HTML/CSS colors with their hex codes and color previews. Click to copy code. Essential web reference.
Select two paint colors and see approximate mixed result. Visual blending for artists.
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
Create a pure CSS scroll progress indicator using animation‑timeline: scroll(). No JavaScript. Copy the complete code.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Limit browser gestures on an element: pan‑x, pinch‑zoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Create complex linear gradients with any number of color stops, exact angles, and length units. Live preview and CSS code.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Generate a random HTML/CSS card with different box model properties. Inspect and guess the size. For learners.
Design a button or card that glows on hover. Adjust shadow color, spread, and transition. Copy the CSS. Rich UI.
Create a realistic letterpress (debossed) text effect using CSS text‑shadow and background. Adjust depth and light direction. Copy code.
Generate a subtle noise/grain texture as a CSS background pattern. Adjust opacity and size. For that film look.
Create a customizable checkerboard or grid background using pure CSS gradients. Adjust cell size and colors. Copy the code.
Upload two images and apply CSS blend modes (multiply, screen, overlay, etc.). See the result and copy the filter CSS. Pure frontend.