Color Reference: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>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...
 
>Mattchewy
Redirect
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
When defining colors in Roblox, you use
#REDIRECT [[BrickColor_Codes]]
<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("Bright red")
</pre>
both return the color 'Bright red'. (Remember that capitalization must be exact when giving the name of a color!) <br/>
<br/>
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.<br/>
However, if you want to, you can use the following color reference:<br/>
{|border="1" cellpadding="1"
|-
! scope="col" | Color
! scope="col" | 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.)
<br/>
This reference is far from complete. There are at least 144 colors, and it is impractical to print them all here.<br/>
If you would like a more complete reference, you can use the following code:
<pre>
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
</pre>

Latest revision as of 22:50, 31 December 2010

Redirect to: