Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - How to set color value to TRANSPARENT

Tags:

android

how to get parseColor color value to transparent.

mPaint.setColor(Color.parseColor("#FFFF00"));

thanks for help

like image 449
Fou Avatar asked May 11 '15 13:05

Fou


People also ask

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.

How do you set a transparent color?

On the Picture Format tab, select Color, and then select Set Transparent Color. Click the color in the picture or image that you want to make transparent. Note: You can't make more than one color in a picture transparent.

How do I change transparency on Android?

setAlpha(51); Here you can set the opacity between 0 (fully transparent) to 255 (completely opaque). The 51 is exactly the 20% you want.

How do you make a color transparent with code?

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.


1 Answers

Suppose your preferred color is red #FF0000

Adding 00 in the beginning will make it 100% transparent and adding FF will make it 100% solid.

So, 100% transparent color is: #00ff0000 and 100% solid color is: #ffff0000

And any value in between 00 to ff can be used to adjust the transparency.

like image 141
Mohammad Arman Avatar answered Oct 26 '22 05:10

Mohammad Arman