# Class: Color

## bemap.Color(red, green, blue, alpha)

Base class for Color.

## 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:
  - bemap-model/bemap-color.js, line 15

### Members

#### (protected) a :int

##### Type:

- int

Source:
  - bemap-model/bemap-color.js, line 39

#### (protected) b :int

##### Type:

- int

Source:
  - bemap-model/bemap-color.js, line 33

#### (protected) g :int

##### Type:

- int

Source:
  - bemap-model/bemap-color.js, line 27

#### (protected) r :int

##### Type:

- int

Source:
  - bemap-model/bemap-color.js, line 21

### Methods

#### getAlpha() → {int}

Return the opaticy (alpha) channel of color.

Source:
  - bemap-model/bemap-color.js, line 146

##### Returns:

Return the alpha channel of color.

Type
  int

#### getBlue() → {int}

Return the blue component of color.

Source:
  - bemap-model/bemap-color.js, line 126

##### Returns:

Return the blue component of color.

Type
  int

#### getGreen() → {int}

Return the green component of color.

Source:
  - bemap-model/bemap-color.js, line 106

##### 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:
  - bemap-model/bemap-color.js, line 59

##### 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:
  - bemap-model/bemap-color.js, line 86

##### 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:
  - bemap-model/bemap-color.js, line 77

##### 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:
  - bemap-model/bemap-color.js, line 68

##### 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:
  - bemap-model/bemap-color.js, line 156

##### 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:
  - bemap-model/bemap-color.js, line 136

##### 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:
  - bemap-model/bemap-color.js, line 116

##### 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:
  - bemap-model/bemap-color.js, line 96

##### Returns:

Return this.

Type
  bemap.Color