CSS Filter Generator - Online Visual SVG Filter Builder
Interactively apply CSS filter functions (blur, brightness, contrast, etc.) to an image and copy the resulting filter property. No coding required.
UD5 Toolkit
color-mix() Playground
Visual generator for the CSS Color Level 5 color-mix() function â blend colors in any color space
.my-element {
background-color: color-mix(in oklch, #3b82f6 50%, #eab308);
}
color-mix()?
color-mix() is a CSS function introduced in CSS Color Level 5 that allows you to blend two colors together in a specified color space. It returns a new color that is the weighted average of the two input colors. Unlike traditional opacity-based blending, color-mix() lets you choose the interpolation color space, which dramatically affects the visual result. This is a game-changer for creating dynamic color systems, hover states, and design tokens directly in CSS without preprocessing.
For the most perceptually uniform and natural results, use oklch or oklab. These modern color spaces are designed to match human perception, avoiding the "gray zone" problem that occurs in sRGB when mixing complementary colors (like blue and yellow). oklch is especially recommended for UI design because it preserves hue better during blending. Use srgb only when you need consistent results with legacy rendering or when matching existing sRGB-based designs.
mix()?
Sass's mix() function only blends in the sRGB color space and works at compile time. CSS color-mix() is native to the browser, supports 14+ color spaces, and can work with CSS custom properties (variables) at runtime. This means you can dynamically update colors based on user interaction, theming, or real-time data â something impossible with preprocessors. Additionally, modern color spaces like oklch produce far superior perceptual blends compared to sRGB.
color-mix()?
As of 2024, color-mix() is supported in all major modern browsers: Chrome 111+ (March 2023), Firefox 113+ (May 2023), Safari 16.2+ (December 2022), and Edge 111+. Internet Explorer does not support it. For older browsers, consider providing a fallback color. You can use @supports (color: color-mix(in srgb, red, blue)) for feature detection. Note that some wide-gamut color spaces like display-p3 and rec2020 may render differently depending on the user's display hardware.
color-mix() with CSS custom properties?
Yes! This is one of the most powerful features. You can define colors as CSS variables and mix them dynamically: color-mix(in oklch, var(--brand-primary) 80%, var(--brand-secondary)). Combined with :hover, :focus, or JavaScript-driven variable updates, you can create entire dynamic color systems without writing a single line of JavaScript color manipulation. This is ideal for design systems, dark mode theming, and accessibility-driven color adjustments.
According to the CSS specification, if the percentages sum to less than 100%, they are normalized proportionally. For example, color-mix(in srgb, red 20%, blue 30%) is treated as red 40% and blue 60% (20:30 ratio normalized to sum 100%). If percentages sum to more than 100%, they are also scaled down proportionally. If no percentages are specified, each color defaults to 50%. If only one color has a percentage, the other gets the remainder (100% minus the specified percentage).
color-mix()?
Common use cases include: (1) Hover/active states â mix a base color with white or black for instant button variants. (2) Design tokens â create entire color ramps from a few base colors. (3) Theming â blend brand colors for light/dark modes. (4) Accessible contrast â dynamically adjust text color by mixing with backgrounds. (5) Gradients â use color-mix() inside gradient stops for smoother transitions. (6) Component variants â generate subtle color variations for cards, badges, and alerts without writing extra CSS classes.
This is the classic demonstration of perceptual non-uniformity in sRGB. In the sRGB color space, blue and yellow are mathematical opposites on the color wheel, so averaging their RGB values produces a neutral gray. However, human perception doesn't follow sRGB math â we perceive blue+yellow as greenish (like mixing paint). The oklch color space was designed to match human perception, so it blends through the hue spectrum naturally, producing a vibrant green at 50%. This is why oklch is recommended for UI color blending.
Interactively apply CSS filter functions (blur, brightness, contrast, etc.) to an image and copy the resulting filter property. No coding required.
Select two paint colors and see approximate mixed result. Visual blending for artists.
Visually name grid areas in a table and generate gridâtemplateâareas CSS. Perfect for complex layouts. Dragâfree.
Build a CSS media query by selecting feature, operator, and value. Copy the exact syntax for your stylesheet.
An interactive color wheel that teaches primary, secondary, tertiary colors, and harmonies. Pick and mix like a pro.
Enter hex codes and download a PNG swatch image with color names. Useful for design spec documents. Built via canvas.
Upload a small pixel art image and get a CSS grid layout that recreates it using divs. Novelty developer tool.
Test the new style() function inside @container to query custom property values. Revolutionary componentâbased responsive design.
Toggle between light and dark mode for a demo page. See how to use the media query. Copy the pattern.
Paste image URLs and generate a responsive masonry or justified gallery layout with lightbox. Copy the HTML/CSS/JS.
Browse the OKLCH color space with sliders for lightness, chroma, and hue. See the CSS oklch() code. Modern and accessible.
Experiment with CSS container queries in a live editor. Resize the container and see styles change based on its width/height. Learn modern responsive.
Start from a base color and use `oklch(from color l c h)` to create lighter or darker variants. Copy the code.
Repeat the growing color sequence. How far can you go? Classic memory game with sound and animations.
Upload a gradient or enter a palette and simulate how it appears with different types of color vision deficiency. Ensure inclusive data visualization.
Paste a media query and instantly check for syntax errors. See if it's correctly formed. Quick developer tool.
Upload a photo and remap its tones to any gradient. Apply stunning color grading. Download result.
Given an RGB value, pick the matching color square. Multiple difficulty levels. Improve your color perception. Fun for designers.
Generate the <meta name='colorâscheme'> tag and CSS property to enable native dark/light rendering. Quick copy.
Create a responsive box that maintains a specific aspect ratio using the aspectâratio property. Copy the simple CSS.
Compare breakâall, keepâall, and overflowâwrap: anywhere/breakâword. Paste long words and see how they wrap.
See a color swatch and guess its hex code. Get scored on accuracy. Improve your color intuition. Fun for designers.
Upload an image at multiple widths and generate a complete <picture> or <img srcset> snippet. Modern web performance.
Toggle imageârendering: auto, pixelated, crispâedges on a scaled image. Essential for pixel art display.
Watch and repeat the growing sequence of colored buttons. How long is your memory? Classic electronic game replica.
Upload any picture and instantly get a 5âcolor palette. Useful for UI design themes. Canvasâbased extraction.
Upload multiple sizes of the same image and generate the complete srcset and sizes attributes. For perfect responsive performance.
Write a compute shader in WGSL and run it in the browser. See the output on a canvas. Learn WebGPU. Realâtime compilation.
Select two or more clay colors and visually approximate the mixed result. Helps plan canes and blends.
Paste a direct link to an image and get its 5 dominant colors with hex codes. No upload, uses canvas with CORS proxy.