Welcome,
Guest
. Please
login
or
register
.
April 21, 2026, 02:33:26 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Strange problem with UILabel
« previous
next »
Print
Pages: [
1
]
Author
Topic: Strange problem with UILabel (Read 5345 times)
Magic Frame
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 30
Strange problem with UILabel
«
on:
February 24, 2015, 10:22:42 AM »
Hello I'm trying to change the color of my UILabel, but I have a strange problem
this line works well and change color --> mylabel.color = Color.red;
but, this line not works ---> mylabel.color = new Color (230f,170f,22f);
I'm doing something wrong?
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Strange problem with UILabel
«
Reply #1 on:
February 24, 2015, 11:45:43 AM »
Color is 0-1 range. Color32 is 0-255 range. Check Unity's documentation.
What you should be doing instead is:
mylabel.color = new Color(0.9f, 0.7f, 0.1f);
Logged
devomage
Sr. Member
Thank You
-Given: 7
-Receive: 67
Posts: 250
Re: Strange problem with UILabel
«
Reply #2 on:
February 24, 2015, 05:02:09 PM »
mylabel.color = new Color (230f,170f,22f);
another solution: (isnt there a helper function for this?)
mylabel.color = new Color (230f / 255f,170f / 25ff ,22f / 255f);
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Strange problem with UILabel
«
Reply #3 on:
February 27, 2015, 04:34:22 AM »
Yeah, it's called Color32
mylabel.color = new Color32(230, 170, 22);
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Strange problem with UILabel