# Google Cloud Retail V2 Client - Class ColorInfo (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.1 2.2.1 2.1.3 2.0.0 1.7.0 1.6.4 1.5.0 1.4.2 1.3.1 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Retail V2 Client class ColorInfo.

The color information of a [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product).

Generated from protobuf message `google.cloud.retail.v2.ColorInfo`

## Namespace

Google \\ Cloud \\ Retail \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ color_families` | `string[]` The standard color families. Strongly recommended to use the following standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and "Mixed". Normally it is expected to have only 1 color family. May consider using single "Mixed" instead of multiple values. A maximum of 5 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property [color](https://support.google.com/merchants/answer/6324487). Schema.org property [Product.color](https://schema.org/color). The colorFamilies field as a system attribute is not a required field but strongly recommended to be specified. Google Search models treat this field as more important than a custom product attribute when specified. |
| `↳ colors` | `string[]` The color display names, which may be different from standard color family names, such as the color aliases used in the website frontend. Normally it is expected to have only 1 color. May consider using single "Mixed" instead of multiple values. A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property [color](https://support.google.com/merchants/answer/6324487). Schema.org property [Product.color](https://schema.org/color). |

### getColorFamilies

The standard color families. Strongly recommended to use the following
standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
"Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and "Mixed".

Normally it is expected to have only 1 color family. May consider using
single "Mixed" instead of multiple values.
A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
string with a length limit of 128 characters. Otherwise, an
INVALID_ARGUMENT error is returned.
Google Merchant Center property
[color](https://support.google.com/merchants/answer/6324487). Schema.org
property [Product.color](https://schema.org/color).
The colorFamilies field as a system attribute is not a required field but
strongly recommended to be specified. Google Search models treat this field
as more important than a custom product attribute when specified.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setColorFamilies

The standard color families. Strongly recommended to use the following
standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
"Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and "Mixed".

Normally it is expected to have only 1 color family. May consider using
single "Mixed" instead of multiple values.
A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
string with a length limit of 128 characters. Otherwise, an
INVALID_ARGUMENT error is returned.
Google Merchant Center property
[color](https://support.google.com/merchants/answer/6324487). Schema.org
property [Product.color](https://schema.org/color).
The colorFamilies field as a system attribute is not a required field but
strongly recommended to be specified. Google Search models treat this field
as more important than a custom product attribute when specified.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

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

### getColors

The color display names, which may be different from standard color family
names, such as the color aliases used in the website frontend. Normally
it is expected to have only 1 color. May consider using single "Mixed"
instead of multiple values.

A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded
string with a length limit of 128 characters. Otherwise, an
INVALID_ARGUMENT error is returned.
Google Merchant Center property
[color](https://support.google.com/merchants/answer/6324487). Schema.org
property [Product.color](https://schema.org/color).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setColors

The color display names, which may be different from standard color family
names, such as the color aliases used in the website frontend. Normally
it is expected to have only 1 color. May consider using single "Mixed"
instead of multiple values.

A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded
string with a length limit of 128 characters. Otherwise, an
INVALID_ARGUMENT error is returned.
Google Merchant Center property
[color](https://support.google.com/merchants/answer/6324487). Schema.org
property [Product.color](https://schema.org/color).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

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