The value that determines how much of the original color is used when mixing the colors. A value between 0 (all original) and 1 (all final)
Static ReadonlyBLACK_A constant array used by the ColorMatrix class for black_white operations.
Static ReadonlyBROWNA constant array used by the ColorMatrix class for brown operations.
Static ReadonlyDESATURATE_A constant array used by the ColorMatrix class for desatured luminance operations.
Static ReadonlyKODACHROMEA constant array used by the ColorMatrix class for kodachrome operations.
Static ReadonlyLSDA constant array used by the ColorMatrix class for lsd operations.
Static ReadonlyNEGATIVEA constant array used by the ColorMatrix class for negative operations.
Static ReadonlyPOLAROIDA constant array used by the ColorMatrix class for polaroid shift operations.
Static ReadonlySEPIAA constant array used by the ColorMatrix class for sepia operations.
Static ReadonlySHIFT_A constant array used by the ColorMatrix class for shift BGR operations.
Static ReadonlyTECHNICOLORA constant array used by the ColorMatrix class for technicolor operations.
Static ReadonlyVINTAGEA constant array used by the ColorMatrix class for vintage pinhole operations.
Sets this ColorMatrix to be black and white.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Changes the brightness of this ColorMatrix by the given amount.
Optionalvalue: numberThe amount of brightness to apply to this ColorMatrix. Between 0 (black) and 1. Default 0.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Applies a brown tone to this ColorMatrix.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Change the contrast of this ColorMatrix by the amount given.
Optionalvalue: numberThe amount of contrast to apply to this ColorMatrix. Default 0.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Apply a desaturated luminance to this ColorMatrix.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Gets the ColorMatrix as a Float32Array.
Can be used directly as a 1fv shader uniform value.
Sets this ColorMatrix to be grayscale.
Optionalvalue: numberThe grayscale scale (0 is black). Default 1.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Rotates the hues of this ColorMatrix by the value given.
Optionalrotation: numberThe amount of hue rotation to apply to this ColorMatrix, in degrees. Default 0.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Applies a kodachrome color effect to this ColorMatrix.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Applies a trippy color tone to this ColorMatrix.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Multiplies the two given matrices.
The 5x4 array to multiply with ColorMatrix._matrix.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Converts this ColorMatrix to have negative values.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Applies a night vision tone to this ColorMatrix.
Optionalintensity: numberThe intensity of this effect. Default 0.1.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Applies a polaroid color effect to this ColorMatrix.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Resets the ColorMatrix to default values and also resets
the alpha property back to 1.
Changes the saturation of this ColorMatrix by the given amount.
Optionalvalue: numberThe amount of saturation to apply to this ColorMatrix. Default 0.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Desaturates this ColorMatrix (removes color from it).
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Applies a sepia tone to this ColorMatrix.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Sets this ColorMatrix from the given array of color values.
The ColorMatrix values to set. Must have 20 elements.
Shifts the values of this ColorMatrix into BGR order.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Applies a technicolor color effect to this ColorMatrix.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
Applies a vintage pinhole color effect to this ColorMatrix.
Optionalmultiply: booleanMultiply the resulting ColorMatrix (true), or set it (false) ? Default false.
The ColorMatrix class creates a 5x4 matrix that can be used in shaders and graphics operations. It provides methods required to modify the color values, such as adjusting the brightness, setting a sepia tone, hue rotation and more.
Use the method
getDatato return a Float32Array containing the current color values.