File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments