- Home /
Answer by Kimi073 · Jun 05, 2016 at 03:55 PM
use the following method: your_button_UI.color
For example:
Declare a public variable in your script as following:
//for instance at here we take is an image public Image your_image_name; //make a public color to show you in the editor what color is your button public Color your_image_color;
The following line shows the color of the UI image in the editor through the above Color variable:
your_button_color = your_image_name.color;
Sorry, but this is only the color of the image. It doesn't ever change. I asked for the Color the Button has - this can be the highlited color or the pressed color, too.