Hi
In clojurescript, rgb-hexstr and the other functions that could return a hexstr don't work:
(color/rgb-hexstr (color/create-color "blue"))
;;=> "#%06X"
This is due to this line:
|
(format "#%08X" (rgba-int color))) |
Google closure's format is limited and doesn't format hex values
(see: https://stackoverflow.com/questions/24635974/clojurescript-format-string-with-goog-string-format-doesnt-substitute)
It would need to be done manually with something like this:
(defn hex-color [[r g b]]
(str "#"
(.padStart (.toString r 16) 2 "0")
(.padStart (.toString g 16) 2 "0")
(.padStart (.toString b 16) 2 "0")))
Let me know if you would like a PR.
Thanks!
Edited to add .padStart to hex-color.
Hi
In clojurescript,
rgb-hexstrand the other functions that could return a hexstr don't work:This is due to this line:
colors/src/com/evocomputing/colors.cljc
Line 401 in 30607e4
Google closure's
formatis limited and doesn't format hex values(see: https://stackoverflow.com/questions/24635974/clojurescript-format-string-with-goog-string-format-doesnt-substitute)
It would need to be done manually with something like this:
Let me know if you would like a PR.
Thanks!
Edited to add
.padStarttohex-color.