Color Swatch to CSS - Online Palette to Variables
Paste a list of hex colors and generate CSS custom properties for them. Create your design token file instantly.
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.
Paste a list of hex colors and generate CSS custom properties for them. Create your design token file instantly.
Pick a color in the Display‑P3 space and get the CSS color() function. See the difference from sRGB. For modern design.
Grid of all 148 named CSS colors. Hover to see detail, click to copy the name or hex. Essential frontend reference.
Use the light‑dark() CSS function to change colors based on color scheme. Build a simple dark mode toggle with one property.
Set a custom accent color for checkboxes, radios, range, and progress. See the browser’s rendering. Copy the CSS.
Experiment with CSS container queries in a live editor. Resize the container and see styles change based on its width/height. Learn modern responsive.
Type a CSS color name like 'tomato' or 'mediumseagreen' and instantly get its hex code and preview. Complete named colors list.
Test the upcoming contrast‑color() CSS function. Get white or black automatically for a given background. See it live.
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.
Experiment with CSS container queries. Resize a container and see the styles change according to its size, not the viewport. Learn the new spec.
Design a light and dark theme by picking colors for backgrounds, text, and links. Get the CSS for both themes. Local.
Fetch a website's CSS and extract :root custom properties (‑‑color) to reveal its design token palette. For learning and inspiration.
Paste a stylesheet and extract every unique color (hex, rgb, hsl) into a palette. Swatches displayed. Copy as JSON.
Pick a base color and generate a full palette of 10 shades (50 to 900) like Tailwind CSS. Copy as hex or hsl.
Style an `<input type='range'>` with custom track and thumb. Cross‑browser CSS. Preview and copy the code.
Enter a palette of colors and see a grid showing whether each foreground/background pair passes AA or AAA contrast. Must for designers.
Paste body text and test different font/background combos. See an actual passage rendered, not just a ratio. True feel for legibility.
Generate single random colors or full palettes. Displays hex, RGB, and copy on click. Great for design inspiration.
Convert RGB and RGBA color values to their HEX or HEX+alpha representation. Live preview and copy CSS color strings instantly.
Classic HSV color wheel with sliders. See hex, RGB, and HSL equivalents. Intuitive for artists. No server interaction.
Select a color and see which cocktails match it roughly. Blue for Blue Lagoon, red for Negroni. Fun bar guide.
Use <input type='color'> and see its change events and value in hex. Understand the native color picker. Quick demo.
Build the same layout with both Grid and Flexbox side by side. See the code differences and visual results.
A replica of the famous Flexbox Froggy game: solve alignment puzzles by writing CSS. Progress saved locally. Fun frontend learning.
Find the official name of any hex color from the extended color dictionary. Search by name to get the hex code. Handy for CSS and design language.
Type a word like 'sunset' or 'calm' and generate a color palette inspired by that mood. Simple associative mapping.
See the Pantone Colors of the Year and popular palettes from past years. Get hex codes. Design inspiration.
Add grid items beyond defined tracks and see how implicit rows/columns expand. Set sizes interactively. Master the grid.
Test if your display supports HDR colors by rendering a gradient in Rec.2020 space. See what you're missing. Canvas based.
Preview any website inside emulated device viewports (iPhone, iPad, various resolutions). No screenshot, live interaction in an iframe. Local tool.