Android colors.xml with transparency

By: Kevin | July 8, 2014

While working on a project I found the need to use transparency in my colors.xml resource file. To add transparency just throw the below Hex value in front of your normal color.

ie. For 50% white you’d use #80FFFFFF. This way the Alpha channel is utilized and you get the desired transparency.

  • 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

 

Cheers!