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

Add isHSLA() #1245

Closed
ezkemboi opened this issue Feb 8, 2020 · 7 comments
Closed

Add isHSLA() #1245

ezkemboi opened this issue Feb 8, 2020 · 7 comments

Comments

@ezkemboi
Copy link
Member

ezkemboi commented Feb 8, 2020

Add isHSLA().
Refer to the following issue (Similar but not the same) #1156.
Also, refer to the following PR raised #1156
Finally, check on the docs of MDN and W3Resource

@AubreyHewes
Copy link

would this not just be a redirect to the isHSL PR ? so more a change/feature on #1156 that it also supports alpha i.e. hsla() and not just hsl()

@ezkemboi
Copy link
Member Author

@AubreyHewes based on the feedback received on #1159, @GuiSchafer mentioned the following when I asked on the same

The hsla has an extra parameter, alpha, which can hold values between [0,1]. Therefore, it should have its own validator function.

May be @profnandaa and @GuiSchafer could add something on the same.

@ghost
Copy link

ghost commented Feb 15, 2020

In my opinion, semantically would be better to have this two separated. They are, indeed, correlated, but I wouldn't expect to receive "true" as an return value from a isHSL function when passing a hsla string. Futhermore, I think mixing this two would expand, in a bad way, the responsability of the function. What do you guys think?

@lytes20
Copy link

lytes20 commented Feb 20, 2020

I would love to pick this up, can I take it up?

@ezkemboi
Copy link
Member Author

@lytes20 please raise a PR.

@ayala-io
Copy link
Contributor

ayala-io commented Feb 23, 2020

Upon refining PR #1159, I agree with @AubreyHewes to simply redirect to the isHSL() validator. Further research into hsl() revealed that hsla() is merely an alias to hsl(). hsl() supports an optional 4th parameter for the alpha channel. In fact, you can use hsla() with only 3 parameters (without alpha) and it will still work because it is actually hsl().

@ezkemboi
Copy link
Member Author

#1159 will close this issue @profnandaa.

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

No branches or pull requests

5 participants