Repository navigation
Parse the CSS named colors spelled grey - #231
Merged
tomcur merged 1 commit intoOct 21, 2026
Merged
Conversation
lehni
force-pushed
the
fix/css-color-grey-and-hsl-whitespace
branch
from
October 20, 2026 07:34
56b94b7 to
aa7c1de
Compare
lehni
added a commit
to lehni/vectorcraft
that referenced
this pull request
Oct 20, 2026
…n both syntaxes, hwb(), lab(), lch(), oklab(), oklch(), color()), parsed by the color crate as peniko has it, kept at 8 bits a channel and serialized with alpha in as few decimals as give it back, as browsers do (653 of 1027 WPT tests pass); color pinned to lehni/color for linebender/color#231, the grey names and legacy hsl() whitespace
lehni
force-pushed
the
fix/css-color-grey-and-hsl-whitespace
branch
from
October 20, 2026 11:11
aa7c1de to
b3d3a7d
Compare
Collaborator
|
Could you please split these into 2 separate PRs? One here and the other in a new PR? I know we'll have to rebase / amend to deal with the merge conflict in the changelog, so also okay if you stack the second on the first since we can land them in order. |
lehni
force-pushed
the
fix/css-color-grey-and-hsl-whitespace
branch
from
October 21, 2026 10:15
b3d3a7d to
56b8cef
Compare
Contributor
Author
|
Done: this PR is now the grey spellings only, and the |
tomcur
reviewed
Oct 21, 2026
tomcur
left a comment
Member
There was a problem hiding this comment.
Thanks, this looks good. I think it would be better with the test removed, as it's just restating the code.
tomcur
approved these changes
Oct 21, 2026
Contributor
Author
|
Thanks, removed. |
lehni
force-pushed
the
fix/css-color-grey-and-hsl-whitespace
branch
from
October 21, 2026 11:16
56b8cef to
cc772d7
Compare
lehni
added a commit
to lehni/vectorcraft
that referenced
this pull request
Oct 21, 2026
…() in both syntaxes, hwb(), lab(), lch(), oklab(), oklch(), color()), parsed by the color crate as peniko has it, kept at 8 bits a channel and serialized with alpha in as few decimals as give it back, as browsers do (653 of 1027 WPT tests pass); color pinned to lehni/color for linebender/color#231, the grey names and legacy hsl() whitespace
lehni
added a commit
to lehni/vectorcraft
that referenced
this pull request
Oct 21, 2026
lehni
added a commit
to lehni/vectorcraft
that referenced
this pull request
Oct 21, 2026
lehni
added a commit
to lehni/vectorcraft
that referenced
this pull request
Oct 21, 2026
lehni
added a commit
to lehni/vectorcraft
that referenced
this pull request
Oct 21, 2026
lehni
added a commit
to lehni/vectorcraft
that referenced
this pull request
Oct 24, 2026
lehni
added a commit
to lehni/vectorcraft
that referenced
this pull request
Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CSS Color 4 defines both spellings of the gray names:
grey,darkgrey,darkslategrey,dimgrey,lightgrey,lightslategreyandslategreyare valid named colors, the same as theirgrayversions (§ 6.1).parse_coloronly knew thegrayones. They're added tomake_x11_colors.py, andx11_colors.rsis regenerated.Found while running the web-platform-tests' canvas colour tests (
2d.fillStyle.parse.svg-2) against a canvas built on this crate. With a test.The
hsl()whitespace fix is split out into #232, as asked.