-
Notifications
You must be signed in to change notification settings - Fork 30
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
Conversion between oklch
and okhsl
#247
Comments
Converting from Oklch to Okhsl passes through sRGB as the base color space. The color |
Oh. May I ask why sRGB, and not XYZ D65 is used as base for conversion? I'm very new to this area. I couldn't understand why it is selected. |
In general, CIEXYZ D65 is a better base for conversions. Going all the way to sRGB and back is a bit more inefficient, but should not introduce significant error. It was a design choice at the beginning of the project. In a future version of the library, we may switch to more efficient conversion chains that have XYZ at the root. In the case of Okhsl / Okhsv, they’re ultimately derived from Oklab, but it starts with the assumption of covering the sRGB gamut. You can shortcut the conversion chain with the code below, but it results in the same color: culori.okhsl(culori.oklab('oklch(...)')) |
Understood. Thank you so much for spending your time to explain the things. I really appreciate it. |
I was playing around with the library and
converter
. When attempted, conversion fromoklch
tookhsl
yields weird results. In the documentation I haven't seen any specifics about the the color spaces supported by converter. So I assume it is expected to work.This is my converter function.
I have added,
The function call is,
In that
colorModes
isand,
defaultColour
is,this is the results I'm getting,
the values are,
Is there anything I'm missing? Else it looks like there is some bug with converter function
The text was updated successfully, but these errors were encountered: