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
Add this to your package's pubspec.yaml file:
dependencies: rainbow_vis: "^0.0.1"
You can install packages from the command line:
$ pub get
$ flutter packages get
Alternatively, your editor might support
pub get or
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|0.0.1||Sep 3, 2016|
We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Detected platforms: Flutter, web, other
No platform restriction found in primary library
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.dartfailed 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 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:
example.dartor you could also use
|Dart SDK||>=1.13.0 <2.0.0|