Manipulate alpha bytes of Java/Android color int
问题 If I have an int in Java that I'm using as an Android color (for drawing on a Canvas), how do I manipulate just the alpha component of that int? For example, how can I use an operation to do this: int myOpaqueColor = 0xFFFFFF; float factor = 0; int myTransparentColor = operationThatChangesAlphaBytes(myOpaqueColor, factor); //myTransparentColor should now = 0x00FFFFFF; Ideally, it would be nice to multiply those first bytes by whatever factor is, rather than just set the bytes to a static