A simple color struct.
public float r, g, b, a;
The color channels.
public static LuaColor operator+(LuaColor left, LuaColor right)
Overload for adding two colors together.
Arguments
(Color) The LHS color. [left]
(Color) The RHS color. [right]
Returns: (Color) The colors added together.
public static LuaColor operator -(LuaColor left, LuaColor right)
Overload for subtracting two colors together.
Arguments
(Color) The LHS color. [left]
(Color) The RHS color. [right]
Returns: (Color) The colors subtracted together.
public static LuaColor operator *(LuaColor left, LuaColor right)
Overload for multiplying two colors together.
Arguments
(Color) The LHS color. [left]
(Color) The RHS color. [right]
Returns: (Color) The colors multiplied together.
public static LuaColor operator *(float scalar, LuaColor right)
Overload for multiplying a color with a scalar.
Arguments
(float) The scalar. [scalar]
(Color) The color. [right]
Returns: (Color) The color and the scalar multiplied.
public static LuaColor operator *(LuaColor left, float scalar)
Overload for multiplying a color with a scalar.
Arguments
(Color) The color. [left]
(float) The scalar. [scalar]
Returns: (Color) The color and the scalar multiplied.
public LuaColor GetGamma()
Get the gamma corrected version of this color.
Returns: (Color) The gamma corrected color.
public LuaColor GetLinear()
Get the linear version of the sRGB color.
Returns: (Color) The linear color.
public float GetMaxComponent()
Get the max color component.
Returns: (float) The max color component.
public LuaColor InheritHueFrom(LuaColor other)
Inheit the hue of a different color.
Arguments
Returns: (Color) The new color with the hue of the other color.
public LuaColor Lerp(LuaColor other, float t)
Lerps this color to the other color by a time t.
Arguments
(Color) The other Color. [other]
(float) The time t. [t]
Returns: (Color) The lerped Color.
public LuaColor LerpUnclamped(LuaColor other, float t)
Lerps this color to the other color by a time t without clamping.
Arguments
(Color) The other Color. [other]
(float) The time t. [t]
Returns: (Color) The lerped Color.
public static LuaColor Color(float r, float g, float b, float a = 1f)
Create a new color.
Used like so local color = Color(0-1, 0-1, 0-1, 0-1)
Arguments
(float) The red channel component, goes from 0 to 1. [r]
(float) The green channel component, goes from 0 to 1. [g]
(float) The blue channel component, goes from 0 to 1. [b]
(float) The alpha channel component, goes from 0 to 1. Defaults to 1. [a]
Returns: (Color) The new color.
public static LuaColor ColorWhite()
Creates a new white color (1,1,1,1).
Returns: (Color) The new color.
public static LuaColor ColorBlack()
Creates a new black color (0,0,0,1).
Returns: (Color) The new color.
public static LuaColor ColorRed()
Creates a new red color (1,0,0,1).
Returns: (Color) The new color.
public static LuaColor ColorGreen()
Creates a new green color (0,1,0,1).
Returns: (Color) The new color.
public static LuaColor ColorBlue()
Creates a new blue color (0,0,1,1).
Returns: (Color) The new color.
public static LuaColor ColorYellow()
Creates a new yellow color (1,0.92,0.016,1).
Returns: (Color) The new color.
public static LuaColor ColorPurple()
Creates a new purple color (0.666,0,1,1).
Returns: (Color) The new color.
public static LuaColor ColorClear()
Creates a new transparent color (0,0,0,0).
Returns: (Color) The new color.