Replies: 1 comment
-
Using external API for hex→oklch convert is not the best way to design VS Code plugin. Just convert it locally on the client’s machine. I recommend import { oklch, parse, format } from 'culori'
formatCss(oklch(parse(hexColor))) That gist will work too, it looks exactly what |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I've recently discovered the OKLCH color space as a result of working with the DaisyUI framework and the benefits of it are clear.
I've noticed there are no extensions within VS Code that enable conversions of colors into the OKLCH space, and I thought as a nice challenge I would explore what it would take to to build one. As such I was wondering if there was an API that your site offers that would enable me to say, end over a HEX or a RGB value and get back the OKLCH value? I would love to be able to right click a color within VS Code, choose 'Convert color to OKLCH' from the context menu and have it automatically change the colour....
EDIT: Straight after posting this I have come across THIS gist which seems to do what I am after so I will play around with this first....
Beta Was this translation helpful? Give feedback.
All reactions