Memoised colour lookup. A frame asks for the same handful of strings a few thousand times, and a heatmap plot asks for a fresh rgba() string per bar, so the map is bounded: past the limit it is cleared rather than trimmed, because the strings that matter are re-asked on the next frame anyway.

Constructors

Accessors

Methods

Constructors

Accessors

Methods

  • The premultiplied colour for css. normalise is consulted only on a parse failure, and only once per string. A string neither can read is transparent: that is a colour nothing can blend with, so the bar it was meant for is visibly absent rather than painted in a neighbour's colour, which is what a 2D context's silently kept fillStyle would do.

    Parameters

    • css: string
    • Optionalnormalise: (css: string) => null | string

    Returns PremultipliedRgba