ARGB颜色合成与提取公式
/ / 点击 /色彩合成:1
2//设alpha,red,green,blue都是0~255之间的数
color32 = alpha << 24 | red << 16 | green << 8 | blue;
色彩提取:1
2
3
4alpha = color32 >> 24;
red = color32 >> 16 & 0xFF;
green = color32 >> 8 & 0xFF;
blue = color32 & 0xFF;
全文完。
色彩合成:1
2//设alpha,red,green,blue都是0~255之间的数
color32 = alpha << 24 | red << 16 | green << 8 | blue;
色彩提取:1
2
3
4alpha = color32 >> 24;
red = color32 >> 16 & 0xFF;
green = color32 >> 8 & 0xFF;
blue = color32 & 0xFF;