Skip to content

Instantly share code, notes, and snippets.

@rinav
Last active October 28, 2025 11:48
Show Gist options
  • Select an option

  • Save rinav/6500964d61321be58f189f7cd4ba1470 to your computer and use it in GitHub Desktop.

Select an option

Save rinav/6500964d61321be58f189f7cd4ba1470 to your computer and use it in GitHub Desktop.
Set alpha/opacity value to color on xml drawable

Hex Opacity Values

Example

  1. 0 -> 0 (this is completely transparent)
  2. 32 -> 20 (this is your opacity)
  3. 255 -> FF (this is completely opaque)

Complete List

  • 100% — FF
  • 95% — F2
  • 90% — E6
  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment