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

The first value for oklch colours should be a percentage value #124

Open
jpc-ae opened this issue Nov 11, 2024 · 2 comments
Open

The first value for oklch colours should be a percentage value #124

jpc-ae opened this issue Nov 11, 2024 · 2 comments
Labels
color-translate dependency enhancement New feature or request formats Related to color formats

Comments

@jpc-ae
Copy link

jpc-ae commented Nov 11, 2024

Currently, the oklch notation used is all decimal values. As shown in the example values on MDM the first value should be a percentage by convention. There are various reasons for this, but I would appreciate if this extension followed the convention or at least provided an option for it.

@jeronimoek
Copy link
Owner

Hi! As far as I've seen, there is no such convention, and the values being all numbers, or all percentages, are more compatible.
Anyway, it's possible to consider an option for that, I'll leave this as an enhancement pending to do

@jeronimoek jeronimoek added enhancement New feature or request formats Related to color formats color-translate dependency labels Jan 19, 2025
@jpc-ae
Copy link
Author

jpc-ae commented Jan 21, 2025

I call it convention because it's the style used on both the online color-picker and MDN.

I see the value in making it an option though, since different devs will have different preferences. Some may even prefer using deg for the third unit for clarity, but I haven't seen that anywhere in the wild yet. Anyway, would love it as an enhancement. Personally I only care about the first unit to keep consistency in my project, since I prefer percentage there.

Here is the formal syntax for reference:

<oklch()> = 
  oklch( [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )  

<hue> = 
  <number>  |
  <angle>   

<alpha-value> = 
  <number>      |
  <percentage>  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
color-translate dependency enhancement New feature or request formats Related to color formats
Projects
None yet
Development

No branches or pull requests

2 participants