From be813e52ef6b0e84109f1963dab7d2066270b585 Mon Sep 17 00:00:00 2001 From: Captain Spaulding <36406936+pacrox@users.noreply.github.com> Date: Sun, 26 Feb 2023 14:31:17 +0100 Subject: [PATCH] Update color.lua Inside 'rgbToHsl', the variable 's' was mistakenly re-declared as local inside the if/then/else block. This caused the function to return saturation either as '0' (for b/w rgb values) or as 'nil' (for all the other cases). The statement (line 26) was commented, but it can be permanently removed. --- utils/color.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/color.lua b/utils/color.lua index 53e7a72..dec0d13 100644 --- a/utils/color.lua +++ b/utils/color.lua @@ -23,7 +23,7 @@ function rgbToHsl(r, g, b, a) h, s = 0, 0 -- achromatic else local d = max - min - local s + --local s -- <- FIXED: 's' should not be declared here as local. if l > 0.5 then s = d / (2 - max - min) else s = d / (max + min) end if max == r then h = (g - b) / d