mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-10 02:31:48 +00:00
Update colour.lua
*To Appease A Linter.*
This commit is contained in:
parent
5caab66d58
commit
77199cde0b
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user