useTextColor

Commons
stable

Foreground-only color helper. Resolves the `color` prop to a utility class (`origam--color-*`) for tokenised intents, or to an inline `color:` declaration for raw CSS values and gradients.

API

Signature

Full TypeScript signature sourced from the composable file.

typescript

Consumed interfaces

IColorProps

API

Parameters

Input parameters accepted by this composable.

props
required
T | Ref<TColor>
Either the component props object (paired with `name`) or a plain Ref<TColor>.
name
K
The key to read from the props object. Typically "color". Omit when passing a plain Ref.

API

Return values

Properties and methods exposed by the composable return object.

textColorClasses
Utility class names (e.g. ["origam--color-primary"]) to bind via :class.
textColorStyles
Inline CSS declarations (e.g. ["color: #6d28d9"]) to bind via :style. For gradients, includes background-image + background-clip: text.

Usage

Examples

Ready-to-paste usage snippets.

Color an icon with an intent

vue