Skip to content

Color3

Summary

Properties Properties of a `Color3`.

  • R: Number
  • G: Number
  • B: Number
Constructors Constructors of a `Color3`.

Methods Methods of a `Color3`.

Properties

R

Number

The red value of the color.


G

Number

The green value of the color.


B

Number

The blue value of the color.


Constructors

new(R: Number, G: Number, B: Number)

Color3

Returns a new Color3 from the given values. Values range from 0 to 1.


fromRGB(R: Number, G: Number, B: Number)

Color3

Returns a new Color3 from the given values. Values range from 0 to 255.


Methods

Lerp()

Color3

color:Lerp(other: Color3, alpha: Number)

Returns a component-wise linear interpolation between color and other.

Parameters

  • other: Color3 — the target color.
  • alpha: Number — the interpolation amount, from 0 to 1.

Examples

Use fromRGB when working with familiar 0 to 255 color values. Use new when the components are already normalized from 0 to 1:

local orangeFromRGB = Color3.fromRGB(255, 128, 0)
local orangeNormalized = Color3.new(1, 128 / 255, 0)
local part = workspace:FindFirstChild("MyPart")
if part then
part.Color = orangeFromRGB
end

Lerp creates a color between two endpoints. An alpha of 0 returns the starting color, 1 returns the target, and 0.5 returns the midpoint:

local red = Color3.fromRGB(255, 0, 0)
local blue = Color3.fromRGB(0, 0, 255)
local purple = red:Lerp(blue, 0.5)

Testing Notes

The previously listed Color3.fromHSV and Color3.fromHex constructors were removed from this reference because they are not exposed in Vortex Studio 0.3.4. Runtime availability may change in later releases.

The examples above were revalidated in Vortex Studio 0.3.8. Color3.fromRGB(255, 128, 0) produced approximately (1, 0.502, 0), and the red-to-blue midpoint produced (0.5, 0, 0.5).