Update colour.lua

*To Appease A Linter.*
This commit is contained in:
zorg 2023-12-11 04:37:55 +01:00 committed by GitHub
parent 5caab66d58
commit 77199cde0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,13 +229,13 @@ end
--conversion between hsl and hsv --conversion between hsl and hsv
function colour.hsl_to_hsv(h, s, l) function colour.hsl_to_hsv(h, s, l)
local v = l + s * math.min(l, 1 - l) local v = l + s * math.min(l, 1 - l)
local s = (v == 0) and 0 or (2 * (1 - l / v)) s = (v == 0) and 0 or (2 * (1 - l / v))
return h, s, v return h, s, v
end end
function colour.hsv_to_hsl(h, s, v) function colour.hsv_to_hsl(h, s, v)
local l = v * (1 - s / 2) local l = v * (1 - s / 2)
local s = (l == 0 or l == 1) and 0 or ((v - l) / math.min(l, 1 - l)) s = (l == 0 or l == 1) and 0 or ((v - l) / math.min(l, 1 - l))
return h, s, l return h, s, l
end end