# ui/colorpicker/utils

module

<a id="type-definitions">

## Type Definitions

<a id="typedef-ColorPickerConfig">

### `ColorPickerConfig`

<a id="typedef-ColorPickerOutputFormat">

### `ColorPickerOutputFormat`

<a id="typedef-ColorPickerViewConfig">

### `ColorPickerViewConfig`

<a id="functions">

## Functions

<a id="function-convertColor">

### `convertColor( color, outputFormat ) → string` _(internal)_

Parses and converts the color string to requested format. Handles variety of color spaces like `hsl`, `hex` or `rgb`.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ui/src/colorpicker/utils.ts#L51)

#### Parameters

* `color: string`
* `outputFormat: ColorPickerOutputFormat`

#### Returns

* `string`

  A color string.

<a id="function-convertToHex">

### `convertToHex( color ) → string` _(internal)_

Converts a color string to hex format.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ui/src/colorpicker/utils.ts#L89)

#### Parameters

* `color: string`

#### Returns

* `string`

  A color string.

<a id="function-registerCustomElement">

### `registerCustomElement( elementName, constructor ) → void` _(internal)_

Registers the custom element in the [CustomElementsRegistry](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ui/src/colorpicker/utils.ts#L112)

#### Parameters

* `elementName: string`
* `constructor: CustomElementConstructor`

#### Returns

* `void`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
