Skip to content
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 Okhsl #6

Open
aaronadamsCA opened this issue Feb 15, 2022 · 2 comments
Open

Add Okhsl #6

aaronadamsCA opened this issue Feb 15, 2022 · 2 comments

Comments

@aaronadamsCA
Copy link

Hi, this looks like a very promising library!

It would be great to add Okhsl, the cylindrical representation of Oklab:

https://bottosson.github.io/posts/colorpicker/
https://bottosson.github.io/posts/colorpicker/#source-code

This would specifically add support for perceptual saturation adjustments, which would boost use cases like palette generation.

@kdrag0n
Copy link
Owner

kdrag0n commented Feb 15, 2022

Sure, that could be done, but can you explain why you feel that adjusting Okhsl saturation would be better for palette generation? For Material You, results have been good when adjusting the chroma component of the polar representation of Oklab (Oklch: lightness, chroma, hue).

@aaronadamsCA
Copy link
Author

Good question. To be clear, I am not saying Okhsl is better than Oklch; I just think it addresses a wider variety of use cases than Oklch alone, by improving the usability of the color space.

As I understand it:

  • Oklch is like a globe. Very accurate, but irregularly shaped, and therefore often challenging to use.

  • Okhsl is like a map. There are tradeoffs when projecting an irregular shape to a regular one, but as long as you understand those tradeoffs, it's much easier to use.

  • Material You draws 3D curves through Oklch. Very cool, but very complex! This requires resources well beyond those available to most teams, including mine.

  • Okhsl is specifically designed to provide useful linear paths, which map to perceptually uniform curves through Oklch.

  • Material You uses fairly consistent chroma throughout its set of tones. This results in very high saturation in both light and dark tones; I see this as an artistic choice to "punch up" palettes.

  • Okhsl can more easily generate palettes with consistent saturation. This appears to be a more common choice for color systems (including Material Design 2014), and it is what I would prefer as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants