Constructor
new Color(red, green, blue, alpha)
Parameters:
| Name | Type | Description |
|---|---|---|
red |
int | a number beetween 0 and 255 to define the red component of color. |
green |
int | a number beetween 0 and 255 to define the green component of color. |
blue |
int | a number beetween 0 and 255 to define the blue component of color. |
alpha |
float | a number between 0 and 1 to define the opacity (alpha) channel of color. 1 to full opacity and 0 to full transparency. |
- Source:
Members
(protected) a :int
Type:
- int
- Source:
(protected) b :int
Type:
- int
- Source:
(protected) g :int
Type:
- int
- Source:
(protected) r :int
Type:
- int
- Source:
Methods
getAlpha() → {int}
Return the opaticy (alpha) channel of color.
- Source:
Returns:
Return the alpha channel of color.
- Type
- int
getBlue() → {int}
Return the blue component of color.
- Source:
Returns:
Return the blue component of color.
- Type
- int
getGreen() → {int}
Return the green component of color.
- Source:
Returns:
Return the green component of color.
- Type
- int
getHex() → {array}
Return an hex string composed by red, green and blue components of color.
- Source:
Returns:
Return an hex string composed by red, green and blue components of color.
- Type
- array
getRed() → {int}
Return the red component of color.
- Source:
Returns:
Return the red component of color.
- Type
- int
getRgbaArray() → {array}
Return an array composed by red, green, blue and alpha components of color.
- Source:
Returns:
Return an array composed by red, green, blue and alpha components of color.
- Type
- array
getRgbArray() → {array}
Return an array composed by red, green and blue components of color.
- Source:
Returns:
Return an array composed by red, green and blue components of color.
- Type
- array
setAlpha(alpha) → {bemap.Color}
Set the opacity (alpha) channel of color, a number beetween 0 and 255.
Parameters:
| Name | Type | Description |
|---|---|---|
alpha |
int | a number beetween 0 and 1 to define the opacity (alpha) channel of color. |
- Source:
Returns:
Return this.
- Type
- bemap.Color
setBlue(blue) → {bemap.Color}
Set the blue component of color, a number beetween 0 and 255.
Parameters:
| Name | Type | Description |
|---|---|---|
blue |
int | a number beetween 0 and 255 to define the blue component of color. |
- Source:
Returns:
Return this.
- Type
- bemap.Color
setGreen(green) → {bemap.Color}
Set the green component of color, a number beetween 0 and 255.
Parameters:
| Name | Type | Description |
|---|---|---|
green |
int | a number beetween 0 and 255 to define the green component of color. |
- Source:
Returns:
Return this.
- Type
- bemap.Color
setRed(red) → {bemap.Color}
Set the red component of color, a number beetween 0 and 255.
Parameters:
| Name | Type | Description |
|---|---|---|
red |
int | a number beetween 0 and 255 to define the red component of color. |
- Source:
Returns:
Return this.
- Type
- bemap.Color