Color3

Represents a Color with Red, Green, and Blue values

Summary

Constructors

Color3.new(r: number, g: number, b:number): Color3

Properties

R: number
G: number
B: number

Methods

Color3:ToHex(c: Color3): number
Color3:ToHsv(c: Color3): (number, number, number)
Color3:Decompose(c: Color3): (number, number, number)
Color3:Tint(c: Color3, tint: Color3): Color3
Color3:Brightness(c: Color3, b: number): Color3
Color3:Contrast(c: Color3, f: number): Color3
Color3:Grayscale(c: Color3): Color3
Color3:Lerp(from: Color3, to: Color3: t: number): Color3

Constructors

Color3.new()

Creates a new Color3 from the given components

Color3.new(r: number, g: number, b:number): Color3

Properties

Color3.R

The red component of the Color3.

Color3.G

The green component of the Color3.

Color3.B

The blue component of the Color3.

Methods

Color3:ToHex

Converts the Color3 into a hexadecimal value represented by an integer with the range of `[0, 16777215]

Color3:ToHex(c: Color3): number

Color3:ToHsv

Converts the Color3 into Hue, Saturation, and Value components, a different way of representing a color.

Color3:ToHsv(c: Color3): (number, number, number)

Color3:Decompose

Decomposes the Color3 returning each of its three components individually.

Color3:Decompose(c: Color3): (number, number, number)

Color3:Tint

Tints the Color3 with the specified color

Color3:Tint(c: Color3, tint: Color3): Color3

Color3:Brightness

Calculates the Color3 with a brightness factor.

Color3:Brightness(c: Color3, b: number): Color3

Color3:Contrast

Calculates the Color3 with a contrast factor.

Color3:Contrast(c: Color3, f: number): Color3

Color3:Grayscale

Returns a grayscaled copy of the Color3

Color3:Grayscale(c: Color3): Color3

Color3:Lerp

Returns a Color3 that has each of its components linearly interpolated between this Color3 and the given goal by the given amount.

Color3:Lerp(from: Color3, to: Color3: t: number): Color3
Parameters Description
from: Color3 The Color3 to linearly interpolate from.
to: Color3 The Color3 to linearly interpolate to.
t: number How much to linearly interpolate from from: Color3 to to: Color3, assumed to be in the range of [0, 1].