Roblox Wiki
Advertisement
Roblox Wiki
24,303
pages

The basic Color3 data type is a tuple of three numbers between 0 and 1 representing a color with red, blue and green components. Color3 data can also be constructed using different types of values, as described below. It is used in many objects, including ExplorerImageIndex 1.pngPartsExplorerImageIndex 47.pngScreenGui objects, ExplorerImageIndex 0.pngBodyColors instances, and more.

Constructors

  • Color3.new(number r, number g, number b)
    • All numbers used in this function must be between 0–1.
  • Color3.fromRGB(number r, number g, number b)
    • All numbers used in this function must be between 0–255.
  • Color3.fromHSV(number h, number s, number v)
    • All numbers used in this function must be between 0–1.
    • This function creates a Color3 with the given hue, saturation, and value.

Properties

  • number Color3.r
    • The red value of the Color3.
  • number Color3.g
    • The green value of the Color3
  • number Color3.b
    • The blue value of the Color3

Functions

  • Color3 Color3:lerp( Color3 color, number alpha )
    • Returns a Color3 interpolated between two other Color3 objects. 
    • The alpha value must be a number from 0–1.
  • numbernumbernumber Color3.toHSV( Color3 color )
    • Returns the hue, saturation, and value of a Color3.