new Color(r, g, b, a)
Creates a color
Name | Type | Default | Description |
---|---|---|---|
r |
Number | ||
g |
Number | ||
b |
Number | ||
a |
Number | 1 | optional |
Members
-
staticPhotoEditorSDK.Color.BLACKPhotoEditorSDK.Color
-
-
staticPhotoEditorSDK.Color.BLUEPhotoEditorSDK.Color
-
-
staticPhotoEditorSDK.Color.GREENPhotoEditorSDK.Color
-
-
staticPhotoEditorSDK.Color.REDPhotoEditorSDK.Color
-
-
staticPhotoEditorSDK.Color.TRANSPARENTPhotoEditorSDK.Color
-
-
staticPhotoEditorSDK.Color.WHITEPhotoEditorSDK.Color
-
Methods
-
staticPhotoEditorSDK.Color.fromArray(arr){PhotoEditorSDK.Color}
sdk/core/lib/color.js, line 219 -
Creates a new Color object from the given array of numbers
Name Type Description arr
Array.<Number> Returns:
Type Description PhotoEditorSDK.Color -
staticPhotoEditorSDK.Color.fromHex(hex){PhotoEditorSDK.Color}
sdk/core/lib/color.js, line 228 -
Creates a new color object from the given hex string
Name Type Description hex
String Returns:
Type Description PhotoEditorSDK.Color -
staticPhotoEditorSDK.Color.fromHSV(h, s, v, a)
sdk/core/lib/color.js, line 169 -
Creates an RGBA color from the given HSV and alpha values
Name Type Default Description h
Number s
Number v
Number a
Number 1 optional -
add(color){PhotoEditorSDK.Color}
sdk/core/lib/color.js, line 250 -
Adds another color
Name Type Description color
PhotoEditorSDK.Color Returns:
Type Description PhotoEditorSDK.Color -
clamp(minVal, maxVal){PhotoEditorSDK.Color}
sdk/core/lib/color.js, line 303 -
clamp
Name Type Description minVal
Number maxVal
Number Returns:
Type Description PhotoEditorSDK.Color -
clone(){PhotoEditorSDK.Color}
sdk/core/lib/color.js, line 241 -
Returns a clone of the current color
Returns:
Type Description PhotoEditorSDK.Color -
copy(color){PhotoEditorSDK.Color}
sdk/core/lib/color.js, line 332 -
Copies the values from the given color
Name Type Description color
PhotoEditorSDK.Color Returns:
Type Description PhotoEditorSDK.Color -
divideScalar(val){PhotoEditorSDK.Color}
sdk/core/lib/color.js, line 289 -
Divide with a scalar
Name Type Description val
Number Returns:
Type Description PhotoEditorSDK.Color -
equals(color){Boolean}
sdk/core/lib/color.js, line 345 -
Checks if this color equals the given one
Name Type Description color
PhotoEditorSDK.Color Returns:
Type Description Boolean -
fromHSV(h, s, v)
sdk/core/lib/color.js, line 157 -
Sets the RGB values according to the given HSV values
Name Type Description h
Number s
Number v
Number -
minus(color){PhotoEditorSDK.Color}
sdk/core/lib/color.js, line 263 -
Subtract another color
Name Type Description color
PhotoEditorSDK.Color Returns:
Type Description PhotoEditorSDK.Color -
mix(c, a)
sdk/core/lib/color.js, line 318 -
Interpolate between this color and the supplied by the amount determined by the parameter
a
.Name Type Description c
PhotoEditorSDK.Color a
Number -
multiplyScalar(val){PhotoEditorSDK.Color}
sdk/core/lib/color.js, line 276 -
Multiply with a scalar
Name Type Description val
Number Returns:
Type Description PhotoEditorSDK.Color -
set(r, g, b, a){PhotoEditorSDK.Color}
sdk/core/lib/color.js, line 58 -
Sets this color's values to the given RGBA values
Name Type Description r
Number g
Number b
Number a
Number optional Returns:
Type Description PhotoEditorSDK.Color -
toArray(){Array.<Number>}
sdk/core/lib/color.js, line 103 -
Returns an array with 4 values (0...1)
Returns:
Type Description Array.<Number> -
toGLColor(){Array.<Number>}
sdk/core/lib/color.js, line 95 -
Returns an array with 4 values (0...1)
Returns:
Type Description Array.<Number> -
toHex(){String}
sdk/core/lib/color.js, line 82 -
Returns a hex representation of this color
Returns:
Type Description String -
toHSV(){Array.<Number>}
sdk/core/lib/color.js, line 119 -
Converts the RGB value to HSV
Returns:
Type Description Array.<Number> -
toRGB(){Array.<Number>}
sdk/core/lib/color.js, line 70 -
Returns an array with 3 values (0...255)
Returns:
Type Description Array.<Number> -
toRGBA(){String}
sdk/core/lib/color.js, line 40 -
Returns an rgba() representation of this color
Returns:
Type Description String -
toRGBGLColor(){Array.<Number>}
sdk/core/lib/color.js, line 111 -
Returns an array with 3 values (0...1)
Returns:
Type Description Array.<Number> -
toString(){String}
sdk/core/lib/color.js, line 367 -
Returns the string representation of this color
Returns:
Type Description String