hex2tailwind
Convert hex to tailwind v4 colors
hex2tailwind – Convert hex colors to Tailwind CSS v4 classes with perceptual accuracy
Summary: hex2tailwind converts any hex color to the closest Tailwind CSS v4 class using the CIEDE2000 (ΔE00) perceptual color difference algorithm, ensuring precise color matching based on human vision. It supports the Tailwind v4 OKLCH palette and provides instant code exports for CSS and JS configurations.
What it does
It maps hex colors to Tailwind CSS classes by calculating the perceptual difference using the ΔE00 algorithm, aligning with Tailwind v4’s OKLCH palette for consistent hue and contrast across light and dark modes.
Who it's for
Developers needing accurate color mapping to Tailwind CSS v4 classes for design consistency and predictable color scales.
Why it matters
It eliminates guesswork in color matching by using a professional-grade color difference algorithm, improving visual accuracy over standard RGB or HSL methods.