parseColour

Parses a colour attribute value such as light-blue or hex(0064FA) into a Colour, or returns null if it is not a colour.

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

Takes unknown because what reaches it is an attribute value, which may be an unresolved keyframe track. Anything that is not a colour is not a colour, and says so by returning null rather than by throwing.

#Signature

(value: unknown, { tones }?: ColourVocabulary): Colour | null

#Parameters

value
A colour attribute value.
options
Whether the toned names and neutral are admitted.

Declared in packages/canvas-sdk/src/paint/colour.ts:420.

Last updated