---
url: /hooks/filters/wpce-colors.md
description: >-
  Define the colors available to WPCE color inputs with IDs, labels, hex values,
  and optional alpha values.
---

# `wpce_colors`&#x20;

Filters the colors available to the WPCE [`color` input type](../../documentation/input-types/color).

## Parameters

1. `object[] $colors`

   The available colors.

## Example

```php
add_filter('wpce_colors', function (array $colors) {
	$colors[] = (object) [
		'id' => 'primary',
		'label' => 'Primärfarbe',
		'hex' => '#3190cf',
	];
	$colors[] = (object) [
		'id' => 'text-default',
		'label' => 'Textfarbe',
		'hex' => '#222222',
	];
	$colors[] = (object) [
		'id' => 'text-highlighted',
		'label' => 'Hervorgehoben',
		'hex' => '#ffff00',
		'alpha' => 0.5,
	];

	return $colors;
});
```
