---
url: /api/plugins/pantoken/custom-theme-colors/src/functions/customColorCss.md
---
[pantoken-root](../../../../../index.md) / [plugins/pantoken/custom-theme-colors/src](../index.md) / customColorCss

# Function: customColorCss()

> **customColorCss**(`hex`, `options?`): `string`

Beta

Generate the `[data-pantoken-color="custom"]` rule for a brand hex: it declares the derived
`--instui-primitive-color-custom-custom*` steps and remaps the brand primitives onto them, exactly
like the shipped scales.

## Parameters

### hex

`string`

A `#rgb`/`#rrggbb` brand color.

### options?

[`CustomColorCssOptions`](../interfaces/CustomColorCssOptions.md) = `{}`

[CustomColorCssOptions](../interfaces/CustomColorCssOptions.md).

## Returns

`string`

The CSS rule.

## Throws

TypeError when `hex` isn't a valid hex color.
