PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

Color3

Color3

Not to be confused with datatype/BrickColor, a data type involving named colors. Color3 is used for specific colors.

Color3 is a data type that describes a color using R, G and B components, which are on the range [0, 1]. Color3 is used for precise coloring of objects on screen through properties like BasePart/Color and GuiObject/BackgroundColor3.

See Also

  • datatype/BrickColor, for a named color type.

Constructors

Color3.new ( )

Creates a Color3 whose values are (0, 0, 0) or black.

Color3.new ( number red = 0, number green = 0, number blue = 0 )

Returns a Color3 with the given red, green, and blue values. The parameters should be on the range [0, 1].

Color3.fromRGB ( number red = 0, number green = 0, number blue = 0 )

Creates a Color3 with the given red, green, and blue components. Unlike most other Color3 functions, the parameters for this function should be on the range [0, 255].

Color3.fromHSV ( number hue, number saturation, number value )

Creates a Color3 with the given hue, saturation, and value. The parameters should be on the range [0, 1].

Properties

number Color3.R

The red value of the color

number Color3.G

The green value of the color

number Color3.B

The blue value of the color

Functions

Color3 Color3:lerp ( Color3 color, number alpha )

Returns a Color3 interpolated between two Color3 objects. Alpha is a number from 0 to 1.

number , number , number Color3.toHSV ( Color3 color ) [static]

Returns the hue, saturation, and value of a Color3.