Skip to content

Commit 3f74a21

Browse files
committed
credo: cond -> if
1 parent 80b7cfc commit 3f74a21

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/scenic/color.ex

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ defmodule Scenic.Color do
180180
181181
Most of the time, you will use one of the pre-defined named colors from the
182182
Named Colors table. However, there are times when you want to work with
183-
other color formats ranging from simple grayscale to rgb to hsl.
183+
other color formats ranging from simple grayscale to rgb to hsl.
184184
185185
The following formats are all supported by the `Scenic.Color` module.
186186
The values of r, g, b, and a are integers between 0 and 255.
@@ -543,11 +543,12 @@ defmodule Scenic.Color do
543543
h = rgb_to_hue(r, g, b)
544544
l = (max + min) / 2
545545

546-
s =
547-
cond do
548-
delta < @epsilon -> 0.0
549-
true -> delta / (1 - abs(2 * l - 1))
550-
end
546+
s = if delta < @epsilon do
547+
0.0
548+
else
549+
delta / (1 - abs(2 * l - 1))
550+
end
551+
551552

552553
{h, s * 100, l * 100}
553554
end

0 commit comments

Comments
 (0)