This is right as far as I can tell: gideros only handle RGB, either with separated components or with 0xrrggbb representation depending on the function.
just played with that a little, i'd say that there is only one requirement to let it work with gideros:
--change
module(..., package.seeall)--to
module("colorLib", package.seeall)--I wrote "colorLib", I suppose that a string is good as another. I am still trying to understand what should the ... operator do in that position.
it doesn't export hex colors but should be just a temporary issue, until we find the right transformation function... rgb2hex()
Comments
I just found something that seems wonderful:
http://sputnik.freewisdom.org/lib/colors/
just played with that a little, i'd say that there is only one requirement to let it work with gideros:
Likes: hgy29, MoKaLux
local hex=r*256*256+g*256+b
return hex
end
Likes: pie, MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
function hexToRgb(hex)
local blue=hex%256
local green=(hex-blue)/256 %256
local red=(hex-blue-256*green)/256^2
return red,green,blue
end
Likes: pie, MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game