ProBuilder Advanced
July 16, 2017

Android Hexadecimal Color Transparency Chart

I was working on a daily quote app recently and was tasked with figuring out how to achieve transparency on a TextView with a background color.  In most situations there would be a simple transparency or opacity attribute that I could set to my desired setting.  This is not the case when developing in Android Studio.  Thanks to some clever searching I stumbled upon a post on Stack Overflow that contained all the information I needed:

Transparency %  Code
 100% 00
 90% 1A
 80% 33
 70% 4D
 60% 66
 50% 80
 40% 99
 30% B3
 20% CC
 10% E6
0% FF

Awesome!  Now all I had to do was prepend the given code to my color definition.  I ended up with the following color definition:

<color name="colorBlackSemiTrans">#CC000000</color>

Now you can simply set your TextView background value like so:

android:background="@color/colorBlackSemiTrans"

 

Happy developing!

Mike Wojcik
Mike Wojcik
WordPress Expert, Web & Game Developer, Superhero & Dad. Mike has been involved in software and web development for over a decade and has experience that covers a wide range of different areas ranging from server deployment and maintenance to project management to full scale website development from scratch.

Leave a Reply

9 Comments on "Android Hexadecimal Color Transparency Chart"

Notify of
Sort by:   newest | oldest | most voted
trackback

Tadalafil 20 mg http://cialisvipsale.com/

Wonderful posts. Kudos!

trackback

Viagra online http://viagravipsale.com/

With thanks, Plenty of knowledge.

trackback

Cialis purchasing http://cialisyoues.com/

Wow a good deal of awesome tips!

trackback

How does viagra work http://rldta.com/

Amazing material. Appreciate it.

trackback

Cialis vs viagra http://kawanboni.com/

Very good posts. Thank you.

trackback

Cialis generika http://cialisvonline.com/

Kudos, I enjoy it.

trackback

Viagra 20 mg best price http://viagravonline.com/

Wonderful content. Cheers.

trackback

generic cialis http://cialisvus.com/

Beneficial advice. Thanks a lot.

trackback

cialis kaufen http://cialisbuys.com/

Information certainly taken..

wpDiscuz