Color Reference: Difference between revisions
>BlueTaslem New page: When defining colors in Roblox, you use <pre> BrickColor.new( <value> ) </pre> The value may be a number, OR the name of a color: <pre> BrickColor.new(21) </pre> and <pre> BrickColor.new... |
>BlueTaslem New page: When defining colors in Roblox, you use <pre> BrickColor.new( <value> ) </pre> The value may be a number, OR the name of a color: <pre> BrickColor.new(21) </pre> and <pre> BrickColor.new... |
(No difference)
|
Revision as of 18:48, 30 December 2010
When defining colors in Roblox, you use
BrickColor.new( <value> )
The value may be a number, OR the name of a color:
BrickColor.new(21)
and
BrickColor.new("Bright red")
both return the color 'Bright red'. (Remember that capitalization must be exact when giving the name of a color!)
Because you can use the names of colors, and the number values corresponding to a color are random at the most, it isn't a very good practice to use the numbers.
However, if you want to, you can use the following color reference:
Color | Value |
---|---|
White | 1 |
Grey | 2 |
Light yellow | 3 |
Brick yellow | 5 |
Light green (Mint) | 6 |
Light reddish violet | 9 |
Pastel Blue | 11 |
Light orange brown | 12 |
Nougat | 18 |
Bright red | 21 |
Med. reddish violet | 22 |
Bright blue | 23 |
Bright yellow | 24 |
Earth orange | 25 |
Black | 26 |
Dark grey | 27 |
Dark green | 28 |
Medium green | 29 |
Please note that this list does not include 'Medium stone grey', as this is the default color for invalid numbers/names (BrickColor.new(-50), BrickColor.new("Not a color name") both return Medium stone grey.)
This reference is far from complete. There are at least 144 colors, and it is impractical to print them all here.
If you would like a more complete reference, you can use the following code:
i = 0 while i < 3000 do i = i + 1 if tostring(BrickColor.new(i)) ~= "Medium stone grey" then print(tostring(BrickColor.new(i)) , i ) end end