rainbow_vis 0.0.1

  • README.md
  • Installing
  • Versions
  • 26


Pub Travis

Color data visualization; easily map numbers to a smooth-transitioning color legend. This is a port of the RainbowVis-JS written by anomal.


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];


To run on vm (default): pub run test As usual, tests can be run on other platforms with -p<platform>

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  rainbow_vis: "^0.0.1"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:rainbow_vis/rainbow_vis.dart';
Version Uploaded Documentation Archive
0.0.1 Sep 3, 2016 Go to the documentation of rainbow_vis 0.0.1 Download rainbow_vis 0.0.1 archive


We analyzed this package on Jul 17, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
79 / 100
Reflects how tidy and up-to-date the package is. [more]
9 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:rainbow_vis/rainbow_vis.dart.


  • Running dartdoc failed.

    Make sure dartdoc runs without any issues.

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 error 1 hint.

    Strong-mode analysis of lib/rainbow_vis.dart failed with the following error:

    line: 62 col: 24
    Couldn't infer type parameter 'T'.\n\nTried to infer 'dynamic' for 'T' which doesn't work:\n Type parameter 'T' declared to extend 'num'.\nThe type 'dynamic' was inferred from:\n Parameter 'a' declared as 'T'\n but argument is 'int'.\n Parameter 'b' declared as 'T'\n but argument is 'dynamic'.\n\nConsider passing explicit type argument(s) to the generic.\n\n

  • Package is getting outdated.

    The package was released 97 weeks ago.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use rainbow_vis.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.13.0 <2.0.0
Dev dependencies
test ^0.12.5+1