How to make any html color code translucent [Android]

I have one Android app, I have one form, and I have one solid tag.

I want to make this shape transparent with 20% transparent over color. How can I do it?

+6
source share
4 answers

If the color is in hexadecimal, for example # 424242, then adding two more digits before this “number” will represent transparency, for example: # 66424242. (66 in this example)
You can play a bit until you achieve the desired effect.

+18
source

android: color = "# 66FF0000" is partially transparent red, and if you decrease the value 6 as 5.4.3 to 1 like "# 56FF0000", "# 46FF0000", "# 36FF0000", "# 26FF0000", transparent color will become thinner in the same way if u increases the first number like "# 76FF0000", "# 86FF0000", so that the transparent color becomes thick. So that we can arrange color transparency. And it applies to all types of colors!

+3
source

Something like this work?

android:color="#66FF0000" // Partially transparent red 

Taken from fooobar.com/questions/37723 / ...

+1
source

I tried adding two digits to the beginning of the "number", for example. # 66424242, this definitely works since I use it on my blog

+1
source

Source: https://habr.com/ru/post/948998/


All Articles