Skip to content

PatternCode ​

Experimental

Interfaces ​

InterfaceDescription
ResolvedPatternPer-item pattern buffers (4 floats per item each), as uploaded to PATTERN_ATTRIBUTES.

Variables ​

VariableDescription
PATTERN_ATTRIBUTESPattern attributes (per instance, or per vertex for fills), 4 floats each.

Functions ​

FunctionDescription
contrastOfPlotly's Color.contrast: white over dark colors, #444 over light ones (translucent colors are composited over background first: white in Plotly).
patternShadersource (a rect, arc or fill shader) with the pattern code in at its hooks.
resolvePatternResolve fill for count items (see PatternFill).
writeInstancePatternUpload fill resolved for the count instances of an instanced rect or arc mesh (its iFill attribute gives the capacity) and switch it to the pattern shaders.

Released under the MIT License.