effect-motion
API Referenceeffect-motionNamespacesColorFunctions

tw

function tw(

Function: tw()

function tw(
   color,
   shade?,
   alpha?): Color;

Defined in: packages/motion/src/Color.ts:828

A color from the Tailwind palette.

Parameters

ParameterTypeDefault valueDescription
color| "blue" | "cyan" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "olive" | "orange" | "pink" | "purple" | "red" | "teal" | "violet" | "yellow" | "slate" | "zinc" | "neutral" | "stone" | "mauve" | "mist" | "taupe" | "amber" | "emerald" | "sky" | "rose"undefinedPalette name, e.g. "violet".
shade| "50" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | "950""400"Lightness step, "50" (lightest) to "950" (darkest).
alphanumber1Opacity, 0–1.

Returns

Color

Remarks

A ready-made, perceptually even set of hues — handy for getting a scene looking coherent without hand-picking values.

Default Value

shade — "400"; alpha — 1

Example

Color.tw("violet", "500")

On this page