From 758067dd338c76c7101b27f765b5f221dee85f83 Mon Sep 17 00:00:00 2001 From: rxi Date: Sat, 10 Mar 2018 14:52:02 +0000 Subject: [PATCH] Removed `lume.rgba` (superseded by `lume.color`) --- README.md | 8 -------- lume.lua | 9 --------- test/test.lua | 9 --------- 3 files changed, 26 deletions(-) diff --git a/README.md b/README.md index 9f66a87..16a6110 100644 --- a/README.md +++ b/README.md @@ -442,14 +442,6 @@ lume.color("#00ffff", 256) -- Returns 0, 256, 256, 256 lume.color("rgb(255, 0, 0)", 256) -- Returns 256, 0, 0, 256 ``` -#### lume.rgba(color) -Takes the 32bit integer `color` argument and returns 4 numbers, one for each -channel, with a range of 0 - 255. The returned values can be used as the -arguments to [LÖVE](http://love2d.org)'s setColor() function. -```lua -lume.rgba(0xFF304050) -- Returns 48, 64, 80, 255 -``` - #### lume.chain(value) Returns a wrapped object which allows chaining of lume functions. The function result() should be called at the end of the chain to return the resulting diff --git a/lume.lua b/lume.lua index 0fb10e2..3d2a800 100644 --- a/lume.lua +++ b/lume.lua @@ -739,15 +739,6 @@ function lume.color(str, mul) end -function lume.rgba(color) - local a = math_floor((color / 16777216) % 256) - local r = math_floor((color / 65536) % 256) - local g = math_floor((color / 256) % 256) - local b = math_floor((color) % 256) - return r, g, b, a -end - - local chain_mt = {} chain_mt.__index = lume.map(lume.filter(lume, iscallable, true), function(fn) diff --git a/test/test.lua b/test/test.lua index 43fc17e..fd4b6f2 100644 --- a/test/test.lua +++ b/test/test.lua @@ -607,15 +607,6 @@ tests["lume.color"] = function() tester.test.error(lume.color, "rgba(1, 1, 1, 1") end --- lume.rgba -tests["lume.rgba"] = function() - local r, g, b, a = lume.rgba(0x12345678) - testeq( a, 0x12 ) - testeq( r, 0x34 ) - testeq( g, 0x56 ) - testeq( b, 0x78 ) -end - -- lume.chain tests["lume.chain"] = function() local t = lume.chain({1, 2}):map(function(x) return x * 2 end):result()