effect-motion
API Referenceeffect-motionNamespacesColorFunctions

hex

function hex(value): Color;

Function: hex()

function hex(value): Color;

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

Parse a CSS color string — the most convenient constructor.

Parameters

ParameterTypeDescription
valuestringA CSS color string.

Returns

Color

Remarks

Accepts everything CSS does: #rgb, #rrggbb, #rrggbbaa, named colors like "rebeccapurple", and functional forms like rgb() / hsl().

Example

Color.hex("#7f5af0")

On this page