From 178057863db31647c5ee40dad110c7de8849ee87 Mon Sep 17 00:00:00 2001 From: Brian Brunner Date: Mon, 2 Dec 2024 21:32:36 -0700 Subject: [PATCH] Fix hsla alpha channel in as-hex --- src/garden/color.cljc | 2 +- test/garden/color_test.cljc | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/garden/color.cljc b/src/garden/color.cljc index a5ebe09..95b0b0f 100644 --- a/src/garden/color.cljc +++ b/src/garden/color.cljc @@ -241,7 +241,7 @@ (defn hsla->hex "Convert an HSLA color map to a hexadecimal string." [color] - (-> color hsla->rgba rgb->hex)) + (-> color hsla->rgba rgba->hex)) (defn hex->hsl "Convert a hexadecimal color to an HSL color." diff --git a/test/garden/color_test.cljc b/test/garden/color_test.cljc index 4533f8b..c4ab0b4 100644 --- a/test/garden/color_test.cljc +++ b/test/garden/color_test.cljc @@ -107,7 +107,13 @@ (color/as-hex rgba-red) hexa-red (color/as-hex rgba-green) hexa-green (color/as-hex rgba-blue) hexa-blue - (color/as-hex rgba-white) hexa-white))) + (color/as-hex rgba-white) hexa-white + + (color/as-hex hsla-black) hexa-black + (color/as-hex hsla-red) hexa-red + (color/as-hex hsla-green) hexa-green + (color/as-hex hsla-blue) hexa-blue + (color/as-hex hsla-white) hexa-white))) (deftest color-math-test (testing "color+"