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

color() syntax: map <percentage> to the component's range, where available. #153

Closed
danburzo opened this issue Oct 26, 2021 · 1 comment · Fixed by #190
Closed

color() syntax: map <percentage> to the component's range, where available. #153

danburzo opened this issue Oct 26, 2021 · 1 comment · Fixed by #190

Comments

@danburzo
Copy link
Collaborator

danburzo commented Oct 26, 2021

See:

Adjust the color() parser to map <percentage> against that component's range (which is usually, but not always, [0, 1]), where that range is available.

In each color space's definition, ranges should be marked as reference (as opposed to approximate), so that the parser can take them into account. If we don't have a range against which to map <percentage> values, treat them as omitted, and fall them back to 0.

@danburzo
Copy link
Collaborator Author

According to the latest spec changes, color() syntax assumes the range [0-1] for all components.

@danburzo danburzo reopened this Feb 23, 2023
danburzo added a commit that referenced this issue Feb 23, 2023
* Baseline css color parser
* Parser improvements
* Switch over all parsing to new parser.
* Add tests for #187
* Add tests & fixes re #167, #155, #153
* Update the ranges for lab/lch/oklab/oklch to match CSS reference ranges.
* Add docs on newly-exported parse fns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant