Class: ColorMatrix

PhotoEditorSDK.Math. ColorMatrix

Represents a 4 by 5 matrix that is used to preform color manipulations. The members are names a, b, c,..,t. The vector formed by e, j, o, t represents the offset.

new PhotoEditorSDK.Math.ColorMatrix()

sdk/lib/math/color-matrix.js, line 32

Creates a color matrix, and defaults the values to the identity.

Members

staticPhotoEditorSDK.Math.ColorMatrix.IDENTITYPhotoEditorSDK.Math.Matrix

The identity matrix

Methods

staticPhotoEditorSDK.Math.ColorMatrix.createBrightnessMatrix(brightness)

sdk/lib/math/color-matrix.js, line 262

Returns a color matrix that can be used to change the brightness.

Name Type Description
brightness Number

staticPhotoEditorSDK.Math.ColorMatrix.createContrastMatrix(contrast)

sdk/lib/math/color-matrix.js, line 275

Returns a color matrix that can be used to change the contrast.

Name Type Description
contrast Number

staticPhotoEditorSDK.Math.ColorMatrix.createLinearMatrix(slope, intercept)

sdk/lib/math/color-matrix.js, line 316

Returns a color matrix that can be used to apply linear changes.

Name Type Default Description
slope Number 1
intercept Number 0

staticPhotoEditorSDK.Math.ColorMatrix.createSaturationMatrix(saturation)

sdk/lib/math/color-matrix.js, line 288

Returns a color matrix that can be used to change the saturation.

Name Type Default Description
saturation Number 1

apply(color){Color}

sdk/lib/math/color-matrix.js, line 124

Applies the color matrix to the given color, and returns the resulting color.

Name Type Description
color Color
Returns:
Type Description
Color

clone(){ColorMatrix}

sdk/lib/math/color-matrix.js, line 199

Retuns a clone of the current matrix/

Returns:
Type Description
ColorMatrix

multiply(matrix){PhotoEditorSDK.Math.ColorMatrix}

sdk/lib/math/color-matrix.js, line 138

Multiplies the given matrix with this matrix.

Name Type Description
matrix PhotoEditorSDK.Math.ColorMatrix
Returns:
Type Description
PhotoEditorSDK.Math.ColorMatrix

reset(){ColorMatrix}

sdk/lib/math/color-matrix.js, line 93

Returns an identity color matrix.

Returns:
Type Description
ColorMatrix

set(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t){PhotoEditorSDK.Math.ColorMatrix}

sdk/lib/math/color-matrix.js, line 66

Sets the values of the color matrix.

Name Type Description
a number
b number
c number
d number
e number
f number
g number
h number
i number
j number
k number
l number
m number
n number
o number
p number
q number
r number
s number
t number
Returns:
Type Description
PhotoEditorSDK.Math.ColorMatrix

toArray(){Array.<Number>}

sdk/lib/math/color-matrix.js, line 246

Returns an array of numbers

Returns:
Type Description
Array.<Number>

toString(){String}

sdk/lib/math/color-matrix.js, line 235

Returns a string representation of this color matrix

Returns:
Type Description
String