-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OKLab and OKLCH support #87
Comments
Hi Andrey! Totally agree and already planning to work on that. I always follow CSS Color Level specs and since OKLab and OKLCH are now part of it, I'm definitely going to implement a plugin for these color spaces after my vacation ⛷ |
cc @EricRovell |
@romainmenke’s code in |
@omgovich Would be glad to work on this issue.. What's the plan? Should I start working on |
@EricRovell That is awesome! Take as much time as you need) |
Hello there. I am working on this issue and already have something to share. But before I push anything I need some help here: Let's say we added both lab & oklab plugins at the time. What behavior should we expect for the parse function? The problem is that they both have the same format, so not sure how to determine one from the other. |
In CSS they have different function name How did colord parse works and what is the problem? |
Parser for LAB color is very basic and allows to pass only Object in the next format e.g. Here part of the implementation: export const parseLaba = ({ l, a, b, alpha = 1 }: InputObject): RgbaColor | null => {
if (!isPresent(l) || !isPresent(a) || !isPresent(b)) return null; For OKLAB parser I've created a similar basic parser that receives the same Object. Simplest solution here indicate which format we want to parse e.g. |
Or we can add |
Please have a look https://github.com/omgovich/colord/pull/92/files |
Hey guys! I apologize for the huge delay! Since I lived near the Ukrainian border and I'm against this terrible war, I had to leave Russia. Spent a few months trying to relocate and settle in another country, so I wasn't able to work on open-source. Will do my best to make this feature merged. |
@omgovich of course! Take care! |
@omgovich hope all is good, wanted just to ask if there's any chance to have OKLCH, which seems to be to most sane human-usable format, to be implemented? 🙂 |
Lab/LCH is better than HSL, but also have one problem. When you change
C
orH
component for blue color it could change hue to violet.This issue was fixed in OKLab and OKLCH.
I think we should add it to
colord
because it could be winner in upcoming color revolution in CSS.It is not just a “random color space”:
oklab()
andoklch
is part of CSS Colors 4oklab()
andoklch()
support for CSS.oklab()
andoklch()
The text was updated successfully, but these errors were encountered: