generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Y Color3 Not Work?!

Previous Thread :: Next Thread 
Sethalonian is not online. Sethalonian
Joined: 13 Jan 2010
Total Posts: 530
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 is not online. 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
Sethalonian is not online. Sethalonian
Joined: 13 Jan 2010
Total Posts: 530
24 Jan 2012 02:45 PM
What? then why can sparkles be 255? Thats weird.... Thx!
Report Abuse
crazytomato4 is not online. crazytomato4
Joined: 09 Feb 2011
Total Posts: 1368
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 is not online. 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
Sethalonian is not online. Sethalonian
Joined: 13 Jan 2010
Total Posts: 530
24 Jan 2012 02:56 PM
Thx, ok, I think I can do it now.
Report Abuse
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image