mirror of
https://github.com/penpot/penpot.git
synced 2025-08-03 06:28:31 +02:00
✨ 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:
parent
1c98c53805
commit
bcea19001e
5 changed files with 49 additions and 29 deletions
|
@ -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])))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue