@arolariu/components / convertHexToHslString
Function: convertHexToHslString()
convertHexToHslString(
hexColor):string
Defined in: lib/color-conversion-utilities.ts:20
Converts a hexadecimal color code to an HSL string for CSS variables. The output format matches Tailwind CSS HSL variable format: "h s% l%"
Parameters
hexColor
string
Hex color code (e.g., "#06b6d4" or "06b6d4")
Returns
string
HSL values as "h s% l%" string suitable for CSS variables
Example
convertHexToHslString("#06b6d4"); // "187 94% 43%"
convertHexToHslString("#ec4899"); // "330 81% 60%"