MODULE API
from default Color3
These functions originate from default Color3, where their use is exactly the same.
color3.new(r, g, b)
color3.fromRGB(r, g, b)
color3.fromHSV(hue, saturation, value)
color3.fromHEX(hex)
new to color3
These functions aren’t present in the default Color3 module
color3.fromYUV(Luminance, Blue_Chrominance, Red_Chrominance)
color3.fromBytepack(n, offset)
PRESESTS
color3.presets
contains a list of already made colours:
white → 255 255 255
black → 0 0 0
red → 255, 0, 0
green-> 0, 255, 0
blue → 0, 0, 255
purple → 255, 0, 255
cyan → 0, 255, 255
yellow → 255, 255, 0
METHODS
ARITHMETIC
(all arithmetic methods by default clamp the new RGB values to 0-255)
color3 + color3
: color3
Adds the R, G and B values of the two color3 values.
Accepts default Color3 as well as numbers, where if a number is added, it would add the number to all RGB values.
color3 - color3
: color3
Subtracts the R, G and B values of the two color3 values.
Accepts default Color3 as well as numbers, where if a number is subtracted, it would subtract the number from all RGB values.
color3 * color3
: color3
Multiplies the R, G and B values of the two color3 values.
Accepts default Color3 as well as numbers, where if a number is multiplied, it would multiply the number with all RGB values.
color3 / color3
: color3
Devides the R, G and B values of the two color3 values.
Accepts default Color3 as well as numbers, where if a number is devided, it would devide the RGB values by the number.
color3 ^ color3
: color3
Powers the R, G, B values of input A to the number or RGB values of input B.
Accepts default Color3 as well as numbers, where if a number is devided, it would devide the RGB values by the number.
-color3
Inverts the color3, where if it was 100, 255, 255, it’s now 155, 0, 0
color3 % color3
: color3
Returns the average of the two color3 values. Accepts the default Color3, but does not accept numbers.
#color3
Returns the hex value of the color3
color3 == color3
Returns true if the two color3 values are identical. ONLY accepts color3 values.
FUNCTIONS
from default Color3
These functions originate from default Color3, where their use is exactly the same.
color3:ToHSV()
color3:ToHex()
color3:Lerp(color, alpha)
new to color3
These functions aren’t present in default Color3 module
color3:Quadlerp(color, alpha)
Lerps self to color by alpha, uses the equation alpha ^ alpha
Accepts both color3 and Color3 inputs as color input.
color3:Sinelerp(color, alpha)
Lerps self to color by alpha, uses the equation sin(alpha * π * 0.5)
Accepts both color3 and Color3 inputs as color input.
color3:ToGrayscale()
Returns the grayscale version of the color3. Grayscale is NOT the average of the RGB values.
color3:ToAverage()
Returns the average version of the color3, where all RGB values are the average of the previous RGB values.
color3:Bytepack(offset)
Packs the RGB values into a 32bit number.
@CoderHusk did a great job explaining it here
color3:RotateHue(degrees)
Returns a new color3, with the hue changed by degrees
color3:GetYUV()
Returns Y (Luminance), U (Blue Chrominance) and V (Red Chrominance) from the color3 object.
MENTION
color3()
returns the default Color3 value of the color3 object.
LINK
If you got any ideas for functions that the color3 module is missing, please note them in the thread!