rainbow_vis 0.0.1 rainbow_vis: ^0.0.1 copied to clipboard
Color data visualization; easily map numbers to a smooth-transitioning color legend.
rainbowvis-dart #
Color data visualization; easily map numbers to a smooth-transitioning color legend. This is a port of the RainbowVis-JS written by anomal.
Usage #
Instantiate a Rainbow, e.g.
Rainbow rb0 = new Rainbow(); //[0,100],red-yellow-green-blue
Rainbow rb1 = new Rainbow(minNum:-10, maxNum: 10);
Rainbow rb2 = new Rainbow.fromArray(['red', 'FFFFFF', '#00ff00']);
Rainbow rb3 = new Rainbow.fromArray(['red', 'blue'], minNum: -0.5, maxNum: 0.5);
To interpolate a color among the spectrum, use the list access operator, e.g.
Rainbow rb0 = new Rainbow(minNum:-10, maxNum: 10);
var myColdColor = rb0[-9.32];
var myWarmCOlor = rb0[8.44];
Testing #
To run on vm (default): pub run test
As usual, tests can be run on other platforms with -p<platform>