When we make a game in Roblox Studio, one of the important things is colour. Colour will give the soul of the things in the game. So, we have to give the suitable colour for every object in the game. Talk about color in Roblox, you can find BrickColor and Color3. BrickColour is a datatype and it provides a predefined list of colours. At the beginning, you were only able to set the color of a Part to a BrickColor. But now, it has been expanded to support Color3 as well. Presently, BrickColor just serves as a handy palette of common Roblox part colors.
For your information, every BrickColor has a numeric ID and the ID represents the color. For instance, 2 is grey, 3 is light yellow, and 6 is light green. You are able to find a lot of different colours and you can see the list in the wiki Roblox. To use BrickColor, actually there are two ways. You can use the number code and alternatively you can use the color code. Every code of the color has an ID number which is associated with it.
For instance, Grey has an Id of 2. You are able to use either the name of the color or the ID number of the color when you use the code. If you want to use names, the first thing that you can do is open up a new place with a part. Then, in the Command Line, you need to type in this bit here and press enter:
game.Workspace.Part.BrickColor = BrickColor.new(“White”)
If you do not want to tell Lua that you want the brick to be the value of White, or 1, you are able to tell it specifically that you want the brick to be “White” In this case, you utilized a String instead of a Number. Color3 has 3 numbers an those numbers represent the red, green, and blue component of the color. To use the Color3 values, you can open up a new place with a part. Then, In the Command Line, you have to type in this bit here and press enter:
game.Workspace.Part.BrickColor = BrickColor.new (Color3.new(1, 1, 1))
The Color3 is real-valued RGB color turple, with elements which range from [0,1]. The Color3 data type is usually used in setting the colors of objects that are not related to bricks like GUIs, Sparkles and so on. You may want to convert BrickColor in to Color3. The way of converting BrickColor is very easy. Just follow the formula below.
local brickcolor = BrickColor.new(“Really red”) — Create our new BrickColor
local color = brickcolor.Color — BrickColors have a Color property which returns their Color3
Perhaps, you also want to change a Brick’s Color on Roblox by using a script. You can do that by opening studio up. And then, insert a brick. After that, go to paint tool and look for a color that you like. You have to remember the name which pops up. Now, make a script inside brick. Last, enter this in a script: script.Parent.BrickColor=BrickColor:(“COLOR”). You have to note that you need to change “COLOR” to whatever color that you want.