Question

I made an Imagebutton called skillButton and changed its color by using

skillButton.setColor(Color.RED);

It works fine, but what can I do to remove the color and get the original image (color) back? I tried Color.CLEAR which makes the complete button invisible. I also tried some rgba values, but is there no better way?

Thx and regards...

Was it helpful?

Solution

The standard colour is Color.WHITE. The actual colour of the image/texture is actually multiplied by the colour you set on the button. Color.CLEAR is a colour with an alpha value of 0 which means 100% transparent = invisible.

Color.WHITE means that each colour component of the original picture is multiplied by 1 and thus will not change.

skillButton.setColor(Color.WHITE); will "reset" the button to its normal colors.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top