Color Conversion
Color Conversion
Section titled “Color Conversion”Utilities for converting colors between different color spaces and parsing color strings.
Color Space Conversions
Section titled “Color Space Conversions”Convert between RGB, HSL, and HSV color spaces:
hslToHsv(h, s, l)- Convert HSL to HSVhsvToHsl(h, s, v)- Convert HSV to HSLhslToRgb(h, s, l)- Convert HSL to RGBrgbToHsl(r, g, b)- Convert RGB to HSL
Color Parsers
Section titled “Color Parsers”Parse color strings into structured objects:
parseHSL(color)- Parse HSL/HSLA color stringsparseOKLCH(color)- Parse OKLCH color strings
Examples
Section titled “Examples”import { hslToRgb, parseHSL } from 'huey/utils'
// Convert HSL to RGBconst rgb = hslToRgb(180, 50, 50)// { r: 64, g: 191, b: 191 }
// Parse HSL stringconst parsed = parseHSL('hsl(180, 50%, 50%)')// { h: 180, s: 50, l: 50, a: 1 }