Methods

new Color()

construct function

Methods

static

fromArgb(argb) → Color

Creates a Color object from a 32-bit ARGB value.

Parameter

Name Type Optional Description

argb

Number

 

A value specifying the 32-bit ARGB value.

Returns

Color The Color object that this method creates.

static

fromArgb(red, green, blue) → Color

Creates a Color object from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque). Although this method allows a 32-bit value to be passed for each color component, the value of each component is limited to 8 bits.

Parameters

Name Type Optional Description

red

Number

 

The red component value for the new Color object. Valid values are 0 through 255.

green

Number

 

The green component value for the new Color object. Valid values are 0 through 255.

blue

Number

 

The blue component value for the new Color object. Valid values are 0 through 255.

Returns

Color The Color object that this method creates.

static

fromArgb(alpha, red, green, blue) → Color

Creates a Color object from the four ARGB component (alpha,red, green, and blue) values. Although this method allows a 32-bit value to be passed for each component, the value of each component is limited to 8 bits.

Parameters

Name Type Optional Description

alpha

Number

 

The alpha component. Valid values are 0 through 255.

red

Number

 

The red component. Valid values are 0 through 255.

green

Number

 

The green component. Valid values are 0 through 255.

blue

Number

 

The blue component. Valid values are 0 through 255.

Returns

Color The Color object that this method creates.

static

getAliceBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getAntiqueWhite() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getAqua() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getAquamarine() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getAzure() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getBeige() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getBisque() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getBlack() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getBlanchedAlmond() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getBlueViolet() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getBrown() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getBurlyWood() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getCadetBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getChartreuse() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getChocolate() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getCoral() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getCornflowerBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getCornsilk() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getCrimson() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getCyan() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkCyan() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkGoldenrod() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkGray() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkKhaki() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkMagenta() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkOliveGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkOrange() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkOrchid() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkRed() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkSalmon() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkSeaGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkSlateBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkSlateGray() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkTurquoise() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDarkViolet() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDeepPink() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDeepSkyBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDimGray() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getDodgerBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getEmpty() → Color

Get a system-defined empty color.

Returns

Color A Color object representing a system-defined color.

static

getFirebrick() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getFloralWhite() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getForestGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getFuchsia() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getGainsboro() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getGhostWhite() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getGold() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getGoldenrod() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getGray() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getGreenYellow() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getHoneydew() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getHotPink() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getIndianRed() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getIndigo() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getIvory() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getKhaki() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLavender() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLavenderBlush() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLawnGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLemonChiffon() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightCoral() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightCyan() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightGoldenrodYellow() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightGray() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightPink() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightSalmon() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightSeaGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightSkyBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightSlateGray() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightSteelBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLightYellow() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLime() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLimeGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getLinen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMagenta() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMaroon() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMediumAquamarine() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMediumBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMediumOrchid() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMediumPurple() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMediumSeaGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMediumSlateBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMediumSpringGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMediumTurquoise() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMediumVioletRed() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMidnightBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMintCream() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMistyRose() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getMoccasin() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getNavajoWhite() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getNavy() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getOldLace() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getOlive() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getOliveDrab() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getOrange() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getOrangeRed() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getOrchid() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getPaleGoldenrod() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getPaleGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getPaleTurquoise() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getPaleVioletRed() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getPapayaWhip() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getPeachPuff() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getPeru() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getPink() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getPlum() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getPowderBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getPurple() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getRed() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getRosyBrown() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getRoyalBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSaddleBrown() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSalmon() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSandyBrown() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSeaGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSeaShell() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSienna() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSilver() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSkyBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSlateBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSlateGray() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSnow() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSpringGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getSteelBlue() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getTan() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getTeal() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getThistle() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getTomato() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getTransparent() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getTurquoise() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getViolet() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getWheat() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getWhite() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getWhiteSmoke() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getYellow() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

static

getYellowGreen() → Color

Get a system-defined color.

Returns

Color A Color object representing a system-defined color.

equals(obj) → boolean

Tests whether the specified object is a Color object and is equivalent to this object.

Parameter

Name Type Optional Description

obj

Object

 

The object to test.

Returns

boolean true if obj is a Color object and equivalent to this Color object; otherwise, false.

getA() → byte

Gets the alpha component value of this Color object.

Returns

byte The alpha component value of this Color object.

getB() → byte

Gets the blue component value of this Color object.

Returns

byte The blue component value of this Color object.

getG() → byte

Gets the green component value of this Color object.

Returns

byte The green component value of this Color object.

getR() → byte

Gets the red component value of this Color object.

Returns

byte The red component value of this Color object.

hashCode() → Number

Returns a hash code for this Color object.

Returns

Number An integer value that specifies the hash code for this Color object.

isEmpty() → boolean

Specifies whether this Color object is uninitialized.

Returns

boolean This property returns true if this color is uninitialized; otherwise, false.

toArgb() → Number

Gets the 32-bit ARGB value of this Color object.

Returns

Number The 32-bit ARGB value of this Color object.