|
| 24 Jan 2012 02:41 PM |
| I'm really starting to get angry.... You don't want to see an angry guest.... please tell me why When I use Color3 on a Textlabel, It doesn't work? And also, the colors are all stated the same, and they come out different when the script runs??? Why Oh Why, Cruel World? Must I add a wait time? All the other gui values load correctly but this one... My goal was to make blah.TextColor3 = Color3.new(255,255,255) but it no work! Please help meh! |
|
|
| Report Abuse |
|
|
Cyrok
|
  |
| Joined: 11 Jan 2012 |
| Total Posts: 630 |
|
|
| 24 Jan 2012 02:44 PM |
Color3 accepts values between zero and one, which means you have to divide any value you wish to insert by two hundred and fifty-five.
blah.TextColor3 = Color3.new(1, 141/255, 0)
{ I have an OCD when it comes to non-camelCase variables/custom functions. } |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2012 02:45 PM |
| What? then why can sparkles be 255? Thats weird.... Thx! |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2012 02:46 PM |
Color3 works on a scale from 0 to 1, not 0 to 255. If you want to change a color from what you have in the properties window to a Color3, just divide it by 255. 0 and 255 are easy to do, they're just 0 and 1, respectively.
So basically, you want to use Color3.new(1,1,1) instead of Color3.new(255,255,255)
two earlyposters above |
|
|
| Report Abuse |
|
|
Cyrok
|
  |
| Joined: 11 Jan 2012 |
| Total Posts: 630 |
|
|
| 24 Jan 2012 02:49 PM |
@Seth
The Color3 property for all objects that have them automatically convert them by dividing them by two hundred and fifty-five. (Or at least that's what I assume happens.)
{ I have an OCD when it comes to non-camelCase variables/custom functions. } |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2012 02:56 PM |
| Thx, ok, I think I can do it now. |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2012 03:26 PM |
You can convert BrickColor into Color3, or visa versa.
local color = BrickColor.new("Bright red") print(color.Color) > 0.768628, 0.156863, 0.109804 print(color.Color.r * 255, color.Color.g * 255, color.Color.b * 255) > ~ 196 40 28 -- I math.floor()'d the values, as you have no need of knowing a thousand decimals.
I'm pretty sure this also works for GUIs and the like, if you wish to use some of the 'premade' colors easily, rather than looking up the color values.
function Color(targ, r, g, b) return Color3.new(r/255, g/255, b/255) end
Color(script.Parent.Smoke.Color, 196, 40, 28) >> "Bright red" smoke
|
|
|
| Report Abuse |
|
|