RGB to ARGB conversion in Android

int color = Color.argb(255, 118, 118, 188);

if you want full opacity.


The first (a) value represents the Alpha channel, or in plain language: the transparency. (How much you can see through this colour, to the images behind it)

The value is one byte, so acceptable values range from 0 to 255.

As per the answer above, a value of 255 means your colour will be completely opaque (solid).
A value of 128 will give you 50% transparency.
A value of 0 will make your object completely invisible, regardless of your colour value, but the object still exists, like a sheet of perfectly clear glass, if you allow the analogy.

This can be useful for e.g secret/hidden/invisible buttons, creating easter eggs, or specific cases of UI tuning.

Tags:

Colors

Android