Skip to content

get_theme_color

Get a hex color value from a color token based on the active theme.

Parameters:

Name Type Description Default
token str

Color token name (e.g., "primary", "background").

required

Returns:

Type Description
str

Hex color string (e.g., "#007bff").

Raises:

Type Description
ValueError

If the color token is invalid.

Examples:

>>> primary = get_theme_color("primary")
>>> print(primary)  # "#007bff"