# Cloud Vision V1 Client - Class ColorInfo (2.2.1)

2.2.1 (latest) 2.2.0 2.1.3 2.0.3 1.10.3 1.9.4 1.8.0 1.7.6 1.6.8 Reference documentation and code samples for the Cloud Vision V1 Client class ColorInfo.

Color information consists of RGB channels, score, and the fraction of
the image that the color occupies in the image.

Generated from protobuf message `google.cloud.vision.v1.ColorInfo`

## Namespace

Google \\ Cloud \\ Vision \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ color` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Color.html` RGB components of the color. |
| `↳ score` | `float` Image-specific score for this color. Value in range \[0, 1\]. |
| `↳ pixel_fraction` | `float` The fraction of pixels the color occupies in the image. Value in range \[0, 1\]. |

### getColor

RGB components of the color.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Color.html|null` |   |

### hasColor

### clearColor

### setColor

RGB components of the color.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Color.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getScore

Image-specific score for this color. Value in range \[0, 1\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setScore

Image-specific score for this color. Value in range \[0, 1\].

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPixelFraction

The fraction of pixels the color occupies in the image.

Value in range \[0, 1\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setPixelFraction

The fraction of pixels the color occupies in the image.

Value in range \[0, 1\].

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |