> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ghost.org/llms.txt
> Use this file to discover all available pages before exploring further.

# contrast_text_color

> Usage: `{{contrast_text_color color}}`

***

The `{{contrast_text_color}}` helper returns a high-contrast text color for a given background color.

Use it when your theme supports configurable brand or accent colors and you need readable text on top of them.

## Example Code

```handlebars theme={"dark"}
<button
    style="background: {{@site.accent_color}}; color: {{contrast_text_color @site.accent_color}};"
>
    Subscribe
</button>
```

For a dark background such as `#15171A`, the helper outputs:

```css theme={"dark"}
#FFFFFF
```

For a light background such as `#FFFFFF`, the helper outputs:

```css theme={"dark"}
#000000
```

## Notes

* Helps keep text readable on dynamic background colors
* Works well with `@site.accent_color`
* Falls back to `#FFFFFF` if the color is invalid or missing
