Random BrickColor

Random BrickColor

Jun 14 2019, 4:48 PM PST


You want to use BrickColors.


Use the BrickColor table.

local part = Instance.new('Part')
part.Parent = Workspace
part.Anchored = true
part.BrickColor = BrickColor.random()


Where do these brick colors come from? If you’ve ever set the color of a brick in Studio you’ll notice that there is a little widget that comes up with a bunch of colors you can choose from. That’s all the BrickColors. If you hover over a color you’ll notice that a tooltip comes up with its name. That name can be put into BrickColor.new and you’ll have that color. Also, notice that the colors are in some sort of order. This same order can be achieved by using the BrickColor.palette function. Since the first color on the widget is “Br. yellowish green”, then BrickColor.palette(0) would be equal to BrickColor.new(“Br. yellowish green”).

You can also convert a BrickColor to a Color3 by accessing BrickColor.Color. You can also access individual components of the Color3 directly from the BrickColor with BrickColor.r, .g, and .b. Do note these are read-only values.

  • part
  • color
  • brickcolor
  • script