0xFF000000=-16777216
0xFFFFFFFF=-1
0x000000=0
0xFFFFFF=16777215
0x01000000=16777216
0x01FFFFFF=33554431
0x7FFFFFFF=2147483647
0x80000000=-2147483648 2147483648
0x80000001=-2147483647 2147483649
0x100000000=0x80000000/2
颜色值=(65536Red)+(256Green)+(Blue) —R G B必须是整数
function 获取RGB(ARGB)--0xff000000local RGB--把四字节颜色先处理成双字节if ARGB>0x100000000/2 thenARGB=ARGB-0x100000000 -- 0x80000000*2elseif ARGB>=0x01000000 and ARGB<0x100000000/2 thenARGB=ARGB-0x01000000end--根据双字节颜色值0xaarrggbb处理成0xrrggbb 不带透明度if ARGB<0 then --负数值的颜色RGB=ARGB+0x01000000ARGB=ARGBelse --正常颜色值+双字节0x8000000以下的颜色值RGB=ARGBARGB=ARGB-0x01000000endlocal r = math.floor(RGB/0x010000) --脚本颜色RGBlocal g = math.floor(RGB%0x010000/0x000100)local b = math.floor(RGB%0x000100)return ARGB,(65536*r)+(256*g)+(b),r,g,bend
