Class Color3
Hierarchy
- Color3
Index
Constructors
Properties
Accessors
Methods
- add
- add
To Ref - as
Array - clamp
To Ref - clone
- copy
From - copy
From Floats - equals
- equals
Floats - from
Array - get
Class Name - get
Hash Code - multiply
- multiply
To Ref - scale
- scale
And Add To Ref - scale
In Place - scale
To Ref - set
- subtract
- subtract
To Ref - to
Array - to
Color4 - to
Gamma Space - to
Gamma Space To Ref - toHSV
- toHSVTo
Ref - to
Hex String - to
Linear Space - to
Linear Space To Ref - to
Luminance - to
String - Black
- Blue
- From
Array - From
Array To Ref - FromHSV
- From
Hex String - From
Ints - Gray
- Green
- HSVtoRGBTo
Ref - Hermite
- Hermite1st
Derivative - Hermite1st
Derivative To Ref - Lerp
- Lerp
To Ref - Magenta
- Purple
- Random
- Red
- Teal
- White
- Yellow
Constructors
constructor
Creates a new Color3 object from red, green, blue values, all between 0 and 1
Parameters
Optional r: number
defines the red component (between 0 and 1, default is 0)
Optional g: number
defines the green component (between 0 and 1, default is 0)
Optional b: number
defines the blue component (between 0 and 1, default is 0)
Returns Color3
Properties
bSearch playground for b
Defines the blue component (between 0 and 1, default is 0)
gSearch playground for g
Defines the green component (between 0 and 1, default is 0)
rSearch playground for r
Defines the red component (between 0 and 1, default is 0)
Accessors
Static Black Read Only
Gets a Color3 value containing a black color that must not be updated
Returns DeepImmutableObject<Color3>
Methods
addSearch playground for add
Creates a new Color3 set with the added values of the current Color3 and of the given one
Parameters
otherColor: DeepImmutableObject<Color3>
defines the second operand
Returns Color3
the new Color3
add To RefSearch playground for addToRef
Stores the result of the addition of the current Color3 and given one rgb values into "result"
Parameters
otherColor: DeepImmutableObject<Color3>
defines the second operand
result: Color3
defines Color3 object to store the result into
Returns Color3
the unmodified current Color3
as ArraySearch playground for asArray
Returns a new array populated with 3 numeric elements : red, green and blue values
Returns number[]
the new array
clamp To RefSearch playground for clampToRef
Clamps the rgb values by the min and max values and stores the result into "result"
Parameters
min: undefined | number
defines minimum clamping value (default is 0)
max: undefined | number
defines maximum clamping value (default is 1)
result: Color3
defines color to store the result into
Returns Color3
the original Color3
cloneSearch playground for clone
Copy the current object
Returns Color3
a new Color3 copied the current one
copy FromSearch playground for copyFrom
Copies the rgb values from the source in the current Color3
Parameters
source: DeepImmutableObject<Color3>
defines the source Color3 object
Returns Color3
the updated Color3 object
copy From FloatsSearch playground for copyFromFloats
Updates the Color3 rgb values from the given floats
Parameters
r: number
defines the red component to read from
g: number
defines the green component to read from
b: number
defines the blue component to read from
Returns Color3
the current Color3 object
equalsSearch playground for equals
Determines equality between Color3 objects
Parameters
otherColor: DeepImmutableObject<Color3>
defines the second operand
Returns boolean
true if the rgb values are equal to the given ones
equals FloatsSearch playground for equalsFloats
Determines equality between the current Color3 object and a set of r,b,g values
Parameters
r: number
defines the red component to check
g: number
defines the green component to check
b: number
defines the blue component to check
Returns boolean
true if the rgb values are equal to the given ones
from ArraySearch playground for fromArray
Update the current color with values stored in an array from the starting index of the given array
Parameters
array: DeepImmutableObject<ArrayLike<number>>
defines the source array
Optional offset: number
defines an offset in the source array
Returns Color3
the current Color3 object
get Class NameSearch playground for getClassName
Returns the string "Color3"
Returns string
"Color3"
get Hash CodeSearch playground for getHashCode
Compute the Color3 hash code
Returns number
an unique number that can be used to hash Color3 objects
multiplySearch playground for multiply
Multiply each Color3 rgb values by the given Color3 rgb values in a new Color3 object
Parameters
otherColor: DeepImmutableObject<Color3>
defines the second operand
Returns Color3
the new Color3 object
multiply To RefSearch playground for multiplyToRef
Multiply the rgb values of the Color3 and the given Color3 and stores the result in the object "result"
Parameters
otherColor: DeepImmutableObject<Color3>
defines the second operand
result: Color3
defines the Color3 object where to store the result
Returns Color3
the current Color3
scaleSearch playground for scale
Creates a new Color3 with the current Color3 values multiplied by scale
Parameters
scale: number
defines the scaling factor to apply
Returns Color3
a new Color3 object
scale And Add To RefSearch playground for scaleAndAddToRef
scale In PlaceSearch playground for scaleInPlace
Multiplies the Color3 values by the float "scale"
Parameters
scale: number
defines the scaling factor to apply
Returns Color3
the current updated Color3
scale To RefSearch playground for scaleToRef
setSearch playground for set
Updates the Color3 rgb values from the given floats
Parameters
r: number
defines the red component to read from
g: number
defines the green component to read from
b: number
defines the blue component to read from
Returns Color3
the current Color3 object
subtractSearch playground for subtract
Returns a new Color3 set with the subtracted values of the given one from the current Color3
Parameters
otherColor: DeepImmutableObject<Color3>
defines the second operand
Returns Color3
the new Color3
subtract To RefSearch playground for subtractToRef
Stores the result of the subtraction of given one from the current Color3 rgb values into "result"
Parameters
otherColor: DeepImmutableObject<Color3>
defines the second operand
result: Color3
defines Color3 object to store the result into
Returns Color3
the unmodified current Color3
to ArraySearch playground for toArray
Stores in the given array from the given starting index the red, green, blue values as successive elements
Parameters
array: FloatArray
defines the array where to store the r,g,b components
Optional index: number
defines an optional index in the target array to define where to start storing values
Returns Color3
the current Color3 object
to Color4Search playground for toColor4
Returns a new Color4 object from the current Color3 and the given alpha
Parameters
Optional alpha: number
defines the alpha component on the new Color4 object (default is 1)
Returns Color4
a new Color4 object
to Gamma SpaceSearch playground for toGammaSpace
Computes a new Color3 converted from the current one to gamma space
Returns Color3
a new Color3 object
to Gamma Space To RefSearch playground for toGammaSpaceToRef
toHSVSearch playground for toHSV
Converts current color in rgb space to HSV values
Returns Color3
a new color3 representing the HSV values
toHSVTo RefSearch playground for toHSVToRef
Converts current color in rgb space to HSV values
Parameters
result: Color3
defines the Color3 where to store the HSV values
Returns void
to Hex StringSearch playground for toHexString
Compute the Color3 hexadecimal code as a string
Returns string
a string containing the hexadecimal representation of the Color3 object
to Linear SpaceSearch playground for toLinearSpace
Computes a new Color3 converted from the current one to linear space
Returns Color3
a new Color3 object
to Linear Space To RefSearch playground for toLinearSpaceToRef
to LuminanceSearch playground for toLuminance
Returns the luminance value
Returns number
a float value
to StringSearch playground for toString
Creates a string with the Color3 current values
Returns string
the string representation of the Color3 object
Static BlackSearch playground for Black
Returns a Color3 value containing a black color
Returns Color3
a new Color3 object
Static BlueSearch playground for Blue
Returns a Color3 value containing a blue color
Returns Color3
a new Color3 object
Static From ArraySearch playground for FromArray
Creates a new Color3 from the starting index of the given array
Parameters
array: DeepImmutableObject<ArrayLike<number>>
defines the source array
Optional offset: number
defines an offset in the source array
Returns Color3
a new Color3 object
Static From Array To RefSearch playground for FromArrayToRef
Creates a new Color3 from the starting index element of the given array
Parameters
array: DeepImmutableObject<ArrayLike<number>>
defines the source array to read from
offset: undefined | number
defines the offset in the source array
result: Color3
defines the target Color3 object
Returns void
Static FromHSVSearch playground for FromHSV
Converts Hue, saturation and value to a new Color3 (RGB)
Parameters
hue: number
defines the hue (value between 0 and 360)
saturation: number
defines the saturation (value between 0 and 1)
value: number
defines the value (value between 0 and 1)
Returns Color3
a new Color3 object
Static From Hex StringSearch playground for FromHexString
Creates a new Color3 from the string containing valid hexadecimal values
Parameters
hex: string
defines a string containing valid hexadecimal values
Returns Color3
a new Color3 object
Static From IntsSearch playground for FromInts
Creates a new Color3 from integer values (< 256)
Parameters
r: number
defines the red component to read from (value between 0 and 255)
g: number
defines the green component to read from (value between 0 and 255)
b: number
defines the blue component to read from (value between 0 and 255)
Returns Color3
a new Color3 object
Static GraySearch playground for Gray
Returns a Color3 value containing a gray color
Returns Color3
a new Color3 object
Static GreenSearch playground for Green
Returns a Color3 value containing a green color
Returns Color3
a new Color3 object
Static HSVtoRGBTo RefSearch playground for HSVtoRGBToRef
Converts Hue, saturation and value to a Color3 (RGB)
Parameters
hue: number
defines the hue
saturation: number
defines the saturation
value: number
defines the value
result: Color3
defines the Color3 where to store the RGB values
Returns void
Static HermiteSearch playground for Hermite
Returns a new Color3 located for "amount" (float) on the Hermite interpolation spline defined by the vectors "value1", "tangent1", "value2", "tangent2"
Parameters
value1: DeepImmutableObject<Color3>
defines the first control point
tangent1: DeepImmutableObject<Color3>
defines the first tangent Color3
value2: DeepImmutableObject<Color3>
defines the second control point
tangent2: DeepImmutableObject<Color3>
defines the second tangent Color3
amount: number
defines the amount on the interpolation spline (between 0 and 1)
Returns Color3
the new Color3
Static Hermite1st DerivativeSearch playground for Hermite1stDerivative
Returns a new Color3 which is the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
Parameters
value1: DeepImmutableObject<Color3>
defines the first control point
tangent1: DeepImmutableObject<Color3>
defines the first tangent
value2: DeepImmutableObject<Color3>
defines the second control point
tangent2: DeepImmutableObject<Color3>
defines the second tangent
time: number
define where the derivative must be done
Returns Color3
1st derivative
Static Hermite1st Derivative To RefSearch playground for Hermite1stDerivativeToRef
Returns a new Color3 which is the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
Parameters
value1: DeepImmutableObject<Color3>
defines the first control point
tangent1: DeepImmutableObject<Color3>
defines the first tangent
value2: DeepImmutableObject<Color3>
defines the second control point
tangent2: DeepImmutableObject<Color3>
defines the second tangent
time: number
define where the derivative must be done
result: Color3
define where to store the derivative
Returns void
Static LerpSearch playground for Lerp
Creates a new Color3 with values linearly interpolated of "amount" between the start Color3 and the end Color3
Parameters
start: DeepImmutableObject<Color3>
defines the start Color3 value
end: DeepImmutableObject<Color3>
defines the end Color3 value
amount: number
defines the gradient value between start and end
Returns Color3
a new Color3 object
Static Lerp To RefSearch playground for LerpToRef
Creates a new Color3 with values linearly interpolated of "amount" between the start Color3 and the end Color3
Parameters
left: DeepImmutableObject<Color3>
defines the start value
right: DeepImmutableObject<Color3>
defines the end value
amount: number
defines the gradient factor
result: Color3
defines the Color3 object where to store the result
Returns void
Static MagentaSearch playground for Magenta
Returns a Color3 value containing a magenta color
Returns Color3
a new Color3 object
Static PurpleSearch playground for Purple
Returns a Color3 value containing a purple color
Returns Color3
a new Color3 object
Static RandomSearch playground for Random
Returns a Color3 value containing a random color
Returns Color3
a new Color3 object
Static RedSearch playground for Red
Returns a Color3 value containing a red color
Returns Color3
a new Color3 object
Static TealSearch playground for Teal
Returns a Color3 value containing a teal color
Returns Color3
a new Color3 object
Static WhiteSearch playground for White
Returns a Color3 value containing a white color
Returns Color3
a new Color3 object
Static YellowSearch playground for Yellow
Returns a Color3 value containing a yellow color
Returns Color3
a new Color3 object
Class used to hold a RGB color