Author Topic: change Color UILabel  (Read 4964 times)

eliascanaza

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
change Color UILabel
« on: November 06, 2014, 03:27:40 PM »
Hi everyone.

I need to change Color of UILabel,

  1. UILabel lbl = transform.GetComponent<UILabel>();
  2. lbl.color = new Color(210f,211f,204f,255f);

but dosent work this form... the result is other: R: 12330, G: 41234 ... others values, i need this color ... i need help.

thanks

AGB

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 74
    • View Profile
    • Steam Defense
Re: change Color UILabel
« Reply #1 on: November 06, 2014, 03:35:38 PM »
new Color should take floats from 0 to 1:

new Color(0.82f,0.83f,0.8f,1f);

or maybe like this:
new Color(210f/255f,211f/255f,204f/255f,255f/255f); :)
I'm a busy man... I have places to go,monsters to kill...

eliascanaza

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: change Color UILabel
« Reply #2 on: November 07, 2014, 10:30:43 AM »
thanks broo... this work!