cocos2dx-lua 提供了这个函数,这个函数在实现上有BUG。
local function isFloatColor(c)
return (c.r <= 1 and c.g <= 1 and c.b <= 1) and (math.ceil(c.r) ~= c.r or math.ceil(c.g) ~= c.g or math.ceil(c.b) ~= c.b)
end
如果c=cc.c4f(1,0,0,1)
那么 (c.r <= 1 and c.g <= 1 and c.b <= 1)为真,
(math.ceil(c.r) ~= c.r or math.ceil(c.g) ~= c.g or math.ceil(c.b) ~= c.b) 为假,被判断为非 浮点颜色