Converting hex to rgb assumes a 6-digit hex
Closed this issue · 1 comments
ilikescience commented
The method .hexToHsluv()
assumes that the hex provided is 6 digits, eg #ff0000
. However, hex colors can be 3 digits, where each digit is replicated to get the 6-digit value; eg #f00
becomes #ff0000
.1
A simple fix would be to check if the hex provided is 3 digits and converting if so.
Footnotes
boronine commented
I'd rather not support this, it's not useful enough to warrant extra code