Merge branch 'master' of gitfub.space:Jmaa/colors
This commit is contained in:
commit
d6248a54b0
|
@ -12,6 +12,10 @@ local colors = {}
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Conversion
|
-- Conversion
|
||||||
|
|
||||||
|
colors.rgb255_to_rgb1 = function (color)
|
||||||
|
return { color[1]/255, color[2]/255, color[3]/255, (color[4] or 255)/255 }
|
||||||
|
end
|
||||||
|
|
||||||
colors.rgb_to_hsl = function (color)
|
colors.rgb_to_hsl = function (color)
|
||||||
-- Error check
|
-- Error check
|
||||||
assert(type(color) == 'table' and type(color[1]) == 'number' and type(color[2]) == 'number' and type(color[3]) == 'number')
|
assert(type(color) == 'table' and type(color[1]) == 'number' and type(color[2]) == 'number' and type(color[3]) == 'number')
|
||||||
|
@ -78,6 +82,10 @@ colors.hsl_to_rgb = function (color)
|
||||||
return { r, g, b }
|
return { r, g, b }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
colors.hsl_to_rgb1 = function (...)
|
||||||
|
return colors.rgb255_to_rgb1(colors.hsl_to_rgb(...))
|
||||||
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Interpolation
|
-- Interpolation
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user