itemLook

An item's look as the scene's key draws it, for whatever else shows the item's colour — a tooltip's card. The colour is a VALUE, never CSS: the item's own look where a map gave it one, else the first colour the mark's colour: names, else the mark's fallback.

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

The one place a mark's colour becomes a swatch, so every environment's cards and the key agree. Pass the CSS a mark paints with and the swatch loses the hue's steps; pass this.

#Signature

(
    colour: unknown,
    name: string | null | undefined,
    fallback: unknown,
    form?: Omit<KeyLook, "colour">,
): KeyLook

#Parameters

colour
The mark's colour attribute value, its group's hue already filled in.
name
The item's own look, from its ItemColours.names, where a map gave it one.
fallback
The colour value drawn where neither says — the mark's declared default.
form
The key's form for the kind of mark: { shape: 'square' } for a bar, a marker for a shaped dot, a stroke for a line.

#Example

const painted = blendedItemColours(attrs.colour, transition, count, source, params, ink);
const look = itemLook(attrs.colour, painted.names[i], 'teal', { shape: 'square' });

Declared in packages/canvas-sdk/src/data/item-looks.ts:241.

Last updated