Color2RGB
color_json = Base.Color2RGB(color)
颜色值分解为R、G、B颜色
参数
ID | 名称 | 类型及说明 |
---|---|---|
1 | color | [int]颜色值 |
返回值
ID | 名称 | 类型及说明 |
---|---|---|
1 | color_json | [string]分解颜色值,表示为文本如[100,100,100],可使用cjson解析 |
例子
color = Base.Color2RGB(1888888)
cjson = require "cjson"
local data = cjson.decode(jsons);
Base.Print(data[1]); --R
Base.Print(data[2]); --G
Base.Print(data[3]); --B