Optionalr: numberOptionalg: numberOptionalb: numberOptionala: numberStaticblackStatictransparentStaticwhiteReturns a copy of the current color added by the given one.
Copies all properties defined by the prototype of LinearColor from other to this instance.
Clones this instance and returns a new LinearColor with identical values.
Returns a copy of the current color divided by a factor.
Adds another color to this one and returns it.
Divides this color by a factor.
Performs component-wise multiplication with another color.
Performs scalar multiplication of this color and returns it.
Subtracts another color from this one and returns it.
Returns whether the provided color, given a error margin, has the same color components values as this one.
The other Color to compare with.
Optionalepsilon: numberOptional. Error margin within which the numbers should be considered equal.
True if equal, false otherwise.
Returns whether the given color contains the same color components values as this one.
Returns a copy of the current color multiplied by the given color.
Returns a copy of this color multiplied by the factor.
Returns a copy of the current color subtracted by the given color.
Converts this color to a HueSaturationValue color.
StaticaddAdds two colors together.
StaticdivideDivides the given color by a factor.
StaticisCompares two colors with an error margin.
First color to compare.
Second color to compare.
Optionalepsilon: numberOptional. Error margin within which the numbers should be considered equal.
True if equal, false otherwise.
StaticisReturns whether all the colors components contains the same values.
StaticmultiplyMultiplies both colors.
StaticmultiplyMultiply the color by the scalar.
StaticsubtractSubtract both colors.
StaticwithCreates a new linear color value from a generic color value.
The LinearColor implements a color in linear color space. The class follows the 'copy-on-write' pattern, which means that every operation such as LinearColor.divideScalar or LinearColor.multiply returns a copy of the color with updated values. It also implies that the values of the color cannot be directly modified.
The concept of immutability improves sharing of objects as all types in TypeScript are assigned by identity, instead of by-value (e.g. a copy) as in other programming languages like C.