Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make any html color code semi transparent [Android]

I have one Android application were i have one shape and in that i have one solid tag.

I want to make this shape 20% transparent with above color code.
How should i do that?

like image 278
User7723337 Avatar asked Jul 09 '13 07:07

User7723337


People also ask

How do you make something semi transparent in HTML?

To achieve this, use a color value which has an alpha channel—such as rgba. As with opacity , a value of 1 for the alpha channel value makes the color fully opaque. Therefore background-color: rgba(0,0,0,. 5); will set the background color to 50% opacity.

How do I make a color transparent in HTML?

When you have a 6 digit color code e.g. #ffffff, replace it with #ffffff00. Just add 2 zeros at the end to make the color transparent.

Is there a color code for transparent?

You can actually apply a hex code color that is transparent. The hex code for transparent white (not that the color matters when it is fully transparent) is two zeros followed by white's hex code of FFFFFF or 00FFFFFF.


2 Answers

If the color is represented in hexadecimal, like #424242, then adding two more digits in front of this "number" will represent the transparency, ex: #66424242. (66 in this example)
You can play a bit until arrive at desired effect.

like image 119
Andy Res Avatar answered Oct 19 '22 02:10

Andy Res


android:color="#66FF0000" is partially transparent red and if you decreasing the value of 6 as 5,4,3 up to 1 as "#56FF0000" ,"#46FF0000","#36FF0000","#26FF0000", the transparent color will becoming thin and the same way if u increase the first number as "#76FF0000","#86FF0000", like that the transparent color becoming thick.so we can arrange the transparency of color ourself. and it is applicable to all type of colors!!

like image 3
varunRaj Avatar answered Oct 19 '22 04:10

varunRaj