---
description: Talks about the colorHelper class
---

# ColorHelper

## ColorHelper

This class provides helper methods for working with colors.

### Methods

#### `getColor(int red, int green, int blue)`

Returns a color as an integer value given its red, green and blue components.

| Parameter | Description                      |
| --------- | -------------------------------- |
| `red`     | The red component of the color   |
| `green`   | The green component of the color |
| `blue`    | The blue component of the color  |

**Returns:** The color as an integer value.

#### `getColor(int red, int green, int blue, int alpha)`

Returns a color as an integer value given its red, green, blue and alpha components.

<table><thead><tr><th width="349">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>red</code></td><td>The red component of the color</td></tr><tr><td><code>green</code></td><td>The green component of the color</td></tr><tr><td><code>blue</code></td><td>The blue component of the color</td></tr><tr><td><code>alpha</code></td><td>The alpha component of the color</td></tr></tbody></table>

**Returns:** The color as an integer value.

#### `getColorFromInt(int color)`

Converts an integer value to a `Color` object.

| Parameter | Description                              |
| --------- | ---------------------------------------- |
| `color`   | The integer value representing the color |

**Returns:** A `Color` object representing the given integer value.

#### `getColorFromHue(float hue)`

Returns a color as an integer value given its hue.

| Parameter | Description          |
| --------- | -------------------- |
| `hue`     | The hue of the color |

**Returns:** The color as an integer value.

#### `ColorToInt(Color color)`

Converts a `Color` object to an integer value.

| Parameter | Description                   |
| --------- | ----------------------------- |
| `color`   | The `Color` object to convert |

**Returns:** The integer representation of the given `Color` object.
