bgrins / TinyColor

Fast, small color manipulation and conversion for JavaScript
https://bgrins.github.io/TinyColor/
MIT License
5.05k stars 438 forks source link

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 5 years ago

skoll1 commented 5 years ago

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

davegomez commented 3 years ago

@skoll1 you have to use toHex8String instead.

jlove73071 commented 3 years ago

why 256 instead of 255?