Color

new SuperMap3D.Color(red, green, blue, alpha)

A color, specified using red, green, blue, and alpha values, which range from 0 (no intensity) to 1.0 (full intensity).
Name Type Default Description
red Number 1.0 optional The red component.
green Number 1.0 optional The green component.
blue Number 1.0 optional The blue component.
alpha Number 1.0 optional The alpha component.
See:

Members

staticconstantSuperMap3D.Color.ALICEBLUE : Color

An immutable Color instance initialized to CSS color #F0F8FF

staticconstantSuperMap3D.Color.ANTIQUEWHITE : Color

An immutable Color instance initialized to CSS color #FAEBD7

staticconstantSuperMap3D.Color.AQUA : Color

An immutable Color instance initialized to CSS color #00FFFF

staticconstantSuperMap3D.Color.AQUAMARINE : Color

An immutable Color instance initialized to CSS color #7FFFD4

staticconstantSuperMap3D.Color.AZURE : Color

An immutable Color instance initialized to CSS color #F0FFFF

staticconstantSuperMap3D.Color.BEIGE : Color

An immutable Color instance initialized to CSS color #F5F5DC

staticconstantSuperMap3D.Color.BISQUE : Color

An immutable Color instance initialized to CSS color #FFE4C4

staticconstantSuperMap3D.Color.BLACK : Color

An immutable Color instance initialized to CSS color #000000

staticconstantSuperMap3D.Color.BLANCHEDALMOND : Color

An immutable Color instance initialized to CSS color #FFEBCD

staticconstantSuperMap3D.Color.BLUE : Color

An immutable Color instance initialized to CSS color #0000FF

staticconstantSuperMap3D.Color.BLUEVIOLET : Color

An immutable Color instance initialized to CSS color #8A2BE2

staticconstantSuperMap3D.Color.BROWN : Color

An immutable Color instance initialized to CSS color #A52A2A

staticconstantSuperMap3D.Color.BURLYWOOD : Color

An immutable Color instance initialized to CSS color #DEB887

staticconstantSuperMap3D.Color.CADETBLUE : Color

An immutable Color instance initialized to CSS color #5F9EA0

staticconstantSuperMap3D.Color.CHARTREUSE : Color

An immutable Color instance initialized to CSS color #7FFF00

staticconstantSuperMap3D.Color.CHOCOLATE : Color

An immutable Color instance initialized to CSS color #D2691E

staticconstantSuperMap3D.Color.CORAL : Color

An immutable Color instance initialized to CSS color #FF7F50

staticconstantSuperMap3D.Color.CORNFLOWERBLUE : Color

An immutable Color instance initialized to CSS color #6495ED

staticconstantSuperMap3D.Color.CORNSILK : Color

An immutable Color instance initialized to CSS color #FFF8DC

staticconstantSuperMap3D.Color.CRIMSON : Color

An immutable Color instance initialized to CSS color #DC143C

staticconstantSuperMap3D.Color.CYAN : Color

An immutable Color instance initialized to CSS color #00FFFF

staticconstantSuperMap3D.Color.DARKBLUE : Color

An immutable Color instance initialized to CSS color #00008B

staticconstantSuperMap3D.Color.DARKCYAN : Color

An immutable Color instance initialized to CSS color #008B8B

staticconstantSuperMap3D.Color.DARKGOLDENROD : Color

An immutable Color instance initialized to CSS color #B8860B

staticconstantSuperMap3D.Color.DARKGRAY : Color

An immutable Color instance initialized to CSS color #A9A9A9

staticconstantSuperMap3D.Color.DARKGREEN : Color

An immutable Color instance initialized to CSS color #006400

staticconstantSuperMap3D.Color.DARKGREY : Color

An immutable Color instance initialized to CSS color #A9A9A9

staticconstantSuperMap3D.Color.DARKKHAKI : Color

An immutable Color instance initialized to CSS color #BDB76B

staticconstantSuperMap3D.Color.DARKMAGENTA : Color

An immutable Color instance initialized to CSS color #8B008B

staticconstantSuperMap3D.Color.DARKOLIVEGREEN : Color

An immutable Color instance initialized to CSS color #556B2F

staticconstantSuperMap3D.Color.DARKORANGE : Color

An immutable Color instance initialized to CSS color #FF8C00

staticconstantSuperMap3D.Color.DARKORCHID : Color

An immutable Color instance initialized to CSS color #9932CC

staticconstantSuperMap3D.Color.DARKRED : Color

An immutable Color instance initialized to CSS color #8B0000

staticconstantSuperMap3D.Color.DARKSALMON : Color

An immutable Color instance initialized to CSS color #E9967A

staticconstantSuperMap3D.Color.DARKSEAGREEN : Color

An immutable Color instance initialized to CSS color #8FBC8F

staticconstantSuperMap3D.Color.DARKSLATEBLUE : Color

An immutable Color instance initialized to CSS color #483D8B

staticconstantSuperMap3D.Color.DARKSLATEGRAY : Color

An immutable Color instance initialized to CSS color #2F4F4F

staticconstantSuperMap3D.Color.DARKSLATEGREY : Color

An immutable Color instance initialized to CSS color #2F4F4F

staticconstantSuperMap3D.Color.DARKTURQUOISE : Color

An immutable Color instance initialized to CSS color #00CED1

staticconstantSuperMap3D.Color.DARKVIOLET : Color

An immutable Color instance initialized to CSS color #9400D3

staticconstantSuperMap3D.Color.DEEPPINK : Color

An immutable Color instance initialized to CSS color #FF1493

staticconstantSuperMap3D.Color.DEEPSKYBLUE : Color

An immutable Color instance initialized to CSS color #00BFFF

staticconstantSuperMap3D.Color.DIMGRAY : Color

An immutable Color instance initialized to CSS color #696969

staticconstantSuperMap3D.Color.DIMGREY : Color

An immutable Color instance initialized to CSS color #696969

staticconstantSuperMap3D.Color.DODGERBLUE : Color

An immutable Color instance initialized to CSS color #1E90FF

staticconstantSuperMap3D.Color.FIREBRICK : Color

An immutable Color instance initialized to CSS color #B22222

staticconstantSuperMap3D.Color.FLORALWHITE : Color

An immutable Color instance initialized to CSS color #FFFAF0

staticconstantSuperMap3D.Color.FORESTGREEN : Color

An immutable Color instance initialized to CSS color #228B22

staticconstantSuperMap3D.Color.FUCHSIA : Color

An immutable Color instance initialized to CSS color #FF00FF

staticconstantSuperMap3D.Color.GAINSBORO : Color

An immutable Color instance initialized to CSS color #DCDCDC

staticconstantSuperMap3D.Color.GHOSTWHITE : Color

An immutable Color instance initialized to CSS color #F8F8FF

staticconstantSuperMap3D.Color.GOLD : Color

An immutable Color instance initialized to CSS color #FFD700

staticconstantSuperMap3D.Color.GOLDENROD : Color

An immutable Color instance initialized to CSS color #DAA520

staticconstantSuperMap3D.Color.GRAY : Color

An immutable Color instance initialized to CSS color #808080

staticconstantSuperMap3D.Color.GREEN : Color

An immutable Color instance initialized to CSS color #008000

staticconstantSuperMap3D.Color.GREENYELLOW : Color

An immutable Color instance initialized to CSS color #ADFF2F

staticconstantSuperMap3D.Color.GREY : Color

An immutable Color instance initialized to CSS color #808080

staticconstantSuperMap3D.Color.HONEYDEW : Color

An immutable Color instance initialized to CSS color #F0FFF0

staticconstantSuperMap3D.Color.HOTPINK : Color

An immutable Color instance initialized to CSS color #FF69B4

staticconstantSuperMap3D.Color.INDIANRED : Color

An immutable Color instance initialized to CSS color #CD5C5C

staticconstantSuperMap3D.Color.INDIGO : Color

An immutable Color instance initialized to CSS color #4B0082

staticconstantSuperMap3D.Color.IVORY : Color

An immutable Color instance initialized to CSS color #FFFFF0

staticconstantSuperMap3D.Color.KHAKI : Color

An immutable Color instance initialized to CSS color #F0E68C

staticconstantSuperMap3D.Color.LAVENDAR_BLUSH : Color

An immutable Color instance initialized to CSS color #FFF0F5

staticconstantSuperMap3D.Color.LAVENDER : Color

An immutable Color instance initialized to CSS color #E6E6FA

staticconstantSuperMap3D.Color.LAWNGREEN : Color

An immutable Color instance initialized to CSS color #7CFC00

staticconstantSuperMap3D.Color.LEMONCHIFFON : Color

An immutable Color instance initialized to CSS color #FFFACD

staticconstantSuperMap3D.Color.LIGHTBLUE : Color

An immutable Color instance initialized to CSS color #ADD8E6

staticconstantSuperMap3D.Color.LIGHTCORAL : Color

An immutable Color instance initialized to CSS color #F08080

staticconstantSuperMap3D.Color.LIGHTCYAN : Color

An immutable Color instance initialized to CSS color #E0FFFF

staticconstantSuperMap3D.Color.LIGHTGOLDENRODYELLOW : Color

An immutable Color instance initialized to CSS color #FAFAD2

staticconstantSuperMap3D.Color.LIGHTGRAY : Color

An immutable Color instance initialized to CSS color #D3D3D3

staticconstantSuperMap3D.Color.LIGHTGREEN : Color

An immutable Color instance initialized to CSS color #90EE90

staticconstantSuperMap3D.Color.LIGHTGREY : Color

An immutable Color instance initialized to CSS color #D3D3D3

staticconstantSuperMap3D.Color.LIGHTPINK : Color

An immutable Color instance initialized to CSS color #FFB6C1

staticconstantSuperMap3D.Color.LIGHTSEAGREEN : Color

An immutable Color instance initialized to CSS color #20B2AA

staticconstantSuperMap3D.Color.LIGHTSKYBLUE : Color

An immutable Color instance initialized to CSS color #87CEFA

staticconstantSuperMap3D.Color.LIGHTSLATEGRAY : Color

An immutable Color instance initialized to CSS color #778899

staticconstantSuperMap3D.Color.LIGHTSLATEGREY : Color

An immutable Color instance initialized to CSS color #778899

staticconstantSuperMap3D.Color.LIGHTSTEELBLUE : Color

An immutable Color instance initialized to CSS color #B0C4DE

staticconstantSuperMap3D.Color.LIGHTYELLOW : Color

An immutable Color instance initialized to CSS color #FFFFE0

staticconstantSuperMap3D.Color.LIME : Color

An immutable Color instance initialized to CSS color #00FF00

staticconstantSuperMap3D.Color.LIMEGREEN : Color

An immutable Color instance initialized to CSS color #32CD32

staticconstantSuperMap3D.Color.LINEN : Color

An immutable Color instance initialized to CSS color #FAF0E6

staticconstantSuperMap3D.Color.MAGENTA : Color

An immutable Color instance initialized to CSS color #FF00FF

staticconstantSuperMap3D.Color.MAROON : Color

An immutable Color instance initialized to CSS color #800000

staticconstantSuperMap3D.Color.MEDIUMAQUAMARINE : Color

An immutable Color instance initialized to CSS color #66CDAA

staticconstantSuperMap3D.Color.MEDIUMBLUE : Color

An immutable Color instance initialized to CSS color #0000CD

staticconstantSuperMap3D.Color.MEDIUMORCHID : Color

An immutable Color instance initialized to CSS color #BA55D3

staticconstantSuperMap3D.Color.MEDIUMPURPLE : Color

An immutable Color instance initialized to CSS color #9370DB

staticconstantSuperMap3D.Color.MEDIUMSEAGREEN : Color

An immutable Color instance initialized to CSS color #3CB371

staticconstantSuperMap3D.Color.MEDIUMSLATEBLUE : Color

An immutable Color instance initialized to CSS color #7B68EE

staticconstantSuperMap3D.Color.MEDIUMSPRINGGREEN : Color

An immutable Color instance initialized to CSS color #00FA9A

staticconstantSuperMap3D.Color.MEDIUMTURQUOISE : Color

An immutable Color instance initialized to CSS color #48D1CC

staticconstantSuperMap3D.Color.MEDIUMVIOLETRED : Color

An immutable Color instance initialized to CSS color #C71585

staticconstantSuperMap3D.Color.MIDNIGHTBLUE : Color

An immutable Color instance initialized to CSS color #191970

staticconstantSuperMap3D.Color.MINTCREAM : Color

An immutable Color instance initialized to CSS color #F5FFFA

staticconstantSuperMap3D.Color.MISTYROSE : Color

An immutable Color instance initialized to CSS color #FFE4E1

staticconstantSuperMap3D.Color.MOCCASIN : Color

An immutable Color instance initialized to CSS color #FFE4B5

staticconstantSuperMap3D.Color.NAVAJOWHITE : Color

An immutable Color instance initialized to CSS color #FFDEAD

staticconstantSuperMap3D.Color.NAVY : Color

An immutable Color instance initialized to CSS color #000080

staticconstantSuperMap3D.Color.OLDLACE : Color

An immutable Color instance initialized to CSS color #FDF5E6

staticconstantSuperMap3D.Color.OLIVE : Color

An immutable Color instance initialized to CSS color #808000

staticconstantSuperMap3D.Color.OLIVEDRAB : Color

An immutable Color instance initialized to CSS color #6B8E23

staticconstantSuperMap3D.Color.ORANGE : Color

An immutable Color instance initialized to CSS color #FFA500

staticconstantSuperMap3D.Color.ORANGERED : Color

An immutable Color instance initialized to CSS color #FF4500

staticconstantSuperMap3D.Color.ORCHID : Color

An immutable Color instance initialized to CSS color #DA70D6

staticSuperMap3D.Color.packedLength : Number

The number of elements used to pack the object into an array.

staticconstantSuperMap3D.Color.PALEGOLDENROD : Color

An immutable Color instance initialized to CSS color #EEE8AA

staticconstantSuperMap3D.Color.PALEGREEN : Color

An immutable Color instance initialized to CSS color #98FB98

staticconstantSuperMap3D.Color.PALETURQUOISE : Color

An immutable Color instance initialized to CSS color #AFEEEE

staticconstantSuperMap3D.Color.PALEVIOLETRED : Color

An immutable Color instance initialized to CSS color #DB7093

staticconstantSuperMap3D.Color.PAPAYAWHIP : Color

An immutable Color instance initialized to CSS color #FFEFD5

staticconstantSuperMap3D.Color.PEACHPUFF : Color

An immutable Color instance initialized to CSS color #FFDAB9

staticconstantSuperMap3D.Color.PERU : Color

An immutable Color instance initialized to CSS color #CD853F

staticconstantSuperMap3D.Color.PINK : Color

An immutable Color instance initialized to CSS color #FFC0CB

staticconstantSuperMap3D.Color.PLUM : Color

An immutable Color instance initialized to CSS color #DDA0DD

staticconstantSuperMap3D.Color.POWDERBLUE : Color

An immutable Color instance initialized to CSS color #B0E0E6

staticconstantSuperMap3D.Color.PURPLE : Color

An immutable Color instance initialized to CSS color #800080

staticconstantSuperMap3D.Color.RED : Color

An immutable Color instance initialized to CSS color #FF0000

staticconstantSuperMap3D.Color.ROSYBROWN : Color

An immutable Color instance initialized to CSS color #BC8F8F

staticconstantSuperMap3D.Color.ROYALBLUE : Color

An immutable Color instance initialized to CSS color #4169E1

staticconstantSuperMap3D.Color.SADDLEBROWN : Color

An immutable Color instance initialized to CSS color #8B4513

staticconstantSuperMap3D.Color.SALMON : Color

An immutable Color instance initialized to CSS color #FA8072

staticconstantSuperMap3D.Color.SANDYBROWN : Color

An immutable Color instance initialized to CSS color #F4A460

staticconstantSuperMap3D.Color.SEAGREEN : Color

An immutable Color instance initialized to CSS color #2E8B57

staticconstantSuperMap3D.Color.SEASHELL : Color

An immutable Color instance initialized to CSS color #FFF5EE

staticconstantSuperMap3D.Color.SIENNA : Color

An immutable Color instance initialized to CSS color #A0522D

staticconstantSuperMap3D.Color.SILVER : Color

An immutable Color instance initialized to CSS color #C0C0C0

staticconstantSuperMap3D.Color.SKYBLUE : Color

An immutable Color instance initialized to CSS color #87CEEB

staticconstantSuperMap3D.Color.SLATEBLUE : Color

An immutable Color instance initialized to CSS color #6A5ACD

staticconstantSuperMap3D.Color.SLATEGRAY : Color

An immutable Color instance initialized to CSS color #708090

staticconstantSuperMap3D.Color.SLATEGREY : Color

An immutable Color instance initialized to CSS color #708090

staticconstantSuperMap3D.Color.SNOW : Color

An immutable Color instance initialized to CSS color #FFFAFA

staticconstantSuperMap3D.Color.SPRINGGREEN : Color

An immutable Color instance initialized to CSS color #00FF7F

staticconstantSuperMap3D.Color.STEELBLUE : Color

An immutable Color instance initialized to CSS color #4682B4

staticconstantSuperMap3D.Color.TAN : Color

An immutable Color instance initialized to CSS color #D2B48C

staticconstantSuperMap3D.Color.TEAL : Color

An immutable Color instance initialized to CSS color #008080

staticconstantSuperMap3D.Color.THISTLE : Color

An immutable Color instance initialized to CSS color #D8BFD8

staticconstantSuperMap3D.Color.TOMATO : Color

An immutable Color instance initialized to CSS color #FF6347

staticconstantSuperMap3D.Color.TRANSPARENT : Color

An immutable Color instance initialized to CSS transparent.

staticconstantSuperMap3D.Color.TURQUOISE : Color

An immutable Color instance initialized to CSS color #40E0D0

staticconstantSuperMap3D.Color.VIOLET : Color

An immutable Color instance initialized to CSS color #EE82EE

staticconstantSuperMap3D.Color.WHEAT : Color

An immutable Color instance initialized to CSS color #F5DEB3

staticconstantSuperMap3D.Color.WHITE : Color

An immutable Color instance initialized to CSS color #FFFFFF

staticconstantSuperMap3D.Color.WHITESMOKE : Color

An immutable Color instance initialized to CSS color #F5F5F5

staticconstantSuperMap3D.Color.YELLOW : Color

An immutable Color instance initialized to CSS color #FFFF00

staticconstantSuperMap3D.Color.YELLOWGREEN : Color

An immutable Color instance initialized to CSS color #9ACD32

alpha : Number

The alpha component.
Default Value: 1.0

blue : Number

The blue component.
Default Value: 1.0

green : Number

The green component.
Default Value: 1.0

red : Number

The red component.
Default Value: 1.0

Methods

staticSuperMap3D.Color.add(left, right, result)Color

Computes the componentwise sum of two Colors.
Name Type Description
left Color The first Color.
right Color The second Color.
result Color The object onto which to store the result.
Returns:
The modified result parameter.

staticSuperMap3D.Color.byteToFloat(number)Number

Converts a 'byte' color component in the range of 0 to 255 into a 'float' color component in the range of 0 to 1.0.
Name Type Description
number Number The number to be converted.
Returns:
The converted number.

staticSuperMap3D.Color.clone(color, result)Color

Duplicates a Color.
Name Type Description
color Color The Color to duplicate.
result Color optional The object to store the result in, if undefined a new instance will be created.
Returns:
The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)

staticSuperMap3D.Color.divide(left, right, result)Color

Computes the componentwise quotient of two Colors.
Name Type Description
left Color The first Color.
right Color The second Color.
result Color The object onto which to store the result.
Returns:
The modified result parameter.

staticSuperMap3D.Color.divideByScalar(color, scalar, result)Color

Divides the provided Color componentwise by the provided scalar.
Name Type Description
color Color The Color to be divided.
scalar Number The scalar to divide with.
result Color The object onto which to store the result.
Returns:
The modified result parameter.

staticSuperMap3D.Color.equals(left, right)Boolean

Returns true if the first Color equals the second color.
Name Type Description
left Color The first Color to compare for equality.
right Color The second Color to compare for equality.
Returns:
true if the Colors are equal; otherwise, false.

staticSuperMap3D.Color.floatToByte(number)Number

Converts a 'float' color component in the range of 0 to 1.0 into a 'byte' color component in the range of 0 to 255.
Name Type Description
number Number The number to be converted.
Returns:
The converted number.

staticSuperMap3D.Color.fromAlpha(color, alpha, result)Color

Creates a new Color that has the same red, green, and blue components of the specified color, but with the specified alpha value.
Name Type Description
color Color The base color
alpha Number The new alpha component.
result Color optional The object onto which to store the result.
Returns:
The modified result parameter or a new Color instance if one was not provided.
Example:
var translucentRed = SuperMap3D.Color.fromAlpha(SuperMap3D.Color.RED, 0.9);

staticSuperMap3D.Color.fromBytes(red, green, blue, alpha, result)Color

Creates a new Color specified using red, green, blue, and alpha values that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.
Name Type Default Description
red Number 255 optional The red component.
green Number 255 optional The green component.
blue Number 255 optional The blue component.
alpha Number 255 optional The alpha component.
result Color optional The object onto which to store the result.
Returns:
The modified result parameter or a new Color instance if one was not provided.

staticSuperMap3D.Color.fromCartesian4(cartesian, result)Color

Creates a Color instance from a Cartesian4. x, y, z, and w map to red, green, blue, and alpha, respectively.
Name Type Description
cartesian Cartesian4 The source cartesian.
result Color optional The object onto which to store the result.
Returns:
The modified result parameter or a new Color instance if one was not provided.

staticSuperMap3D.Color.fromCssColorString(color, result)Color

Creates a Color instance from a CSS color value.
Name Type Description
color String The CSS color value in #rgb, #rrggbb, rgb(), rgba(), hsl(), or hsla() format.
result Color optional The object to store the result in, if undefined a new instance will be created.
Returns:
The color object, or undefined if the string was not a valid CSS color.
Example:
var cesiumBlue = SuperMap3D.Color.fromCssColorString('#67ADDF');
var green = SuperMap3D.Color.fromCssColorString('green');
See:

staticSuperMap3D.Color.fromHsl(hue, saturation, lightness, alpha, result)Color

Creates a Color instance from hue, saturation, and lightness.
Name Type Default Description
hue Number 0 optional The hue angle 0...1
saturation Number 0 optional The saturation value 0...1
lightness Number 0 optional The lightness value 0...1
alpha Number 1.0 optional The alpha component 0...1
result Color optional The object to store the result in, if undefined a new instance will be created.
Returns:
The color object.
See:

staticSuperMap3D.Color.fromRandom(options, result)Color

Creates a random color using the provided options. For reproducible random colors, you should call Math#setRandomNumberSeed once at the beginning of your application.
Name Type Description
options Object optional Object with the following properties:
Name Type Default Description
red Number optional If specified, the red component to use instead of a randomized value.
minimumRed Number 0.0 optional The maximum red value to generate if none was specified.
maximumRed Number 1.0 optional The minimum red value to generate if none was specified.
green Number optional If specified, the green component to use instead of a randomized value.
minimumGreen Number 0.0 optional The maximum green value to generate if none was specified.
maximumGreen Number 1.0 optional The minimum green value to generate if none was specified.
blue Number optional If specified, the blue component to use instead of a randomized value.
minimumBlue Number 0.0 optional The maximum blue value to generate if none was specified.
maximumBlue Number 1.0 optional The minimum blue value to generate if none was specified.
alpha Number optional If specified, the alpha component to use instead of a randomized value.
minimumAlpha Number 0.0 optional The maximum alpha value to generate if none was specified.
maximumAlpha Number 1.0 optional The minimum alpha value to generate if none was specified.
result Color optional The object to store the result in, if undefined a new instance will be created.
Returns:
The modified result parameter or a new instance if result was undefined.
Throws:
  • DeveloperError : minimumRed must be less than or equal to maximumRed.
  • DeveloperError : minimumGreen must be less than or equal to maximumGreen.
  • DeveloperError : minimumBlue must be less than or equal to maximumBlue.
  • DeveloperError : minimumAlpha must be less than or equal to maximumAlpha.
Example:
//Create a completely random color
var color = SuperMap3D.Color.fromRandom();

//Create a random shade of yellow.
var color = SuperMap3D.Color.fromRandom({
    red : 1.0,
    green : 1.0,
    alpha : 1.0
});

//Create a random bright color.
var color = SuperMap3D.Color.fromRandom({
    minimumRed : 0.75,
    minimumGreen : 0.75,
    minimumBlue : 0.75,
    alpha : 1.0
});

staticSuperMap3D.Color.fromRgba(rgba, result)Color

Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness of the system.
Name Type Description
rgba Number A single numeric unsigned 32-bit RGBA value.
result Color optional The object to store the result in, if undefined a new instance will be created.
Returns:
The color object.
Example:
var color = SuperMap3D.Color.fromRgba(0x67ADDFFF);
See:

staticSuperMap3D.Color.mod(left, right, result)Color

Computes the componentwise modulus of two Colors.
Name Type Description
left Color The first Color.
right Color The second Color.
result Color The object onto which to store the result.
Returns:
The modified result parameter.

staticSuperMap3D.Color.multiply(left, right, result)Color

Computes the componentwise product of two Colors.
Name Type Description
left Color The first Color.
right Color The second Color.
result Color The object onto which to store the result.
Returns:
The modified result parameter.

staticSuperMap3D.Color.multiplyByScalar(color, scalar, result)Color

Multiplies the provided Color componentwise by the provided scalar.
Name Type Description
color Color The Color to be scaled.
scalar Number The scalar to multiply with.
result Color The object onto which to store the result.
Returns:
The modified result parameter.

staticSuperMap3D.Color.pack(value, array, startingIndex)Array.<Number>

Stores the provided instance into the provided array.
Name Type Default Description
value Color The value to pack.
array Array.<Number> The array to pack into.
startingIndex Number 0 optional The index into the array at which to start packing the elements.
Returns:
The array that was packed into

staticSuperMap3D.Color.subtract(left, right, result)Color

Computes the componentwise difference of two Colors.
Name Type Description
left Color The first Color.
right Color The second Color.
result Color The object onto which to store the result.
Returns:
The modified result parameter.

staticSuperMap3D.Color.unpack(array, startingIndex, result)Color

Retrieves an instance from a packed array.
Name Type Default Description
array Array.<Number> The packed array.
startingIndex Number 0 optional The starting index of the element to be unpacked.
result Color optional The object into which to store the result.
Returns:
The modified result parameter or a new Color instance if one was not provided.

brighten(magnitude, result)Color

Brightens this color by the provided magnitude.
Name Type Description
magnitude Number A positive number indicating the amount to brighten.
result Color The object onto which to store the result.
Returns:
The modified result parameter.
Example:
var brightBlue = SuperMap3D.Color.BLUE.brighten(0.5, new SuperMap3D.Color());

clone(result)Color

Returns a duplicate of a Color instance.
Name Type Description
result Color optional The object to store the result in, if undefined a new instance will be created.
Returns:
The modified result parameter or a new instance if result was undefined.

darken(magnitude, result)Color

Darkens this color by the provided magnitude.
Name Type Description
magnitude Number A positive number indicating the amount to darken.
result Color The object onto which to store the result.
Returns:
The modified result parameter.
Example:
var darkBlue = SuperMap3D.Color.BLUE.darken(0.5, new SuperMap3D.Color());

equals(other)Boolean

Returns true if this Color equals other.
Name Type Description
other Color The Color to compare for equality.
Returns:
true if the Colors are equal; otherwise, false.

equalsEpsilon(other, epsilon)Boolean

Returns true if this Color equals other componentwise within the specified epsilon.
Name Type Default Description
other Color The Color to compare for equality.
epsilon Number 0.0 optional The epsilon to use for equality testing.
Returns:
true if the Colors are equal within the specified epsilon; otherwise, false.

toBytes(result)Array.<Number>

Converts this color to an array of red, green, blue, and alpha values that are in the range of 0 to 255.
Name Type Description
result Array.<Number> optional The array to store the result in, if undefined a new instance will be created.
Returns:
The modified result parameter or a new instance if result was undefined.

toCssColorString()String

Creates a string containing the CSS color value for this color.
Returns:
The CSS equivalent of this color.
See:

toRgba()Number

Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness of the system.
Returns:
A single numeric unsigned 32-bit RGBA value.
Example:
var rgba = SuperMap3D.Color.BLUE.toRgba();
See:

toString()String

Creates a string representing this Color in the format '(red, green, blue, alpha)'.
Returns:
A string representing this Color in the format '(red, green, blue, alpha)'.

withAlpha(alpha, result)Color

Creates a new Color that has the same red, green, and blue components as this Color, but with the specified alpha value.
Name Type Description
alpha Number The new alpha component.
result Color optional The object onto which to store the result.
Returns:
The modified result parameter or a new Color instance if one was not provided.
Example:
var translucentRed = SuperMap3D.Color.RED.withAlpha(0.9);