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

RCSS: support hsl and hsla colors #674

Merged
merged 1 commit into from
Sep 22, 2024
Merged

Conversation

AmaiKinono
Copy link
Contributor

To many web developers, HSL and HSLA colors are easier to work with. Here's a test in the sandbox:

image

Copy link
Owner

@mikke89 mikke89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, thanks a lot! Implementation looks good, and follows the style of the existing RGB-parsing, which is great.

I see that CSS allows some other variations of the spelling here, but it looks like this is the common spelling, so it makes sense to me to only allow this.

Only a couple minor things: It would be preferable to use use our built-in Array type instead of std::array, and format it with our clang-format config. Thanks!

I would also greatly appreciate if you could add documentation PR for this feature.

@AmaiKinono
Copy link
Contributor Author

Only a couple minor things: It would be preferable to use use our built-in Array type instead of std::array, and format it with our clang-format config. Thanks!

Done. Other than this, I just read in https://www.w3.org/TR/css-color-3/#hsl-color that hue should be wrapped in [0, 360), so I've added that.

I would also greatly appreciate if you could add documentation PR for this feature.

Yes, this will come later ;)

@mikke89 mikke89 merged commit 025b05d into mikke89:master Sep 22, 2024
32 checks passed
@mikke89
Copy link
Owner

mikke89 commented Sep 22, 2024

Perfect, thank you! A nice little quality-of-life improvement :)

@AmaiKinono AmaiKinono deleted the rcss-hsla branch September 23, 2024 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants