mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-21 21:54:35 +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
|
||||
function colour.hsl_to_hsv(h, s, 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
|
||||
end
|
||||
|
||||
function colour.hsv_to_hsl(h, s, v)
|
||||
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
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user