Convert ARGB Color to RGB

I'm trying to get the rgb value of a color with alpha, meaning make it full opaque with different red, green and blue values.

For example,

Color.argb(204, 40, 40, 40) // I have this color
Color.rgb(48, 48, 48) // I expect this value

I've tried converting argb to HEX, and after HEX to rgb, but doesn't work.


Your input is a translucent color and you expect a slightly brighter output. That can be achieved by overlaying your input over white.

support-v4 library contains ColorUtils.compositeColors which does what you need:

final int input = Color.argb(204, 40, 40, 40);
final int output = ColorUtils.compositeColors(input, Color.WHITE);
链接地址: http://www.djcxy.com/p/87548.html

上一篇: Python OpenCV中ARGB,RGBA色彩空间的区别

下一篇: 将ARGB颜色转换为RGB