TinyColor icon indicating copy to clipboard operation
TinyColor copied to clipboard

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

Open skoll1 opened this issue 6 years ago • 3 comments

skoll1 avatar Apr 18 '19 09:04 skoll1

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

skoll1 avatar Apr 18 '19 09:04 skoll1

@skoll1 you have to use toHex8String instead.

davegomez avatar Nov 04 '20 20:11 davegomez

why 256 instead of 255?

jlove73071 avatar Feb 24 '21 21:02 jlove73071