color
Color constants, type guards, and TypeScript types for Mantle's color system. Useful for building components that accept a color prop constrained to Mantle's palette.
Color categories
Mantle has two categories of colors:
Named colors, the 18 palette colors:
Functional colors, semantic role-based colors:
Constants
namedColors
Read-only array of all named colors.
functionalColors
Read-only array of all functional colors.
colors
Read-only array of all colors (named + functional).
Type guards
isNamedColor(value)
Returns true if value is a named color string.
isFunctionalColor(value)
Returns true if value is a functional color string.
isColor(value)
Returns true if value is any Mantle color (named or functional).