Re:Common color mistakes and how to avoid them
by tripu on Monday September 14, 2020 @07:04AM
(#24468788)
For use cases where one truly needs to put aesthetics and accessibility aside, and instead squeeze the gamut of possible colours to the max (eg, because one has to assign distinctive colours to dozens or hundreds of elements), I have a JS library which includes a method for that:
// We have a viz with 50 items; let's assign colours to those items:
import { palette } from 'supers';
const colours = new palette(50);
for (let i = 0; i < 50; i ++)
chart[i].css('color', '#' + colours.get(i, true));
Documentation: https://github.com/tripu/superscript/blob/master/.github/REA...