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

Why does this function toHexString() input {r:256,g:0,b:0,a:0.5}, and the values ​​returned by {r:256,g:0,b:0,a:0.5} are the same, Both "#ff0000" cannot distinguish transparency parameters #208

Open
skoll1 opened this issue Apr 18, 2019 · 3 comments

Comments

@skoll1
Copy link

skoll1 commented Apr 18, 2019

No description provided.

@skoll1 skoll1 changed the title Why does this function toHexString() input {r:256,g:0,b:0,a:1}, and the values ​​returned by {r:256,g:0,b:0,a:0.5} are the same, Both "#ff0000" cannot distinguish transparency parameters Why does this function toHexString() input {r:256,g:0,b:0,a:0.5}, and the values ​​returned by {r:256,g:0,b:0,a:0.5} are the same, Both "#ff0000" cannot distinguish transparency parameters Apr 18, 2019
@skoll1
Copy link
Author

skoll1 commented Apr 18, 2019

TinyColor2({r:256,g:0,b:0,a:1}).toHexString()
TinyColor2({r:256,g:0,b:0,a:0.5}).toHexString()

@davegomez
Copy link

@skoll1 you have to use toHex8String instead.

@jlove73071
Copy link

why 256 instead of 255?

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

3 participants