-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
Hello, I stumbled across this library while working on a project of mine. I'm working to extract daisyui colors, which are in oklch format and use them in my canvas system. I'm struggling getting the conversion to work and would love ideas on how to do this better. This library looks like it should be the right answer to this kind of situation
function oklchToHex(oklchStr: string): string {
const [l, c, h] = oklchStr
.split(",")
.map((val) => val.replace("%", ""))
.map(Number);
const color = oklch({ mode: "oklch", l: l / 100, c, h });
return formatHex(color);
}Metadata
Metadata
Assignees
Labels
No labels