Change button color to intermediate value on onclick() event
How can I change button color to intermediate value on onclick() event? Not a Color.green or Color.red
For instance: button1.GetComponent().color = new Color( 238, 40, 57, 255);
When I'm writing like above, color turns to white
Thanks.
Comment
Best Answer
Answer by HarshadK · Jan 09, 2016 at 07:10 AM
Because color values range between 0 and 1. So say red is color(1f, 0f, 0f, 1f). And yor color becomes Color( 238/255, 40/255, 57/255, 255/255);
Your answer
Follow this Question
Related Questions
UI text wont highlight 0 Answers
How do I get my Buttons to switch colors? 0 Answers
How do I change UI button background AND button text on click(pressed)? 0 Answers
How can I change the UI button color when clicked 1 Answer
How to do Image Swap with Text Color the with New UI Button Transition? 0 Answers