colourValue

Refines a paint attribute value, storing it in its canonical spelling or refusing it with a message listing the colours allowed.

@internote/canvas-sdkFunction
On this page
import { colourValue } from '@internote/canvas-sdk';

Accepts every name in COLOUR_NAMES and the hex(…) and rgb(…) literals. What reads an animatable colour, which reaches the refiners as text; a colour the compiler typed arrives already checked.

#Signature

(input: string): RefineResult

#Parameters

input
The value as written.

Declared in packages/canvas-sdk/src/refine/value-refiners.ts:612.

Last updated