Hey Rockstar, do you know what is the hex value of 75% Black color ? Is it #BF000000? First let me remind you something else than how hex value of 75% black became #BF00000.

Android uses Hex ARGB values, which are formatted as #AARRGGBB. So what is the firs pair AA? I assume that you know #RRGGBB means. Yeah, its simple its the RED, GREEN and BLUE hex color value.

An 8-digit hex color value is a representation of ARGB (Alpha, Red, Green, Blue), whereas a 6-digit value just assumes 100% opacity (fully opaque) and defines just the RGB values. So to make this be fully opaque, you can either use #FF555555, or just #555555. Each 2-digit hex value is one byte, representing values from 0-255.

So how to find the Alpha values in Hex ?

- Take your opacity as a decimal value and multiply it by 255. So, if you have a block that is 50% opaque the decimal value would be .5. For example .5 * 255 = 127.5
- The fraction won’t convert to hex, so you must round your number up or down to the nearest whole number. For example 127.5 rounds up to 128; 55.25 rounds down to 55.
- Enter you decimal value in a decimal to hexadecimal converter, like this:

http://www.binaryhexconverter.com/decimal-to-hex-converter and convert your values. - If you only get back a single value, prefix it with a zero. For example, if you’re trying to get 5% opacity and you are going through this process you’ll end up with the hex value of D. Add a zero in front of it so it appears 0D.

That’s how you find the alpha channel value. But still are you lazy enough to just copy and paste the values? Thank me for the below list of values ðŸ˜‰

100% â€” FF

Â Â Â 95% â€” F2

Â Â Â 90% â€” E6

Â Â Â 85% â€” D9

Â Â Â 80% â€” CC

Â Â Â 75% â€” BF

Â Â Â 70% â€” B3

Â Â Â 65% â€” A6

Â Â Â 60% â€” 99

Â Â Â 55% â€” 8C

Â Â Â 50% â€” 80

Â Â Â 45% â€” 73

Â Â Â 40% â€” 66

Â Â Â 35% â€” 59

Â Â Â 30% â€” 4D

Â Â Â 25% â€” 40

Â Â Â 20% â€” 33

Â Â Â 15% â€” 26

Â Â Â 10% â€” 1A

Â Â Â 5% â€” 0D

Â Â Â 0% â€” 00

Oh I almost forgot if you are an energetic android developer than below piece of code will give you the Alpha channel values in hex. Try this:

public class AndroidColorsAlphaChannel { public static void main(String[] args) { for (double i = 1; i >= 0; i -= 0.01) { i = Math.round(i * 100) / 100.0d; int alpha = (int) Math.round(i * 255); String hex = Integer.toHexString(alpha).toUpperCase(); if (hex.length() == 1) { hex = "0" + hex; } int percent = (int) (i * 100); System.out.println(String.format("%d%% â€” %s", percent, hex)); } } }

Did I forgot to mention enjoy ? ðŸ˜‰