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

[css-color] Percent reference ranges do not imply maximum allowed values in color functions #32408

Closed
romainmenke opened this issue Feb 23, 2024 · 2 comments · Fixed by #32004
Labels
Content:CSS Cascading Style Sheets docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@romainmenke
Copy link
Contributor

romainmenke commented Feb 23, 2024

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/lab

What specific section or headline is this issue about?

Values: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/lab#values

What information was incorrect, unhelpful, or incomplete?

A <number> between -125 and 125, a <percentage> between -100% and 100%, or the keyword none, which specifies the distance along the a axis in the CIELAB colorspace, that is how green/red the color is.

What did you expect to see?

It seems there has been some confusion between the percent references ranges for color functions and the max/min allowed values.

I think this is likely incorrect for all color functions but definitely for lab, oklab, ...


There are multiple important concepts.

1: Values can be expressed as both numbers and percentages. Because of this it needs to be specified wat 0% and 100% map to.

2: Values can be bound or unbound and when bound have specified min/max values.

3: Values can be theoretically unbound but still have maximum values which are practically useful.

It seems that the current documentation mixes these aspects and states the corresponding values for 0% and 100% as bounds. (Or maybe an earlier specification stated these as max/min values?)


a and b for lab for example are unbound.

The second and third arguments are the distances along the "a" and "b" axes in the Lab color space, as described in the previous section. These values are signed (allow both positive and negative values) and theoretically unbounded (but in practice do not exceed ±160).

Do you have any supporting links, references, or citations?

https://drafts.csswg.org/css-color-4/#specifying-lab-lch
https://drafts.csswg.org/css-color-5/#relative-Lab

Do you have anything more you want to share?

No response

@romainmenke romainmenke added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Feb 23, 2024
@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label Feb 23, 2024
@romainmenke
Copy link
Contributor Author

@chrisdavidmills @estelle in context of #32004 (comment)

@estelle
Copy link
Member

estelle commented Feb 23, 2024

Thank you. I have been trying to wrap my head around the # v. %. I definitely misunderstood it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants