Easily generate patterns for use in data graphics.
Color-blindness, that's why.
This library came about as part of an issue in Chart.js.
npm install patternomaly
Generate a single canvas pattern
Generate an array of canvas patterns
pattern.generate([ '#1f77b4', '#ff7f0e', '#2ca02c', '#d62728' ]);
Providing a Pattern Alternative
In order to provide an alternative view for visually impaired viewers it's a good idea to provide a patterned alternative.
See the pattern option example page for a simple implementation of a pattern toggle switch for Chart.js.