|
Post by xxdxmhippiexx on Jan 21, 2017 19:57:40 GMT
function grayScale(path)
local r, g, b = getColor(path)
return r == b and r == g
end
if(not grayScale("img.png"))then-- ALWAYS returns false --do stuff end Why dose this always return false?..using it on C.O.C in the barracks mostly.
|
|
|
Post by AnkuLua on Jan 22, 2017 0:40:26 GMT
You should check the returned r, g, b values. Maybe the image is not gray scale, though looks like.
|
|
|
Post by xxdxmhippiexx on Jan 22, 2017 17:58:05 GMT
You should check the returned r, g, b values. Maybe the image is not gray scale, though looks like. What dose it return even?..the docs wasnt to clear about that.
|
|
|
Post by xxdxmhippiexx on Jan 22, 2017 17:59:33 GMT
red, green, blue int in pixles?
|
|
|
Post by AnkuLua on Jan 23, 2017 1:42:48 GMT
yes
|
|
|
Post by vampiredbr9 on Jan 29, 2017 11:10:17 GMT
Use this:
function isGrayscale(pic) r, g, b = getColor(pic) if (r == g and g == b) then return true else return false end end
|
|
|
Post by vampiredbr9 on Jan 29, 2017 11:11:39 GMT
Use this: function isGrayscale(pic) r, g, b = getColor(pic) if (r == g and g == b) then return true else return false end end Use it like: If (isGrayscale("pic.png")) then -- do stuff End
|
|