-
Notifications
You must be signed in to change notification settings - Fork 92
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
oklab / oklch? #87
Comments
I've tried to implement it in this notebook — not 100% sure I got it correctly. |
The implementation looks good to me. Maybe |
I'm sorry I'm not sure I understand. Halving a and b would result in diverging from the original proposal, thus making our implementation incompatible? I agree that it would be nice to fix the computation to L=1 but that too should be done upstream? |
Oops, sorry — I was a bit cryptic. I meant halving the interval for With
In some discussion related to the original post, Jacob Rus mentions maybe rounding off the matrices to fewer digits... in my experiments, fewer digits in Oklab's M1 multiplied with the sRGB to XYZ matrix lands it much closer to 1, but it seems more and more implementations are cropping up and choosing to use the original values. |
Thanks for the clarification and the references. I've updated the notebook accordingly. |
OKLCH could be even more interesting as it simplifies color manipulation and makes it more consistent for a human eye. |
oklab.plane.mp4@danburzo @Fil I think that the issue here is the simplified matrix that Björn gave in his blog. inv(M2)=[ But in the code you have the simplified formula: const l_ = L + 0.3963377774 * a + 0.2158037573 * b; that uses rounded values. For better accuracy I suggest you to use unrounded values directly from the inverted matrix. Cheers, PS: Attached my implementation of the srgb ab plane when L is changing. When L=0 or L=1 I get a single point (RGB 0,0,0 and RGB 255,255,255). |
It would be awesome to have this color space available in D3! I'm interested in prototyping a color picker based on this space, in the same spirit as these old color picker examples https://blocks.roadtolarissa.com/mbostock/ba8d75e45794c27168b5 |
https://bottosson.github.io/posts/oklab/
Here's a list of the design choices behind oklab:
The text was updated successfully, but these errors were encountered: