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: Can I use hex code instead of color code

Previous Thread :: Next Thread 
JetCrusherTorpedo is not online. JetCrusherTorpedo
Joined: 13 Feb 2012
Total Posts: 218
12 Oct 2013 11:37 AM
???
I want to use #195905
Report Abuse
Excellus is not online. Excellus
Joined: 17 Jun 2013
Total Posts: 3939
12 Oct 2013 11:38 AM
Explain what you're trying to do?
Report Abuse
JetCrusherTorpedo is not online. JetCrusherTorpedo
Joined: 13 Feb 2012
Total Posts: 218
12 Oct 2013 11:42 AM
Color a brick using hex code.
Report Abuse
Dexinus is not online. Dexinus
Joined: 07 Sep 2011
Total Posts: 103
12 Oct 2013 11:47 AM
No, hex code isnt implemented into Rbx.Lua.

- Dex, Add 2k to my post count
Report Abuse
Excellus is not online. Excellus
Joined: 17 Jun 2013
Total Posts: 3939
12 Oct 2013 11:53 AM
color = string.byte("100")

Here's an example:

color = string.byte("100")
game.StarterGui.ControlGUI.Reset.BackgroundColor3 = Color3.new(string.char(color)/255, 100/255, 100/255)
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
12 Oct 2013 11:55 AM
use tonumber and Coler3
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
12 Oct 2013 11:59 AM
195905
"No, hex code isnt implemented into Rbx.Lua."
Eh... yes it is. The format is 0x####
So,
print(0xFF)
would print 255

function GetColor3FromHex(value) -- value is a string, so "195905"
return Color3.new(
tonumber("0x"..value:sub(1,2))/255,
tonumber("0x"..value:sub(3,4))/255,
tonumber("0x"..value:sub(5,6))/255
)
end

print(GetColor3FromHex("195905"))
--> 0.0980392, 0.34902, 0.0196078

print(GetColor3FromHex("FF00FF"))
--> 1, 0, 1
Report Abuse
Excellus is not online. Excellus
Joined: 17 Jun 2013
Total Posts: 3939
12 Oct 2013 11:59 AM
Nevermind, that's not hex.
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
12 Oct 2013 12:22 PM
195905

Color3.new(25/255, 89/255, 5/255)
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