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

isValid() function returning true for invalid hsl or rgb colors #161

Closed
mburakerman opened this issue Jul 30, 2017 · 3 comments
Closed

isValid() function returning true for invalid hsl or rgb colors #161

mburakerman opened this issue Jul 30, 2017 · 3 comments

Comments

@mburakerman
Copy link

Thanks for awesome library!

Theres is small issues about isValid() function.

Unless we don't write a letter, isValid() function returns true for rgb and hsl colors.

alert(tinycolor('hsla(642,14%,76%,1)').isValid())

jsfiddle

@defue
Copy link

defue commented Oct 17, 2017

Also #fafa is treated as valid color while it is not. Version 1.4.1.
Update: figured out that #fafa is a valid color according to the specs: https://drafts.csswg.org/css-color-4/#hex-notation

@whostolemyhat
Copy link

Hex colours with two hashes are also considered valid:

tinycolor('##abc123').isValid() // true

@nyteksf
Copy link

nyteksf commented Feb 5, 2018

Hello. I've posted this related PR here for review, please. I was not able to reproduce the above mentioned double pound sign error with hex colors, but I did manage to address preventing multiple commas and choosing from without the valid range. Thanks for your time.

@mburakerman mburakerman closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2022
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

No branches or pull requests

4 participants