简体   繁体   中英

What are alpha and non alpha channels in Android?

I was reading this documentation of Android and came across phrases "alpha-channels" and "non-alpha channels".

Can someone please elaborate meaning of them?

Each color pixel (32 bit) in bitmap image is represented by four 8-bit values alpha - determines transparency, red, green and blue values of represented color.

Alpha channel represents alpha - transparency values for the whole image, while other channels represent red, green or blue values, respectively. Red, green and blue channels are non-alpha channels because they do not carry transparency, just color value.

Excerpt from documentation you have linked:

Material design style

Notifications are drawn with dark text atop white (or very light) backgrounds to match the new material design widgets. Make sure that all your notifications look right with the new color scheme. If your notifications look wrong, fix them:

- Use setColor() to set an accent color in a circle behind your icon image.
- Update or remove assets that involve color. The system ignores all non-alpha channels in action icons and in the main notification icon. You should assume that these icons will be alpha-only. The system draws notification icons in white and action icons in dark gray.

Icons drawn by using alpha channel + white or dark gray color will be full white (dark gray) at places where icon pixel alpha value is 255, and will be blended with background color for other non-zero alpha values, and transparent where alpha is 0. Any color information contained in those icons will be completely ignored during drawing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM