How to get a colour palette from an image
How palette extractors pick colours from a photo with k-means clustering, why they miss small accent colours, and how to turn the result into an accessible web palette.
Tag
6 articles
How palette extractors pick colours from a photo with k-means clustering, why they miss small accent colours, and how to turn the result into an accessible web palette.
How linear, radial and conic gradients work in CSS, with copy-ready code for stripes, pie charts, text overlays and gradient borders, and how to stop blends turning muddy.
CSS has no mesh gradient function, but layered radial gradients get you the same soft, flowing look in a few hundred bytes. Here is how they work, how to pick colours, and how to animate them.
Around 1 in 12 men and 1 in 200 women have colour vision deficiency. Here is how the main types affect your UI, how to check designs with a simulator, and how to fix colour-only information.
WCAG asks for 4.5:1 contrast for normal text and 3:1 for large text at level AA. Here is what each rule covers, how the ratio is calculated, and the exceptions.
OKLCH lets you build colour palettes with evenly spaced shades and predictable contrast. Here is the syntax, an 11-step scale with real contrast results, and how to use it safely.
Enjoying Refract Tools? ☕️
Refract is a personal project built to make design and development a little easier, with practical, intuitive tools that help you work smarter, without AI doing the work for you.
If you find the tools useful, consider buying me a coffee. Every bit of support helps me keep building, improving, and sharing more free tools with the community.
Thanks for being here! ❤️
Buy me a coffee