Colour
The colour vocabulary an author writes and a surface resolves: hues and their tones, the ramps, the surface paints, and the CSS each becomes.
@internote/canvas-sdkOn this page
Authors write colours by name (blue, light-blue, dark-blue, neutral) or as literals (hex(0064FA), rgb(0, 100, 250)). Named colours follow the reader's light or dark theme; literals are drawn exactly as written.
To use a colour an author wrote:
colourCssconverts it to a CSS colour for afillorstroke.blendedColourCssdoes the same, blending while a!cue.tocolour change is under way.parseColourparses it, if you need its hue and tone separately.
To give one of your attributes the language's colour type, use colourTypeSpec, or colourTypeWith to narrow or extend it.
Heatmaps and contours colour a range of values rather than a single mark. surfacePaintOf reads their colour, which may also be multicolour or temperature, and surfacePaintAt gives the paint at any point in the range.