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

Support HSL colors #679

Merged

Conversation

antoine-cottineau
Copy link
Contributor

Hello !

This PR adds support for HSL colors.

I followed this documentation page to know the various syntaxes an HSL/HSLA color could have.
For HSLA, similarly to RGBA, the alpha channel is ignored.

I’ve added several test cases to check for the various syntaxes an HSL/HSLA color could have and to check that several different colors were correctly converted to HEX.

This is how it looks on Android with fadeToColor="hsl(34, 87%, 50%)":

I’m open to any comment you may have 🙂

This will be useful for the following as we will need a function to convert from hsl to hex. To do that, we'll need a function to convert from hsl to rgb and then from rgb to hex. So, this commit helps us reuse the code for doing the last step.
@henninghall henninghall merged commit 074dd6d into henninghall:master Aug 11, 2023
2 of 3 checks passed
@antoine-cottineau antoine-cottineau deleted the feat/support-hsl-colors branch August 11, 2023 07:46
@henninghall
Copy link
Owner

@antoine-cottineau Thanks for your contribution 🙌
This is released in version 4.2.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants