> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/development/api-reference/datatype/brickcolor.md).

# BrickColor

## Overview

A data type that is a collection of predefined color names. Unlike Color3, which specifies the RGB values directly, this data type can select and use preset color names.

The BrickColor.new function can be used to specify the name of a desired color, conveniently setting the BrickColor property of a part.

Refer to the table below for the list of colors included in BrickColor.

## Constructors

### new

Creates a BrickColor object corresponding to the provided name.

#### Parameters

| `string` val | The name of the BrickColor to create. |
| ------------ | ------------------------------------- |

#### Return

| `BrickColor` | The created BrickColor. |
| ------------ | ----------------------- |

#### Code Samples

```lua
local BrickColor = BrickColor.new("Bright red")
```

## Properties

### b

`number`

A value representing the Blue ratio of BrickColor in the RGB color system. 0 means the intensity of Blue is very low, and 1 means the intensity of Blue is very high.

#### Code Samples

```lua
local BrickColorName = "Bright red"
local BrickColor = BrickColor.new(BrickColorName)

print(BrickColor.b)
```

### Color

`Color3`

The color value in Color3, based on the RGB of actually displayed BrickColor.

#### Code Samples

```lua
local BrickColor = BrickColor.new("Bright red")
local Color3 = BrickColor.Color

print(Color3.r, Color3.g, Color3.b)
```

### g

`number`

A value representing the Green ratio of BrickColor in the RGB color system. 0 means the intensity of Green is very low, and 1 means the intensity of Green is very high.

#### Code Samples

```lua
local BrickColorName = "Bright red"
local BrickColor = BrickColor.new(BrickColorName)

print(BrickColor.g)
```

### Name

`string`

A name given to BrickColor. This value is used internally to identify or refer to a specific color.

#### Code Samples

```lua
local BrickColor = BrickColor.new("Bright red")
local BrickColorName = BrickColor.Name
print(BrickColorName)
```

### Number

`number`

A unique identifier given to BrickColor. This value is used internally to identify or refer to a specific color.

#### Code Samples

```lua
local BrickColorName = "Bright red"
local BrickColor = BrickColor.new(BrickColorName)
local BrickColorIndex  = BrickColor.Number

print(BrickColorName, "(", BrickColorIndex, ") : ", BrickColor.r, BrickColor.g, BrickColor.b)
```

### r

`number`

A value representing the Red ratio of BrickColor in the RGB color system. 0 means the intensity of Red is very low, and 1 means the intensity of Red is very high.

#### Code Samples

```lua
local BrickColorName = "Bright red"
local BrickColor = BrickColor.new(BrickColorName)

print(BrickColor.r)
```

## Methods

## Events

## See also
