Improve readability of RGBA and HSLA values in inspect mode (#5918)

*  Improve readability of RGBA and HSLA values in inspect mode

* 📎 Remove reader conditionals for format common methods
This commit is contained in:
Elena Torró 2025-02-24 09:08:42 +01:00 committed by GitHub
parent 1c98c53805
commit bcea19001e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 49 additions and 29 deletions

View file

@ -51,9 +51,13 @@
(t/is (= [0 0 0] (colors/hex->rgb "#kkk")))
(t/is (= [1 2 3] (colors/hex->rgb "#010203"))))
#?(:cljs
(t/deftest format-hsla
(t/is (= "210, 50%, 1%, 1" (colors/format-hsla [210.0 0.5 0.00784313725490196 1])))))
(t/deftest format-hsla
(t/is (= "210, 50%, 0.78%, 1" (colors/format-hsla [210.0 0.5 0.00784313725490196 1])))
(t/is (= "220, 5%, 30%, 0.8" (colors/format-hsla [220.0 0.05 0.3 0.8]))))
(t/deftest format-rgba
(t/is (= "210, 199, 12, 0.08" (colors/format-rgba [210 199 12 0.08])))
(t/is (= "210, 199, 12, 1" (colors/format-rgba [210 199 12 1]))))
(t/deftest rgb-to-hsl
(t/is (= [210.0 0.5 0.00784313725490196] (colors/rgb->hsl [1 2 3])))