标签:oid new ret 转换 bsp rgb 十进制 col org
oid toRgba(int color)
{
int rgb=new int[3];
int b = color & 0xff;
int g = (color >> 8) & 0xff;
int r = (color >> 16) & 0xff;
rgb[0]=r;
rgb[1]=g;
rgb[2]=b;
return rgb;
}
例:
红色:16711680 十进制
11111111 00000000 00000000 二进制
b = (11111111 00000000 00000000) & (00000000 00000000 11111111) = 0;
g = (00000000 11111111 00000000) & (00000000 00000000 11111111) = 0;
r =(00000000 00000000 11111111) & (00000000 00000000 11111111) = 11111111; (255)
标签:oid new ret 转换 bsp rgb 十进制 col org
原文地址:https://www.cnblogs.com/91-JiaoTeacher/p/13186932.html