Home > Software engineering >  How to get colors?
How to get colors?

Time:04-07

I am trying to achieve something like this

enter image description here

where the text and background colors are similar. How do I get the corresponding background (probably 50% transparent of chosen color) color for a chip in Android?

Any help highly appreciated.

CodePudding user response:

Simply take the color you use for the text and set alpha to 0.5f.

CodePudding user response:

android:alpha="0.5"
takes float value from 0 (transparent) to 1 (fully visible)

  • Related