Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/palette.git

Main application and chroma-js.

Author djarvis <email>
Date 2018-11-22 22:30:36 GMT-0800
Commit dababdccef8d4f8dd150725ff1d49170d3d8521b
Parent d6845ce
base.dat
-#eda6bb
-#f27cb0
-#e288ea
-#8f79e8
-#b9b9dd
-#627fbb
-#8aaad9
-#3393cd
-#2e8cba
-#76c4c8
-#28b362
-#8cc09e
-#ee2d3e
-#ce2254
-#ae2750
-#b70145
-#841943
-#6c2f47
-#aa356a
-#d54992
-#872b5a
-#f00183
-#bb468a
-#c02d7d
-#7c386b
-#6f4786
-#491e65
-#523d71
-#6b4ea0
-#442c76
-#66589e
-#5e529e
-#1c1847
-#15186f
-#353a7a
-#00077c
-#252b5f
-#4b609f
-#627fbb
-#20438c
-#1957be
-#0078c2
-#194852
-#20575e
-#2e5053
-#00383f
-#30776f
-#0d7a5b
-#6c2f47
-#aa356a
-#872b5a
-#bb468a
-#7c386b
-#6f4786
-#491e65
-#aa9cbd
-#523d71
-#6b4ea0
-#442c76
-#c5c3d1
-#66589e
-#5e529e
-#1c1847
-#b9b9dd
-#565666
-#353a7a
-#252b5f
-#8c92aa
-#4b609f
-#627fbb
-#8aaad9
-#738090
-#3b454f
-#ced2d3
-#194852
-#20575e
-#2e5053
-#76c4c8
-#30776f
-#8cc09e
-#78706d
cool_winter.png
Binary files differ
cool_winter.svg
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
- inkscape:cx="479.07344"
- inkscape:cy="258.38253"
- inkscape:document-units="mm"
- inkscape:current-layer="layer1"
- showgrid="false"
- inkscape:snap-global="false"
- fit-margin-top="15"
- fit-margin-left="15"
- fit-margin-right="15"
- fit-margin-bottom="15"
- inkscape:pagecheckerboard="false" />
- <metadata
- id="metadata3032">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(12.102802,-151.63004)">
- <flowRoot
- xml:space="preserve"
- id="flowRoot3580"
- style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333588px;line-height:20px;font-family:Raleway;-inkscape-font-specification:'Raleway, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- transform="matrix(0.35055891,0,0,0.35055891,50.832385,159.24999)"><flowRegion
- id="flowRegion3582"
- style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333588px;font-family:Raleway;-inkscape-font-specification:'Raleway, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start"><rect
- id="rect3584"
- width="720"
- height="262.85715"
- x="40"
- y="33.948257"
- style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333588px;font-family:Raleway;-inkscape-font-specification:'Raleway, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start" /></flowRegion><flowPara
- id="flowPara3586">Cool Winter Palette</flowPara></flowRoot> <rect
- y="200.45177"
- x="115.04148"
- height="9.9407387"
- width="13.839068"
- id="rect3664"
- style="opacity:1;vector-effect:none;fill:#76c4c8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#e1f5fe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3621"
- width="13.839068"
- height="9.9407387"
- x="168.50186"
- y="200.45177" />
- <rect
- style="opacity:1;vector-effect:none;fill:#8cc09e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3780"
- width="13.839068"
- height="9.9407387"
- x="97.221344"
- y="200.45177" />
- <rect
- y="212.98622"
- x="115.04148"
- height="9.9407387"
- width="13.839068"
- id="rect3770"
- style="opacity:1;vector-effect:none;fill:#2e8cba;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#daf3ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3811"
- width="13.839068"
- height="9.9407387"
- x="168.50186"
- y="212.98622" />
- <rect
- y="212.98622"
- x="275.42267"
- height="9.9407387"
- width="13.839068"
- id="rect3605"
- style="opacity:1;vector-effect:none;fill:#fae9f1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="212.98622"
- x="97.221344"
- height="9.9407387"
- width="13.839068"
- id="rect3676"
- style="opacity:1;vector-effect:none;fill:#30776f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="212.98622"
- x="132.8616"
- height="9.9407387"
- width="13.839068"
- id="rect3623"
- style="opacity:1;vector-effect:none;fill:#3393cd;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#ee2d3e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3662"
- width="13.839068"
- height="9.9407387"
- x="239.78239"
- y="212.98622" />
- <rect
- y="250.83659"
- x="257.60254"
- height="9.9407387"
- width="13.839068"
- id="rect3739"
- style="opacity:1;vector-effect:none;fill:#bb468a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#6f4786;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3611"
- width="13.839068"
- height="9.9407387"
- x="221.96225"
- y="250.83659" />
- <rect
- y="250.83659"
- x="43.502037"
- height="9.9407387"
- width="13.839068"
- id="rect3613"
- style="opacity:1;vector-effect:none;fill:#a7a7a7;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#442c76;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3737"
- width="13.839068"
- height="9.9407387"
- x="204.14212"
- y="250.83659" />
- <rect
- style="opacity:1;vector-effect:none;fill:#4b609f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3680"
- width="13.839068"
- height="9.9407387"
- x="168.50186"
- y="250.83659" />
- <rect
- style="opacity:1;vector-effect:none;fill:#8c92aa;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3644"
- width="13.839068"
- height="9.9407387"
- x="25.558407"
- y="250.83659" />
- <rect
- style="opacity:1;vector-effect:none;fill:#eda6bb;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3758"
- width="13.839068"
- height="9.9407387"
- x="275.42267"
- y="250.83659" />
- <rect
- style="opacity:1;vector-effect:none;fill:#194852;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3688"
- width="13.839068"
- height="9.9407387"
- x="97.221344"
- y="250.83659" />
- <rect
- style="opacity:1;vector-effect:none;fill:#ae2750;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3684"
- width="13.839068"
- height="9.9407387"
- x="239.78239"
- y="250.83659" />
- <rect
- style="opacity:1;vector-effect:none;fill:#e288ea;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3648"
- width="13.839068"
- height="9.9407387"
- x="257.60254"
- y="225.64418" />
- <rect
- style="opacity:1;vector-effect:none;fill:#b9b9dd;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3766"
- width="13.839068"
- height="9.9407387"
- x="221.96225"
- y="225.64418" />
- <rect
- y="225.64418"
- x="43.502037"
- height="9.9407387"
- width="13.839068"
- id="rect3786"
- style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.24701062;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#66589e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3764"
- width="13.839068"
- height="9.9407387"
- x="204.14212"
- y="225.64418" />
- <rect
- y="225.64418"
- x="168.50186"
- height="9.9407387"
- width="13.839068"
- id="rect3768"
- style="opacity:1;vector-effect:none;fill:#8aaad9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="225.64418"
- x="275.42267"
- height="9.9407387"
- width="13.839068"
- id="rect3813"
- style="opacity:1;vector-effect:none;fill:#ffe3ef;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#20575e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3625"
- width="13.839068"
- height="9.9407387"
- x="97.221344"
- y="225.64418" />
- <rect
- style="opacity:1;vector-effect:none;fill:#8f79e8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3674"
- width="13.839068"
- height="9.9407387"
- x="186.32201"
- y="225.64418" />
- <rect
- style="opacity:1;vector-effect:none;fill:#1957be;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3617"
- width="13.839068"
- height="9.9407387"
- x="150.68176"
- y="225.64418" />
- <rect
- y="225.64418"
- x="132.8616"
- height="9.9407387"
- width="13.839068"
- id="rect3821"
- style="opacity:1;vector-effect:none;fill:#0078c2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#ce2254;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3707"
- width="13.839068"
- height="9.9407387"
- x="239.78239"
- y="225.64418" />
- <rect
- y="276.89584"
- x="7.7382698"
- height="9.9407387"
- width="13.839068"
- id="rect3678"
- style="opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="276.89584"
- x="79.365234"
- height="9.9407387"
- width="13.839068"
- id="rect3725"
- style="opacity:1;vector-effect:none;fill:#0d7a5b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#aa356a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3711"
- width="13.839068"
- height="9.9407387"
- x="257.60254"
- y="276.89584" />
- <rect
- style="opacity:1;vector-effect:none;fill:#872b5a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3603"
- width="13.839068"
- height="9.9407387"
- x="221.96225"
- y="276.89584" />
- <rect
- style="opacity:1;vector-effect:none;fill:#78706d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3719"
- width="13.839068"
- height="9.9407387"
- x="43.502037"
- y="276.89584" />
- <rect
- y="276.89584"
- x="204.14212"
- height="9.9407387"
- width="13.839068"
- id="rect3762"
- style="opacity:1;vector-effect:none;fill:#523d71;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#fff253;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3809"
- width="13.839068"
- height="9.9407387"
- x="61.445683"
- y="276.89584" />
- <rect
- y="276.89584"
- x="168.50186"
- height="9.9407387"
- width="13.839068"
- id="rect3615"
- style="opacity:1;vector-effect:none;fill:#252b5f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="276.89584"
- x="25.558407"
- height="9.9407387"
- width="13.839068"
- id="rect3817"
- style="opacity:1;vector-effect:none;fill:#565666;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="276.89584"
- x="275.42267"
- height="9.9407387"
- width="13.839068"
- id="rect3823"
- style="opacity:1;vector-effect:none;fill:#f00183;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#3b454f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3666"
- width="13.839068"
- height="9.9407387"
- x="97.221344"
- y="276.89584" />
- <rect
- y="276.78827"
- x="186.32201"
- height="9.9407387"
- width="13.839068"
- id="rect3731"
- style="opacity:1;vector-effect:none;fill:#353a7a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="276.89584"
- x="132.8616"
- height="9.9407387"
- width="13.839068"
- id="rect3772"
- style="opacity:1;vector-effect:none;fill:#1c1847;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#15186f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3827"
- width="13.839068"
- height="9.9407387"
- x="150.68176"
- y="277.04803" />
- <rect
- y="276.89584"
- x="239.78239"
- height="9.9407387"
- width="13.839068"
- id="rect3760"
- style="opacity:1;vector-effect:none;fill:#6c2f47;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="238.30214"
- x="257.60254"
- height="9.9407387"
- width="13.839068"
- id="rect3660"
- style="opacity:1;vector-effect:none;fill:#d54992;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#aa9cbd;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3733"
- width="13.839068"
- height="9.9407387"
- x="221.96225"
- y="238.30214" />
- <rect
- y="238.30214"
- x="43.502037"
- height="9.9407387"
- width="13.839068"
- id="rect3717"
- style="opacity:1;vector-effect:none;fill:#ced2d3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="238.30214"
- x="204.14212"
- height="9.9407387"
- width="13.839068"
- id="rect3686"
- style="opacity:1;vector-effect:none;fill:#5e529e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="238.30214"
- x="168.50186"
- height="9.9407387"
- width="13.839068"
- id="rect3668"
- style="opacity:1;vector-effect:none;fill:#627fbb;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#c5c3d1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3654"
- width="13.839068"
- height="9.9407387"
- x="25.558407"
- y="238.30214" />
- <rect
- y="238.30214"
- x="275.42267"
- height="9.9407387"
- width="13.839068"
- id="rect3713"
- style="opacity:1;vector-effect:none;fill:#f7d6e1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="238.30214"
- x="97.221344"
- height="9.9407387"
- width="13.839068"
- id="rect3778"
- style="opacity:1;vector-effect:none;fill:#2e5053;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="238.30214"
- x="186.32201"
- height="9.9407387"
- width="13.839068"
- id="rect3735"
- style="opacity:1;vector-effect:none;fill:#6b4ea0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#b70145;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3819"
- width="13.839068"
- height="9.9407387"
- x="239.78239"
- y="238.30214" />
- <rect
- style="opacity:1;vector-effect:none;fill:#0d0d0d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3723"
- width="13.839068"
- height="9.9407387"
- x="7.7382698"
- y="263.83795" />
- <rect
- style="opacity:1;vector-effect:none;fill:#28b362;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3727"
- width="13.839068"
- height="9.9407387"
- x="79.401207"
- y="263.83795" />
- <rect
- y="263.83795"
- x="257.60254"
- height="9.9407387"
- width="13.839068"
- id="rect3672"
- style="opacity:1;vector-effect:none;fill:#c02d7d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#7c386b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3741"
- width="13.839068"
- height="9.9407387"
- x="221.96225"
- y="263.83795" />
- <rect
- style="opacity:1;vector-effect:none;fill:#939596;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3784"
- width="13.839068"
- height="9.9407387"
- x="43.502037"
- y="263.83795" />
- <rect
- style="opacity:1;vector-effect:none;fill:#491e65;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3807"
- width="13.839068"
- height="9.9407387"
- x="204.14212"
- y="263.83795" />
- <rect
- style="opacity:1;vector-effect:none;fill:#f9f4a0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3652"
- width="13.839068"
- height="9.9407387"
- x="61.545101"
- y="263.83795" />
- <rect
- style="opacity:1;vector-effect:none;fill:#20438c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3729"
- width="13.839068"
- height="9.9407387"
- x="168.50186"
- y="263.83795" />
- <rect
- y="263.83795"
- x="25.558407"
- height="9.9407387"
- width="13.839068"
- id="rect3656"
- style="opacity:1;vector-effect:none;fill:#738090;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="263.83795"
- x="275.42267"
- height="9.9407387"
- width="13.839068"
- id="rect3705"
- style="opacity:1;vector-effect:none;fill:#f27cb0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="263.83795"
- x="97.221344"
- height="9.9407387"
- width="13.839068"
- id="rect3825"
- style="opacity:1;vector-effect:none;fill:#00383f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- y="264.25381"
- x="150.68176"
- height="9.9407387"
- width="13.839068"
- id="rect3650"
- style="opacity:1;vector-effect:none;fill:#00077c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
- <rect
- style="opacity:1;vector-effect:none;fill:#841943;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
- id="rect3831"
- width="13.839068"
- height="9.9407387"
- x="239.78239"
- y="263.37106" />
- <g
- id="g1502">
- <rect
- ry="3.4745038"
- rx="3.4745038"
- y="292.03354"
- x="3.1617815"
- height="17.105246"
- width="255.77693"
+ inkscape:cx="732.62173"
+ inkscape:cy="258.38253"
+ inkscape:document-units="mm"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:snap-global="false"
+ fit-margin-top="15"
+ fit-margin-left="15"
+ fit-margin-right="15"
+ fit-margin-bottom="15"
+ inkscape:pagecheckerboard="false" />
+ <metadata
+ id="metadata3032">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(12.102802,-151.63004)">
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot3580"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333588px;line-height:20px;font-family:Raleway;-inkscape-font-specification:'Raleway, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(0.35055891,0,0,0.35055891,50.832385,159.25)"><flowRegion
+ id="flowRegion3582"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333588px;font-family:Raleway;-inkscape-font-specification:'Raleway, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start"><rect
+ id="rect3584"
+ width="720"
+ height="262.85715"
+ x="40"
+ y="33.948257"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333588px;font-family:Raleway;-inkscape-font-specification:'Raleway, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start" /></flowRegion><flowPara
+ id="flowPara3586">Cool Winter Palette</flowPara></flowRoot> <g
+ id="g12537"
+ transform="translate(0,-7.6030763)">
+ <rect
+ style="opacity:1;vector-effect:none;fill:#76c4c8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3664"
+ width="13.839068"
+ height="9.9407387"
+ x="115.04148"
+ y="200.45177" />
+ <rect
+ y="200.45177"
+ x="168.50186"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3621"
+ style="opacity:1;vector-effect:none;fill:#e1f5fe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="200.45177"
+ x="97.221344"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3780"
+ style="opacity:1;vector-effect:none;fill:#8cc09e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#2e8cba;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3770"
+ width="13.839068"
+ height="9.9407387"
+ x="115.04148"
+ y="212.98622" />
+ <rect
+ y="212.98622"
+ x="168.50186"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3811"
+ style="opacity:1;vector-effect:none;fill:#daf3ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#fae9f1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3605"
+ width="13.839068"
+ height="9.9407387"
+ x="275.42267"
+ y="212.98622" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#30776f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3676"
+ width="13.839068"
+ height="9.9407387"
+ x="97.221344"
+ y="212.98622" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#3393cd;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3623"
+ width="13.839068"
+ height="9.9407387"
+ x="132.8616"
+ y="212.98622" />
+ <rect
+ y="212.98622"
+ x="239.78239"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3662"
+ style="opacity:1;vector-effect:none;fill:#ee2d3e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#bb468a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3739"
+ width="13.839068"
+ height="9.9407387"
+ x="257.60254"
+ y="250.83659" />
+ <rect
+ y="250.83659"
+ x="221.96225"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3611"
+ style="opacity:1;vector-effect:none;fill:#6f4786;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#a7a7a7;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3613"
+ width="13.839068"
+ height="9.9407387"
+ x="43.502037"
+ y="250.83659" />
+ <rect
+ y="250.83659"
+ x="204.14212"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3737"
+ style="opacity:1;vector-effect:none;fill:#442c76;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="250.83659"
+ x="168.50186"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3680"
+ style="opacity:1;vector-effect:none;fill:#4b609f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="250.83659"
+ x="25.558407"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3644"
+ style="opacity:1;vector-effect:none;fill:#8c92aa;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="250.83659"
+ x="275.42267"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3758"
+ style="opacity:1;vector-effect:none;fill:#eda6bb;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="250.83659"
+ x="97.221344"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3688"
+ style="opacity:1;vector-effect:none;fill:#194852;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="250.83659"
+ x="239.78239"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3684"
+ style="opacity:1;vector-effect:none;fill:#ae2750;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="225.64418"
+ x="257.60254"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3648"
+ style="opacity:1;vector-effect:none;fill:#e288ea;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="225.64418"
+ x="221.96225"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3766"
+ style="opacity:1;vector-effect:none;fill:#b9b9dd;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.24701062;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3786"
+ width="13.839068"
+ height="9.9407387"
+ x="43.502037"
+ y="225.64418" />
+ <rect
+ y="225.64418"
+ x="204.14212"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3764"
+ style="opacity:1;vector-effect:none;fill:#66589e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#8aaad9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3768"
+ width="13.839068"
+ height="9.9407387"
+ x="168.50186"
+ y="225.64418" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#ffe3ef;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3813"
+ width="13.839068"
+ height="9.9407387"
+ x="275.42267"
+ y="225.64418" />
+ <rect
+ y="225.64418"
+ x="97.221344"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3625"
+ style="opacity:1;vector-effect:none;fill:#20575e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="225.64418"
+ x="186.32201"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3674"
+ style="opacity:1;vector-effect:none;fill:#8f79e8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="225.64418"
+ x="150.68176"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3617"
+ style="opacity:1;vector-effect:none;fill:#1957be;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#0078c2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3821"
+ width="13.839068"
+ height="9.9407387"
+ x="132.8616"
+ y="225.64418" />
+ <rect
+ y="225.64418"
+ x="239.78239"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3707"
+ style="opacity:1;vector-effect:none;fill:#ce2254;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3678"
+ width="13.839068"
+ height="9.9407387"
+ x="7.7382698"
+ y="276.89584" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#0d7a5b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3725"
+ width="13.839068"
+ height="9.9407387"
+ x="79.365234"
+ y="276.89584" />
+ <rect
+ y="276.89584"
+ x="257.60254"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3711"
+ style="opacity:1;vector-effect:none;fill:#aa356a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="276.89584"
+ x="221.96225"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3603"
+ style="opacity:1;vector-effect:none;fill:#872b5a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="276.89584"
+ x="43.502037"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3719"
+ style="opacity:1;vector-effect:none;fill:#78706d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#523d71;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3762"
+ width="13.839068"
+ height="9.9407387"
+ x="204.14212"
+ y="276.89584" />
+ <rect
+ y="276.89584"
+ x="61.445683"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3809"
+ style="opacity:1;vector-effect:none;fill:#fff253;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#252b5f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3615"
+ width="13.839068"
+ height="9.9407387"
+ x="168.50186"
+ y="276.89584" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#565666;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3817"
+ width="13.839068"
+ height="9.9407387"
+ x="25.558407"
+ y="276.89584" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#f00183;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3823"
+ width="13.839068"
+ height="9.9407387"
+ x="275.42267"
+ y="276.89584" />
+ <rect
+ y="276.89584"
+ x="97.221344"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3666"
+ style="opacity:1;vector-effect:none;fill:#3b454f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#353a7a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3731"
+ width="13.839068"
+ height="9.9407387"
+ x="186.32201"
+ y="276.78827" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#1c1847;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3772"
+ width="13.839068"
+ height="9.9407387"
+ x="132.8616"
+ y="276.89584" />
+ <rect
+ y="277.04803"
+ x="150.68176"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3827"
+ style="opacity:1;vector-effect:none;fill:#15186f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#6c2f47;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3760"
+ width="13.839068"
+ height="9.9407387"
+ x="239.78239"
+ y="276.89584" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#d54992;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3660"
+ width="13.839068"
+ height="9.9407387"
+ x="257.60254"
+ y="238.30214" />
+ <rect
+ y="238.30214"
+ x="221.96225"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3733"
+ style="opacity:1;vector-effect:none;fill:#aa9cbd;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#ced2d3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3717"
+ width="13.839068"
+ height="9.9407387"
+ x="43.502037"
+ y="238.30214" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#5e529e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3686"
+ width="13.839068"
+ height="9.9407387"
+ x="204.14212"
+ y="238.30214" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#627fbb;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3668"
+ width="13.839068"
+ height="9.9407387"
+ x="168.50186"
+ y="238.30214" />
+ <rect
+ y="238.30214"
+ x="25.558407"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3654"
+ style="opacity:1;vector-effect:none;fill:#c5c3d1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#f7d6e1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3713"
+ width="13.839068"
+ height="9.9407387"
+ x="275.42267"
+ y="238.30214" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#2e5053;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3778"
+ width="13.839068"
+ height="9.9407387"
+ x="97.221344"
+ y="238.30214" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#6b4ea0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3735"
+ width="13.839068"
+ height="9.9407387"
+ x="186.32201"
+ y="238.30214" />
+ <rect
+ y="238.30214"
+ x="239.78239"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3819"
+ style="opacity:1;vector-effect:none;fill:#b70145;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="263.83795"
+ x="7.7382698"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3723"
+ style="opacity:1;vector-effect:none;fill:#0d0d0d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="263.83795"
+ x="79.401207"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3727"
+ style="opacity:1;vector-effect:none;fill:#28b362;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#c02d7d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3672"
+ width="13.839068"
+ height="9.9407387"
+ x="257.60254"
+ y="263.83795" />
+ <rect
+ y="263.83795"
+ x="221.96225"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3741"
+ style="opacity:1;vector-effect:none;fill:#7c386b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="263.83795"
+ x="43.502037"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3784"
+ style="opacity:1;vector-effect:none;fill:#939596;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="263.83795"
+ x="204.14212"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3807"
+ style="opacity:1;vector-effect:none;fill:#491e65;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="263.83795"
+ x="61.545101"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3652"
+ style="opacity:1;vector-effect:none;fill:#f9f4a0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ y="263.83795"
+ x="168.50186"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3729"
+ style="opacity:1;vector-effect:none;fill:#20438c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#738090;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3656"
+ width="13.839068"
+ height="9.9407387"
+ x="25.558407"
+ y="263.83795" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#f27cb0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3705"
+ width="13.839068"
+ height="9.9407387"
+ x="275.42267"
+ y="263.83795" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#00383f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3825"
+ width="13.839068"
+ height="9.9407387"
+ x="97.221344"
+ y="263.83795" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#00077c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect3650"
+ width="13.839068"
+ height="9.9407387"
+ x="150.68176"
+ y="264.25381" />
+ <rect
+ y="263.37106"
+ x="239.78239"
+ height="9.9407387"
+ width="13.839068"
+ id="rect3831"
+ style="opacity:1;vector-effect:none;fill:#841943;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.06822076px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ </g>
+ <g
+ id="g12546">
+ <rect
+ ry="3.4745038"
+ rx="3.4745038"
+ y="292.03354"
+ x="3.1617815"
+ height="17.105255"
+ width="290.52197"
id="rect1486"
style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.5291667;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:1.5875, 1.5875;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
monos.dat
-#939596
-#ffffff
-#a7a7a7
-#0d0d0d
-#000000
mutes.dat
-#6c2f47
-#aa356a
-#872b5a
-#bb468a
-#7c386b
-#6f4786
-#491e65
-#aa9cbd
-#523d71
-#6b4ea0
-#442c76
-#c5c3d1
-#66589e
-#5e529e
-#1c1847
-#b9b9dd
-#565666
-#353a7a
-#252b5f
-#8c92aa
-#4b609f
-#627fbb
-#8aaad9
-#738090
-#3b454f
-#ced2d3
-#194852
-#20575e
-#2e5053
-#76c4c8
-#30776f
-#8cc09e
-#78706d
shades.dat
-#ee2d3e
-#ce2254
-#ae2750
-#b70145
-#841943
-#6c2f47
-#aa356a
-#d54992
-#872b5a
-#f00183
-#bb468a
-#c02d7d
-#7c386b
-#6f4786
-#491e65
-#523d71
-#6b4ea0
-#442c76
-#66589e
-#5e529e
-#1c1847
-#15186f
-#353a7a
-#00077c
-#252b5f
-#4b609f
-#627fbb
-#20438c
-#1957be
-#0078c2
-#194852
-#20575e
-#2e5053
-#00383f
-#30776f
-#0d7a5b
src/data/all.dat
+#000000
+#00077c
+#00383f
+#0078c2
+#0d0d0d
+#0d7a5b
+#15186f
+#194852
+#1957be
+#1c1847
+#20438c
+#20575e
+#252b5f
+#28b362
+#2e5053
+#2e8cba
+#30776f
+#3393cd
+#353a7a
+#3b454f
+#442c76
+#491e65
+#4b609f
+#523d71
+#565666
+#5e529e
+#627fbb
+#66589e
+#6b4ea0
+#6c2f47
+#6f4786
+#738090
+#76c4c8
+#78706d
+#7c386b
+#841943
+#872b5a
+#8aaad9
+#8c92aa
+#8cc09e
+#8f79e8
+#939596
+#a7a7a7
+#aa356a
+#aa9cbd
+#ae2750
+#b70145
+#b9b9dd
+#bb468a
+#c02d7d
+#c5c3d1
+#ce2254
+#ced2d3
+#d54992
+#daf3ff
+#e1f5fe
+#e288ea
+#eda6bb
+#ee2d3e
+#f00183
+#f27cb0
+#f7d6e1
+#f9f4a0
+#fae9f1
+#ffe3ef
+#fff253
+#ffffff
src/data/base.dat
+#00077c
+#00383f
+#0078c2
+#0d7a5b
+#15186f
+#194852
+#1957be
+#1c1847
+#20438c
+#20575e
+#252b5f
+#28b362
+#2e5053
+#2e8cba
+#30776f
+#3393cd
+#353a7a
+#3b454f
+#442c76
+#491e65
+#4b609f
+#523d71
+#565666
+#5e529e
+#627fbb
+#66589e
+#6b4ea0
+#6c2f47
+#6f4786
+#738090
+#76c4c8
+#78706d
+#7c386b
+#841943
+#872b5a
+#8aaad9
+#8c92aa
+#8cc09e
+#8f79e8
+#aa356a
+#aa9cbd
+#ae2750
+#b70145
+#b9b9dd
+#bb468a
+#c02d7d
+#c5c3d1
+#ce2254
+#ced2d3
+#d54992
+#e288ea
+#eda6bb
+#ee2d3e
+#f00183
+#f27cb0
src/data/base.svg
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="755.91895"
+ height="491.65698"
+ version="1.1"
+ id="svg11472"
+ sodipodi:docname="base.svg"
+ inkscape:version="0.92.3 (unknown)">
+ <metadata
+ id="metadata11478">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs11476" />
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="640"
+ inkscape:window-height="480"
+ id="namedview11474"
+ showgrid="false"
+ inkscape:zoom="1.1301824"
+ inkscape:cx="377.95947"
+ inkscape:cy="298.88605"
+ inkscape:current-layer="svg11472"
+ fit-margin-top="35"
+ fit-margin-left="35"
+ fit-margin-right="35"
+ fit-margin-bottom="35" />
+ <g
+ id="g12313"
+ transform="translate(45.959473,-239.65828)">
+ <rect
+ x="0"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#78706d"
+ id="rect11366" />
+ <rect
+ x="37"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#fff253"
+ id="rect11368" />
+ <rect
+ x="74"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#28b362"
+ id="rect11370" />
+ <rect
+ x="74"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#8cc09e"
+ id="rect11372" />
+ <rect
+ x="111"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#0d7a5b"
+ id="rect11374" />
+ <rect
+ x="111"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#30776f"
+ id="rect11376" />
+ <rect
+ x="148"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#2e5053"
+ id="rect11378" />
+ <rect
+ x="148"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#76c4c8"
+ id="rect11380" />
+ <rect
+ x="185"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#00383f"
+ id="rect11382" />
+ <rect
+ x="185"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#20575e"
+ id="rect11384" />
+ <rect
+ x="185"
+ y="484"
+ height="35"
+ width="35"
+ style="fill:#ced2d3"
+ id="rect11386" />
+ <rect
+ x="222"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#0078c2"
+ id="rect11388" />
+ <rect
+ x="222"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#2e8cba"
+ id="rect11390" />
+ <rect
+ x="222"
+ y="484"
+ height="35"
+ width="35"
+ style="fill:#3393cd"
+ id="rect11392" />
+ <rect
+ x="222"
+ y="447"
+ height="35"
+ width="35"
+ style="fill:#939596"
+ id="rect11394" />
+ <rect
+ x="259"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#3b454f"
+ id="rect11396" />
+ <rect
+ x="259"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#20438c"
+ id="rect11398" />
+ <rect
+ x="259"
+ y="484"
+ height="35"
+ width="35"
+ style="fill:#1957be"
+ id="rect11400" />
+ <rect
+ x="259"
+ y="447"
+ height="35"
+ width="35"
+ style="fill:#738090"
+ id="rect11402" />
+ <rect
+ x="259"
+ y="410"
+ height="35"
+ width="35"
+ style="fill:#627fbb"
+ id="rect11404" />
+ <rect
+ x="259"
+ y="373"
+ height="35"
+ width="35"
+ style="fill:#8aaad9"
+ id="rect11406" />
+ <rect
+ x="296"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#252b5f"
+ id="rect11408" />
+ <rect
+ x="296"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#4b609f"
+ id="rect11410" />
+ <rect
+ x="296"
+ y="484"
+ height="35"
+ width="35"
+ style="fill:#8c92aa"
+ id="rect11412" />
+ <rect
+ x="333"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#1c1847"
+ id="rect11414" />
+ <rect
+ x="333"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#00077c"
+ id="rect11416" />
+ <rect
+ x="333"
+ y="484"
+ height="35"
+ width="35"
+ style="fill:#15186f"
+ id="rect11418" />
+ <rect
+ x="333"
+ y="447"
+ height="35"
+ width="35"
+ style="fill:#353a7a"
+ id="rect11420" />
+ <rect
+ x="333"
+ y="410"
+ height="35"
+ width="35"
+ style="fill:#565666"
+ id="rect11422" />
+ <rect
+ x="333"
+ y="373"
+ height="35"
+ width="35"
+ style="fill:#b9b9dd"
+ id="rect11424" />
+ <rect
+ x="370"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#66589e"
+ id="rect11426" />
+ <rect
+ x="370"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#8f79e8"
+ id="rect11428" />
+ <rect
+ x="370"
+ y="484"
+ height="35"
+ width="35"
+ style="fill:#c5c3d1"
+ id="rect11430" />
+ <rect
+ x="407"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#442c76"
+ id="rect11432" />
+ <rect
+ x="407"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#523d71"
+ id="rect11434" />
+ <rect
+ x="407"
+ y="484"
+ height="35"
+ width="35"
+ style="fill:#6b4ea0"
+ id="rect11436" />
+ <rect
+ x="407"
+ y="447"
+ height="35"
+ width="35"
+ style="fill:#aa9cbd"
+ id="rect11438" />
+ <rect
+ x="444"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#491e65"
+ id="rect11440" />
+ <rect
+ x="444"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#6f4786"
+ id="rect11442" />
+ <rect
+ x="481"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#7c386b"
+ id="rect11444" />
+ <rect
+ x="518"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#872b5a"
+ id="rect11446" />
+ <rect
+ x="518"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#c02d7d"
+ id="rect11448" />
+ <rect
+ x="518"
+ y="484"
+ height="35"
+ width="35"
+ style="fill:#bb468a"
+ id="rect11450" />
+ <rect
+ x="518"
+ y="447"
+ height="35"
+ width="35"
+ style="fill:#f00183"
+ id="rect11452" />
+ <rect
+ x="518"
+ y="410"
+ height="35"
+ width="35"
+ style="fill:#d54992"
+ id="rect11454" />
+ <rect
+ x="555"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#6c2f47"
+ id="rect11456" />
+ <rect
+ x="555"
+ y="521"
+ height="35"
+ width="35"
+ style="fill:#841943"
+ id="rect11458" />
+ <rect
+ x="555"
+ y="484"
+ height="35"
+ width="35"
+ style="fill:#b70145"
+ id="rect11460" />
+ <rect
+ x="555"
+ y="447"
+ height="35"
+ width="35"
+ style="fill:#ae2750"
+ id="rect11462" />
+ <rect
+ x="555"
+ y="410"
+ height="35"
+ width="35"
+ style="fill:#aa356a"
+ id="rect11464" />
+ <rect
+ x="592"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#ce2254"
+ id="rect11466" />
+ <rect
+ x="629"
+ y="558"
+ height="35"
+ width="35"
+ style="fill:#ee2d3e"
+ id="rect11468" />
+ </g>
+ <g
+ id="g12259"
+ transform="translate(45.959473,-211.16179)">
+ <rect
+ ry="13.131983"
+ rx="13.131983"
+ y="611.55396"
+ x="-9.9594727"
+ height="55.264832"
+ width="683.91895"
+ id="rect1486"
+ style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.00000024;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6.00000007, 6.00000007;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <g
+ id="g12250">
+ <rect
+ style="opacity:1;vector-effect:none;fill:#fdffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.72188789;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect1476"
+ width="34.278111"
+ height="34.278111"
+ x="37.360947"
+ y="622.0473" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#2660a4;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.20357378px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect1478"
+ width="35"
+ height="35"
+ x="259"
+ y="621.68634" />
+ <rect
+ y="621.68634"
+ x="296"
+ height="35"
+ width="35"
+ id="rect1480"
+ style="opacity:1;vector-effect:none;fill:#15284f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.20357376px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ <rect
+ style="opacity:1;vector-effect:none;fill:#0a0f0d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.20357378px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="rect1482"
+ width="35"
+ height="35"
+ x="0"
+ y="621.68634" />
+ <rect
+ y="621.68634"
+ x="629"
+ height="35"
+ width="35"
+ id="rect1484"
+ style="opacity:1;vector-effect:none;fill:#df2d3e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.20357378px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
+ </g>
+ </g>
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot3580"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333588px;line-height:20px;font-family:Raleway;-inkscape-font-specification:'Raleway, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(1.3249471,0,0,1.3249471,-4.2792332,7.1069551)"><flowRegion
+ id="flowRegion3582"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333588px;font-family:Raleway;-inkscape-font-specification:'Raleway, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start"><rect
+ id="rect3584"
+ width="720"
+ height="262.85715"
+ x="40"
+ y="33.948257"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333588px;font-family:Raleway;-inkscape-font-specification:'Raleway, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start" /></flowRegion><flowPara
+ id="flowPara3586">Cool Winter Palette</flowPara></flowRoot></svg>
src/data/monos.dat
+#939596
+#ffffff
+#a7a7a7
+#0d0d0d
+#000000
src/data/mutes.dat
+#6c2f47
+#aa356a
+#872b5a
+#bb468a
+#7c386b
+#6f4786
+#491e65
+#aa9cbd
+#523d71
+#6b4ea0
+#442c76
+#c5c3d1
+#66589e
+#5e529e
+#1c1847
+#b9b9dd
+#565666
+#353a7a
+#252b5f
+#8c92aa
+#4b609f
+#627fbb
+#8aaad9
+#738090
+#3b454f
+#ced2d3
+#194852
+#20575e
+#2e5053
+#76c4c8
+#30776f
+#8cc09e
+#78706d
src/data/shades.dat
+#ee2d3e
+#ce2254
+#ae2750
+#b70145
+#841943
+#6c2f47
+#aa356a
+#d54992
+#872b5a
+#f00183
+#bb468a
+#c02d7d
+#7c386b
+#6f4786
+#491e65
+#523d71
+#6b4ea0
+#442c76
+#66589e
+#5e529e
+#1c1847
+#15186f
+#353a7a
+#00077c
+#252b5f
+#4b609f
+#627fbb
+#20438c
+#1957be
+#0078c2
+#194852
+#20575e
+#2e5053
+#00383f
+#30776f
+#0d7a5b
src/data/template-foot.svg
+</g>
+</svg>
+
src/data/template-head.svg
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="842" height="595">
+<g transform="translate(0,595)">
src/data/tints.dat
+#f7d6e1
+#fae9f1
+#ffe3ef
+#c5c3d1
+#e1f5fe
+#daf3ff
+#ced2d3
+#f9f4a0
+#fff253
src/data/tones.dat
+#eda6bb
+#f27cb0
+#e288ea
+#8f79e8
+#b9b9dd
+#627fbb
+#8aaad9
+#3393cd
+#2e8cba
+#76c4c8
+#28b362
+#8cc09e
src/main.js
+/**
+ * Given a set of hexadecimal colour codes, this will create SVG boxes of
+ * the colour codes, sorted into colour bins by perceived brightness.
+ */
+const chroma = require( "chroma-js" );
+const readline = require( "readline" );
+
+// Max # of bins = 360 / DEGREES_PER_BIN
+const DEGREES_PER_BIN = 12;
+
+// Box width, in pixels.
+const COLOUR_WIDTH = 35;
+
+// Box height, in pixels.
+const COLOUR_HEIGHT = 35;
+
+// Distance between horizontal boxes, in pixels.
+const COLOUR_SEP_X = 2;
+
+// Distance between vertical boxes, in pixels.
+const COLOUR_SEP_Y = 2;
+
+// Remove colours closer in similarity than this threshhold.
+const SIMILARITY = 7;
+
+/**
+ * Read the hex codes into an array from standard input.
+ * Bin the hex codes into HSL at a given # of degrees of separation.
+ * Remove colours not allowed.
+ * Order bin colours to nearest L (of Lab).
+ * Write the results to standard output as SVG element.
+ */
+const main = function() {
+ read_hex_codes()
+ .then( bin_by_hue )
+ .then( sort_by_lightness )
+ .then( remove_colours )
+ .then( write_hex_codes );
+}
+
+/**
+ * Reads hex codes from standard input and passes them to the callback
+ * function as an array.
+ */
+const read_hex_codes = function() {
+ return new Promise( function( resolve, reject ) {
+ var colours = [];
+
+ const r = readline.createInterface({
+ input: process.stdin,
+ output: process.stdout,
+ terminal: false
+ });
+
+ r.on( 'line', function( line ) {
+ colours.push( line );
+ }).on( 'close', function() {
+ resolve( colours );
+ });
+ });
+}
+
+const bin_by_hue = function( colours ) {
+ return new Promise( function( resolve, reject ) {
+ var bins = [];
+
+ colours.forEach( function( colour ) {
+ const hue = chroma( colour ).hsl()[ 0 ];
+ const bin = Math.round( hue / DEGREES_PER_BIN );
+
+ if( typeof bins[ bin ] == 'undefined' ) {
+ bins[ bin ] = [];
+ }
+
+ bins[ bin ].push( colour );
+ });
+
+ resolve( bins );
+ });
+}
+
+const sort_by_lightness = function( bins ) {
+ return new Promise( function( resolve, reject ) {
+ bins.forEach( function( bin ) {
+ bin.sort( function( colour1, colour2 ) {
+ const l1 = chroma( colour1 ).luminance();
+ const l2 = chroma( colour2 ).luminance();
+
+ return l1 > l2;
+ });
+ });
+
+ resolve( bins );
+ });
+}
+
+const remove_colours = function( bins ) {
+ return new Promise( function( resolve, reject ) {
+ var resolved = [];
+
+ bins.forEach( function( bin ) {
+ var modified = true;
+
+ while( modified ) {
+ modified = false;
+
+ bin = bin.filter( function( colour, index ) {
+ var retain = true;
+ var hue = chroma( colour ).hsl();
+
+ if( hue[1] > 0.6 && hue[2] > 0.7 ) {
+ // Remove pastels.
+ retain = false;
+ }
+ else if( index + 1 < bin.length ) {
+ // Remove similar colours.
+ const distance = chroma.distance( colour, bin[ index + 1 ] );
+ retain = distance > SIMILARITY;
+ }
+
+ // Repeat filtering until no duplicates remain.
+ if( retain === false ) {
+ modified = true;
+ }
+
+ return retain;
+ });
+ }
+
+ resolved.push( bin );
+ });
+
+ resolve( resolved );
+ });
+}
+
+const write_hex_codes = function( bins ) {
+ var x = 0;
+
+ // Remove the empty bins and then write the SVG element.
+ bins
+ .filter( n => Object.keys( n ).length !== 0 )
+ .forEach( function( bin ) {
+ var y = 0;
+
+ bin.forEach( function( colour ) {
+ y -= (COLOUR_HEIGHT + COLOUR_SEP_Y);
+ console.log(
+ '<rect x="' + x +
+ '" y="' + y +
+ '" height="' + COLOUR_HEIGHT +
+ '" width="' + COLOUR_WIDTH +
+ '" style="fill:' + colour + '"/>'
+ );
+ });
+
+ x += (COLOUR_WIDTH + COLOUR_SEP_X);
+ });
+}
+
+/**
+ * Main entry point.
+ */
+main();
+
src/node_modules/chroma-js/.travis.yml
-
+language: node_js
+node_js:
+ - 0.12
+ - 0.11
+before_script: "npm install -g grunt-cli"
+script: "npm run-script build && npm run-script test"
src/node_modules/chroma-js/CHANGELOG.md
+## Changelog
+
+### 1.4.0
+* color.hex() now automatically sets the mode to 'rgba' if the colors alpha channel is < 1. so `chroma('rgba(255,0,0,.5)').hex()` will now return `"#ff000080"` instead of `"#ff0000"`. if this is not what you want, you must explicitly set the mode to `rgb` using `.hex("rgb")`.
+
+
+### 1.3.5
+* added LRGB interpolation
+
+### 1.3.4
+* passing *null* as mode in scale.colors will return chroma objects
+
+### 1.3.3
+
+* added [color.clipped](https://gka.github.io/chroma.js/#color-clipped)
+* added [chroma.distance](https://gka.github.io/chroma.js/#chroma-distance)
+* added [chroma.deltaE](https://gka.github.io/chroma.js/#chroma-deltae)
+* [color.set](https://gka.github.io/chroma.js/#color-set) now returns a new chroma instance
+* chroma.scale now allows [disabling of internal cache](https://gka.github.io/chroma.js/#scale-cache)
+* [chroma.average](https://gka.github.io/chroma.js/#chroma-average) now works with any color mode
+* added unit tests for color conversions
+* use hex colors as default string representation
+* RGB channels are now stored as floats internally for higher precision
+* bugfix with cubehelix and constant lightness
+* bugfix in chroma.limits quantiles
+* bugfix when running scale.colors(1)
+* bugfix in hsi2rgb color conversion
+
+### 1.2.2
+
+* scale.colors() now returns the original colors instead of just min/max range
+
+### 1.2.0
+
+* added chroma.average for averaging colors
+
+### 1.1.0
+
+* refactored chroma.scale
+* changed behaviour of scale.domain
+* added scale.classes
+* added scale.padding
+
+### 1.0.2
+
+* standardized alpha channel construction
+* chroma.bezier automatically returns chroma.scale
+
+### 1.0.1
+
+* added simple color output to chroma.scale().colors()
+
+### 1.0.0
+
+* numeric interpolation does what it should
+* refactored and modularized code base
+* changed argument order of Color::interpolate
src/node_modules/chroma-js/Gruntfile.js
+"use strict";
+
+var fs = require('fs'),
+ pkgInfo = JSON.parse(fs.readFileSync(__dirname + '/package.json'));
+
+module.exports = function(grunt) {
+
+ grunt.initConfig({
+ clean: {
+ pre: [
+ 'chroma.js',
+ 'chroma.min.js',
+ 'license.coffee',
+ ],
+ post: ['chroma.coffee']
+ },
+ coffee: {
+ compile: {
+ options: {
+ join: true
+ },
+ files: {
+ 'chroma.js': [
+ 'license.coffee',
+ 'chroma.coffee'
+ ],
+ },
+ }
+ },
+ replace: {
+ dist: {
+ options: { patterns: [{ match: 'version', replacement: pkgInfo.version }] },
+ files: [{expand: true, flatten: true, src: ['chroma.js'], dest: '.'}]
+ }
+ },
+ uglify: {
+ options: {
+ banner: "/*\n" + fs.readFileSync("LICENSE", {encoding: "utf8"}) + "\n*/\n",
+ },
+ my_target: {
+ files: {
+ 'chroma.min.js': ['chroma.js']
+ },
+ },
+ },
+ copy: {
+ main: {
+ files: [
+ // copy build files into docs folder
+ {expand: true, src: ['chroma*.js'], dest: 'docs/libs/', filter: 'isFile'},
+ ],
+ },
+ },
+ });
+
+ grunt.loadNpmTasks('grunt-contrib-clean');
+ grunt.loadNpmTasks('grunt-contrib-coffee');
+ grunt.loadNpmTasks('grunt-replace');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-contrib-copy');
+
+ grunt.registerTask('license', function() {
+ var license = [
+ "###*",
+ " * @license",
+ " *",
+ ].concat(fs.readFileSync('LICENSE', {encoding: "utf8"}).split("\n").map(function(line) {
+ return " * " + line;
+ }));
+ license.push("###\n");
+ fs.writeFileSync('license.coffee', license.join("\n"));
+ });
+
+ grunt.registerTask('catty', function() {
+ require("catty")({ global: true })
+ .coffee(true)
+ .addLibrary("src")
+ .cat("src/index.coffee", "./chroma.coffee");
+ });
+
+ grunt.registerTask('default', ['clean:pre', 'license', 'catty', 'coffee', 'replace',
+ 'uglify', 'copy', 'clean:post']);
+};
+
src/node_modules/chroma-js/LICENSE
+chroma.js - JavaScript library for color conversions
+
+Copyright (c) 2011-2017, Gregor Aisch
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. The name Gregor Aisch may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
src/node_modules/chroma-js/LICENSE-colors
+chroma.js includes colors from colorbrewer2.org,
+which are released under the following license:
+
+
+Copyright (c) 2002 Cynthia Brewer, Mark Harrower,
+and The Pennsylvania State University.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+either express or implied. See the License for the specific
+language governing permissions and limitations under the License.
+
+
+Named colors are taken from X11 Color Names.
+http://www.w3.org/TR/css3-color/#svg-color
+
src/node_modules/chroma-js/bower.json
+{
+ "name": "chroma-js",
+ "description": "JavaScript library for color conversions",
+ "main": [
+ "./chroma.js"
+ ],
+ "ignore": [
+ "doc",
+ "src",
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "tests"
+ ],
+ "homepage": "https://github.com/gka/chroma.js",
+ "authors": [
+ "Gregor Aisch <contact@vis4.net>"
+ ],
+ "keywords": [
+ "color",
+ "scale",
+ "gradient",
+ "scheme",
+ "rgb",
+ "hsv",
+ "hsl",
+ "css",
+ "lch",
+ "lab",
+ "hcg"
+ ],
+ "license": "MIT"
+}
src/node_modules/chroma-js/chroma.js
+/**
+ * @license
+ *
+ * chroma.js - JavaScript library for color conversions
+ *
+ * Copyright (c) 2011-2017, Gregor Aisch
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name Gregor Aisch may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+(function() {
+ var Color, DEG2RAD, LAB_CONSTANTS, PI, PITHIRD, RAD2DEG, TWOPI, _average_lrgb, _guess_formats, _guess_formats_sorted, _input, _interpolators, abs, atan2, bezier, blend, blend_f, brewer, burn, chroma, clip_rgb, cmyk2rgb, colors, cos, css2rgb, darken, dodge, each, floor, hcg2rgb, hex2rgb, hsi2rgb, hsl2css, hsl2rgb, hsv2rgb, interpolate, interpolate_hsx, interpolate_lab, interpolate_lrgb, interpolate_num, interpolate_rgb, lab2lch, lab2rgb, lab_xyz, lch2lab, lch2rgb, lighten, limit, log, luminance_x, m, max, multiply, normal, num2rgb, overlay, pow, rgb2cmyk, rgb2css, rgb2hcg, rgb2hex, rgb2hsi, rgb2hsl, rgb2hsv, rgb2lab, rgb2lch, rgb2luminance, rgb2num, rgb2temperature, rgb2xyz, rgb_xyz, rnd, root, round, screen, sin, sqrt, temperature2rgb, type, unpack, w3cx11, xyz_lab, xyz_rgb,
+ slice = [].slice;
+
+ type = (function() {
+
+ /*
+ for browser-safe type checking+
+ ported from jQuery's $.type
+ */
+ var classToType, len, name, o, ref;
+ classToType = {};
+ ref = "Boolean Number String Function Array Date RegExp Undefined Null".split(" ");
+ for (o = 0, len = ref.length; o < len; o++) {
+ name = ref[o];
+ classToType["[object " + name + "]"] = name.toLowerCase();
+ }
+ return function(obj) {
+ var strType;
+ strType = Object.prototype.toString.call(obj);
+ return classToType[strType] || "object";
+ };
+ })();
+
+ limit = function(x, min, max) {
+ if (min == null) {
+ min = 0;
+ }
+ if (max == null) {
+ max = 1;
+ }
+ if (x < min) {
+ x = min;
+ }
+ if (x > max) {
+ x = max;
+ }
+ return x;
+ };
+
+ unpack = function(args) {
+ if (args.length >= 3) {
+ return Array.prototype.slice.call(args);
+ } else {
+ return args[0];
+ }
+ };
+
+ clip_rgb = function(rgb) {
+ var i, o;
+ rgb._clipped = false;
+ rgb._unclipped = rgb.slice(0);
+ for (i = o = 0; o < 3; i = ++o) {
+ if (i < 3) {
+ if (rgb[i] < 0 || rgb[i] > 255) {
+ rgb._clipped = true;
+ }
+ if (rgb[i] < 0) {
+ rgb[i] = 0;
+ }
+ if (rgb[i] > 255) {
+ rgb[i] = 255;
+ }
+ } else if (i === 3) {
+ if (rgb[i] < 0) {
+ rgb[i] = 0;
+ }
+ if (rgb[i] > 1) {
+ rgb[i] = 1;
+ }
+ }
+ }
+ if (!rgb._clipped) {
+ delete rgb._unclipped;
+ }
+ return rgb;
+ };
+
+ PI = Math.PI, round = Math.round, cos = Math.cos, floor = Math.floor, pow = Math.pow, log = Math.log, sin = Math.sin, sqrt = Math.sqrt, atan2 = Math.atan2, max = Math.max, abs = Math.abs;
+
+ TWOPI = PI * 2;
+
+ PITHIRD = PI / 3;
+
+ DEG2RAD = PI / 180;
+
+ RAD2DEG = 180 / PI;
+
+ chroma = function() {
+ if (arguments[0] instanceof Color) {
+ return arguments[0];
+ }
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, arguments, function(){});
+ };
+
+ chroma["default"] = chroma;
+
+ _interpolators = [];
+
+ if ((typeof module !== "undefined" && module !== null) && (module.exports != null)) {
+ module.exports = chroma;
+ }
+
+ if (typeof define === 'function' && define.amd) {
+ define([], function() {
+ return chroma;
+ });
+ } else {
+ root = typeof exports !== "undefined" && exports !== null ? exports : this;
+ root.chroma = chroma;
+ }
+
+ chroma.version = '1.4.0';
+
+ _input = {};
+
+ _guess_formats = [];
+
+ _guess_formats_sorted = false;
+
+ Color = (function() {
+ function Color() {
+ var arg, args, chk, len, len1, me, mode, o, w;
+ me = this;
+ args = [];
+ for (o = 0, len = arguments.length; o < len; o++) {
+ arg = arguments[o];
+ if (arg != null) {
+ args.push(arg);
+ }
+ }
+ if (args.length > 1) {
+ mode = args[args.length - 1];
+ }
+ if (_input[mode] != null) {
+ me._rgb = clip_rgb(_input[mode](unpack(args.slice(0, -1))));
+ } else {
+ if (!_guess_formats_sorted) {
+ _guess_formats = _guess_formats.sort(function(a, b) {
+ return b.p - a.p;
+ });
+ _guess_formats_sorted = true;
+ }
+ for (w = 0, len1 = _guess_formats.length; w < len1; w++) {
+ chk = _guess_formats[w];
+ mode = chk.test.apply(chk, args);
+ if (mode) {
+ break;
+ }
+ }
+ if (mode) {
+ me._rgb = clip_rgb(_input[mode].apply(_input, args));
+ }
+ }
+ if (me._rgb == null) {
+ console.warn('unknown format: ' + args);
+ }
+ if (me._rgb == null) {
+ me._rgb = [0, 0, 0];
+ }
+ if (me._rgb.length === 3) {
+ me._rgb.push(1);
+ }
+ }
+
+ Color.prototype.toString = function() {
+ return this.hex();
+ };
+
+ return Color;
+
+ })();
+
+ chroma._input = _input;
+
+
+ /**
+ ColorBrewer colors for chroma.js
+
+ Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The
+ Pennsylvania State University.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software distributed
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations under the License.
+
+ @preserve
+ */
+
+ chroma.brewer = brewer = {
+ OrRd: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000'],
+ PuBu: ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#045a8d', '#023858'],
+ BuPu: ['#f7fcfd', '#e0ecf4', '#bfd3e6', '#9ebcda', '#8c96c6', '#8c6bb1', '#88419d', '#810f7c', '#4d004b'],
+ Oranges: ['#fff5eb', '#fee6ce', '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801', '#a63603', '#7f2704'],
+ BuGn: ['#f7fcfd', '#e5f5f9', '#ccece6', '#99d8c9', '#66c2a4', '#41ae76', '#238b45', '#006d2c', '#00441b'],
+ YlOrBr: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506'],
+ YlGn: ['#ffffe5', '#f7fcb9', '#d9f0a3', '#addd8e', '#78c679', '#41ab5d', '#238443', '#006837', '#004529'],
+ Reds: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d'],
+ RdPu: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a'],
+ Greens: ['#f7fcf5', '#e5f5e0', '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#006d2c', '#00441b'],
+ YlGnBu: ['#ffffd9', '#edf8b1', '#c7e9b4', '#7fcdbb', '#41b6c4', '#1d91c0', '#225ea8', '#253494', '#081d58'],
+ Purples: ['#fcfbfd', '#efedf5', '#dadaeb', '#bcbddc', '#9e9ac8', '#807dba', '#6a51a3', '#54278f', '#3f007d'],
+ GnBu: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081'],
+ Greys: ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525', '#000000'],
+ YlOrRd: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026'],
+ PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f'],
+ Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'],
+ PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],
+ Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825'],
+ Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],
+ RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837'],
+ RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],
+ PiYG: ['#8e0152', '#c51b7d', '#de77ae', '#f1b6da', '#fde0ef', '#f7f7f7', '#e6f5d0', '#b8e186', '#7fbc41', '#4d9221', '#276419'],
+ PRGn: ['#40004b', '#762a83', '#9970ab', '#c2a5cf', '#e7d4e8', '#f7f7f7', '#d9f0d3', '#a6dba0', '#5aae61', '#1b7837', '#00441b'],
+ RdYlBu: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee090', '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', '#4575b4', '#313695'],
+ BrBG: ['#543005', '#8c510a', '#bf812d', '#dfc27d', '#f6e8c3', '#f5f5f5', '#c7eae5', '#80cdc1', '#35978f', '#01665e', '#003c30'],
+ RdGy: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#ffffff', '#e0e0e0', '#bababa', '#878787', '#4d4d4d', '#1a1a1a'],
+ PuOr: ['#7f3b08', '#b35806', '#e08214', '#fdb863', '#fee0b6', '#f7f7f7', '#d8daeb', '#b2abd2', '#8073ac', '#542788', '#2d004b'],
+ Set2: ['#66c2a5', '#fc8d62', '#8da0cb', '#e78ac3', '#a6d854', '#ffd92f', '#e5c494', '#b3b3b3'],
+ Accent: ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f', '#bf5b17', '#666666'],
+ Set1: ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33', '#a65628', '#f781bf', '#999999'],
+ Set3: ['#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f'],
+ Dark2: ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02', '#a6761d', '#666666'],
+ Paired: ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928'],
+ Pastel2: ['#b3e2cd', '#fdcdac', '#cbd5e8', '#f4cae4', '#e6f5c9', '#fff2ae', '#f1e2cc', '#cccccc'],
+ Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2']
+ };
+
+ (function() {
+ var key, results;
+ results = [];
+ for (key in brewer) {
+ results.push(brewer[key.toLowerCase()] = brewer[key]);
+ }
+ return results;
+ })();
+
+
+ /**
+ X11 color names
+
+ http://www.w3.org/TR/css3-color/#svg-color
+ */
+
+ w3cx11 = {
+ aliceblue: '#f0f8ff',
+ antiquewhite: '#faebd7',
+ aqua: '#00ffff',
+ aquamarine: '#7fffd4',
+ azure: '#f0ffff',
+ beige: '#f5f5dc',
+ bisque: '#ffe4c4',
+ black: '#000000',
+ blanchedalmond: '#ffebcd',
+ blue: '#0000ff',
+ blueviolet: '#8a2be2',
+ brown: '#a52a2a',
+ burlywood: '#deb887',
+ cadetblue: '#5f9ea0',
+ chartreuse: '#7fff00',
+ chocolate: '#d2691e',
+ coral: '#ff7f50',
+ cornflower: '#6495ed',
+ cornflowerblue: '#6495ed',
+ cornsilk: '#fff8dc',
+ crimson: '#dc143c',
+ cyan: '#00ffff',
+ darkblue: '#00008b',
+ darkcyan: '#008b8b',
+ darkgoldenrod: '#b8860b',
+ darkgray: '#a9a9a9',
+ darkgreen: '#006400',
+ darkgrey: '#a9a9a9',
+ darkkhaki: '#bdb76b',
+ darkmagenta: '#8b008b',
+ darkolivegreen: '#556b2f',
+ darkorange: '#ff8c00',
+ darkorchid: '#9932cc',
+ darkred: '#8b0000',
+ darksalmon: '#e9967a',
+ darkseagreen: '#8fbc8f',
+ darkslateblue: '#483d8b',
+ darkslategray: '#2f4f4f',
+ darkslategrey: '#2f4f4f',
+ darkturquoise: '#00ced1',
+ darkviolet: '#9400d3',
+ deeppink: '#ff1493',
+ deepskyblue: '#00bfff',
+ dimgray: '#696969',
+ dimgrey: '#696969',
+ dodgerblue: '#1e90ff',
+ firebrick: '#b22222',
+ floralwhite: '#fffaf0',
+ forestgreen: '#228b22',
+ fuchsia: '#ff00ff',
+ gainsboro: '#dcdcdc',
+ ghostwhite: '#f8f8ff',
+ gold: '#ffd700',
+ goldenrod: '#daa520',
+ gray: '#808080',
+ green: '#008000',
+ greenyellow: '#adff2f',
+ grey: '#808080',
+ honeydew: '#f0fff0',
+ hotpink: '#ff69b4',
+ indianred: '#cd5c5c',
+ indigo: '#4b0082',
+ ivory: '#fffff0',
+ khaki: '#f0e68c',
+ laserlemon: '#ffff54',
+ lavender: '#e6e6fa',
+ lavenderblush: '#fff0f5',
+ lawngreen: '#7cfc00',
+ lemonchiffon: '#fffacd',
+ lightblue: '#add8e6',
+ lightcoral: '#f08080',
+ lightcyan: '#e0ffff',
+ lightgoldenrod: '#fafad2',
+ lightgoldenrodyellow: '#fafad2',
+ lightgray: '#d3d3d3',
+ lightgreen: '#90ee90',
+ lightgrey: '#d3d3d3',
+ lightpink: '#ffb6c1',
+ lightsalmon: '#ffa07a',
+ lightseagreen: '#20b2aa',
+ lightskyblue: '#87cefa',
+ lightslategray: '#778899',
+ lightslategrey: '#778899',
+ lightsteelblue: '#b0c4de',
+ lightyellow: '#ffffe0',
+ lime: '#00ff00',
+ limegreen: '#32cd32',
+ linen: '#faf0e6',
+ magenta: '#ff00ff',
+ maroon: '#800000',
+ maroon2: '#7f0000',
+ maroon3: '#b03060',
+ mediumaquamarine: '#66cdaa',
+ mediumblue: '#0000cd',
+ mediumorchid: '#ba55d3',
+ mediumpurple: '#9370db',
+ mediumseagreen: '#3cb371',
+ mediumslateblue: '#7b68ee',
+ mediumspringgreen: '#00fa9a',
+ mediumturquoise: '#48d1cc',
+ mediumvioletred: '#c71585',
+ midnightblue: '#191970',
+ mintcream: '#f5fffa',
+ mistyrose: '#ffe4e1',
+ moccasin: '#ffe4b5',
+ navajowhite: '#ffdead',
+ navy: '#000080',
+ oldlace: '#fdf5e6',
+ olive: '#808000',
+ olivedrab: '#6b8e23',
+ orange: '#ffa500',
+ orangered: '#ff4500',
+ orchid: '#da70d6',
+ palegoldenrod: '#eee8aa',
+ palegreen: '#98fb98',
+ paleturquoise: '#afeeee',
+ palevioletred: '#db7093',
+ papayawhip: '#ffefd5',
+ peachpuff: '#ffdab9',
+ peru: '#cd853f',
+ pink: '#ffc0cb',
+ plum: '#dda0dd',
+ powderblue: '#b0e0e6',
+ purple: '#800080',
+ purple2: '#7f007f',
+ purple3: '#a020f0',
+ rebeccapurple: '#663399',
+ red: '#ff0000',
+ rosybrown: '#bc8f8f',
+ royalblue: '#4169e1',
+ saddlebrown: '#8b4513',
+ salmon: '#fa8072',
+ sandybrown: '#f4a460',
+ seagreen: '#2e8b57',
+ seashell: '#fff5ee',
+ sienna: '#a0522d',
+ silver: '#c0c0c0',
+ skyblue: '#87ceeb',
+ slateblue: '#6a5acd',
+ slategray: '#708090',
+ slategrey: '#708090',
+ snow: '#fffafa',
+ springgreen: '#00ff7f',
+ steelblue: '#4682b4',
+ tan: '#d2b48c',
+ teal: '#008080',
+ thistle: '#d8bfd8',
+ tomato: '#ff6347',
+ turquoise: '#40e0d0',
+ violet: '#ee82ee',
+ wheat: '#f5deb3',
+ white: '#ffffff',
+ whitesmoke: '#f5f5f5',
+ yellow: '#ffff00',
+ yellowgreen: '#9acd32'
+ };
+
+ chroma.colors = colors = w3cx11;
+
+ lab2rgb = function() {
+ var a, args, b, g, l, r, x, y, z;
+ args = unpack(arguments);
+ l = args[0], a = args[1], b = args[2];
+ y = (l + 16) / 116;
+ x = isNaN(a) ? y : y + a / 500;
+ z = isNaN(b) ? y : y - b / 200;
+ y = LAB_CONSTANTS.Yn * lab_xyz(y);
+ x = LAB_CONSTANTS.Xn * lab_xyz(x);
+ z = LAB_CONSTANTS.Zn * lab_xyz(z);
+ r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z);
+ g = xyz_rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z);
+ b = xyz_rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z);
+ return [r, g, b, args.length > 3 ? args[3] : 1];
+ };
+
+ xyz_rgb = function(r) {
+ return 255 * (r <= 0.00304 ? 12.92 * r : 1.055 * pow(r, 1 / 2.4) - 0.055);
+ };
+
+ lab_xyz = function(t) {
+ if (t > LAB_CONSTANTS.t1) {
+ return t * t * t;
+ } else {
+ return LAB_CONSTANTS.t2 * (t - LAB_CONSTANTS.t0);
+ }
+ };
+
+ LAB_CONSTANTS = {
+ Kn: 18,
+ Xn: 0.950470,
+ Yn: 1,
+ Zn: 1.088830,
+ t0: 0.137931034,
+ t1: 0.206896552,
+ t2: 0.12841855,
+ t3: 0.008856452
+ };
+
+ rgb2lab = function() {
+ var b, g, r, ref, ref1, x, y, z;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ ref1 = rgb2xyz(r, g, b), x = ref1[0], y = ref1[1], z = ref1[2];
+ return [116 * y - 16, 500 * (x - y), 200 * (y - z)];
+ };
+
+ rgb_xyz = function(r) {
+ if ((r /= 255) <= 0.04045) {
+ return r / 12.92;
+ } else {
+ return pow((r + 0.055) / 1.055, 2.4);
+ }
+ };
+
+ xyz_lab = function(t) {
+ if (t > LAB_CONSTANTS.t3) {
+ return pow(t, 1 / 3);
+ } else {
+ return t / LAB_CONSTANTS.t2 + LAB_CONSTANTS.t0;
+ }
+ };
+
+ rgb2xyz = function() {
+ var b, g, r, ref, x, y, z;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ r = rgb_xyz(r);
+ g = rgb_xyz(g);
+ b = rgb_xyz(b);
+ x = xyz_lab((0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / LAB_CONSTANTS.Xn);
+ y = xyz_lab((0.2126729 * r + 0.7151522 * g + 0.0721750 * b) / LAB_CONSTANTS.Yn);
+ z = xyz_lab((0.0193339 * r + 0.1191920 * g + 0.9503041 * b) / LAB_CONSTANTS.Zn);
+ return [x, y, z];
+ };
+
+ chroma.lab = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['lab']), function(){});
+ };
+
+ _input.lab = lab2rgb;
+
+ Color.prototype.lab = function() {
+ return rgb2lab(this._rgb);
+ };
+
+ bezier = function(colors) {
+ var I, I0, I1, c, lab0, lab1, lab2, lab3, ref, ref1, ref2;
+ colors = (function() {
+ var len, o, results;
+ results = [];
+ for (o = 0, len = colors.length; o < len; o++) {
+ c = colors[o];
+ results.push(chroma(c));
+ }
+ return results;
+ })();
+ if (colors.length === 2) {
+ ref = (function() {
+ var len, o, results;
+ results = [];
+ for (o = 0, len = colors.length; o < len; o++) {
+ c = colors[o];
+ results.push(c.lab());
+ }
+ return results;
+ })(), lab0 = ref[0], lab1 = ref[1];
+ I = function(t) {
+ var i, lab;
+ lab = (function() {
+ var o, results;
+ results = [];
+ for (i = o = 0; o <= 2; i = ++o) {
+ results.push(lab0[i] + t * (lab1[i] - lab0[i]));
+ }
+ return results;
+ })();
+ return chroma.lab.apply(chroma, lab);
+ };
+ } else if (colors.length === 3) {
+ ref1 = (function() {
+ var len, o, results;
+ results = [];
+ for (o = 0, len = colors.length; o < len; o++) {
+ c = colors[o];
+ results.push(c.lab());
+ }
+ return results;
+ })(), lab0 = ref1[0], lab1 = ref1[1], lab2 = ref1[2];
+ I = function(t) {
+ var i, lab;
+ lab = (function() {
+ var o, results;
+ results = [];
+ for (i = o = 0; o <= 2; i = ++o) {
+ results.push((1 - t) * (1 - t) * lab0[i] + 2 * (1 - t) * t * lab1[i] + t * t * lab2[i]);
+ }
+ return results;
+ })();
+ return chroma.lab.apply(chroma, lab);
+ };
+ } else if (colors.length === 4) {
+ ref2 = (function() {
+ var len, o, results;
+ results = [];
+ for (o = 0, len = colors.length; o < len; o++) {
+ c = colors[o];
+ results.push(c.lab());
+ }
+ return results;
+ })(), lab0 = ref2[0], lab1 = ref2[1], lab2 = ref2[2], lab3 = ref2[3];
+ I = function(t) {
+ var i, lab;
+ lab = (function() {
+ var o, results;
+ results = [];
+ for (i = o = 0; o <= 2; i = ++o) {
+ results.push((1 - t) * (1 - t) * (1 - t) * lab0[i] + 3 * (1 - t) * (1 - t) * t * lab1[i] + 3 * (1 - t) * t * t * lab2[i] + t * t * t * lab3[i]);
+ }
+ return results;
+ })();
+ return chroma.lab.apply(chroma, lab);
+ };
+ } else if (colors.length === 5) {
+ I0 = bezier(colors.slice(0, 3));
+ I1 = bezier(colors.slice(2, 5));
+ I = function(t) {
+ if (t < 0.5) {
+ return I0(t * 2);
+ } else {
+ return I1((t - 0.5) * 2);
+ }
+ };
+ }
+ return I;
+ };
+
+ chroma.bezier = function(colors) {
+ var f;
+ f = bezier(colors);
+ f.scale = function() {
+ return chroma.scale(f);
+ };
+ return f;
+ };
+
+ chroma.cubehelix = function(start, rotations, hue, gamma, lightness) {
+ var dh, dl, f;
+ if (start == null) {
+ start = 300;
+ }
+ if (rotations == null) {
+ rotations = -1.5;
+ }
+ if (hue == null) {
+ hue = 1;
+ }
+ if (gamma == null) {
+ gamma = 1;
+ }
+ if (lightness == null) {
+ lightness = [0, 1];
+ }
+ dh = 0;
+ if (type(lightness) === 'array') {
+ dl = lightness[1] - lightness[0];
+ } else {
+ dl = 0;
+ lightness = [lightness, lightness];
+ }
+ f = function(fract) {
+ var a, amp, b, cos_a, g, h, l, r, sin_a;
+ a = TWOPI * ((start + 120) / 360 + rotations * fract);
+ l = pow(lightness[0] + dl * fract, gamma);
+ h = dh !== 0 ? hue[0] + fract * dh : hue;
+ amp = h * l * (1 - l) / 2;
+ cos_a = cos(a);
+ sin_a = sin(a);
+ r = l + amp * (-0.14861 * cos_a + 1.78277 * sin_a);
+ g = l + amp * (-0.29227 * cos_a - 0.90649 * sin_a);
+ b = l + amp * (+1.97294 * cos_a);
+ return chroma(clip_rgb([r * 255, g * 255, b * 255, 1]));
+ };
+ f.start = function(s) {
+ if (s == null) {
+ return start;
+ }
+ start = s;
+ return f;
+ };
+ f.rotations = function(r) {
+ if (r == null) {
+ return rotations;
+ }
+ rotations = r;
+ return f;
+ };
+ f.gamma = function(g) {
+ if (g == null) {
+ return gamma;
+ }
+ gamma = g;
+ return f;
+ };
+ f.hue = function(h) {
+ if (h == null) {
+ return hue;
+ }
+ hue = h;
+ if (type(hue) === 'array') {
+ dh = hue[1] - hue[0];
+ if (dh === 0) {
+ hue = hue[1];
+ }
+ } else {
+ dh = 0;
+ }
+ return f;
+ };
+ f.lightness = function(h) {
+ if (h == null) {
+ return lightness;
+ }
+ if (type(h) === 'array') {
+ lightness = h;
+ dl = h[1] - h[0];
+ } else {
+ lightness = [h, h];
+ dl = 0;
+ }
+ return f;
+ };
+ f.scale = function() {
+ return chroma.scale(f);
+ };
+ f.hue(hue);
+ return f;
+ };
+
+ chroma.random = function() {
+ var code, digits, i, o;
+ digits = '0123456789abcdef';
+ code = '#';
+ for (i = o = 0; o < 6; i = ++o) {
+ code += digits.charAt(floor(Math.random() * 16));
+ }
+ return new Color(code);
+ };
+
+ _interpolators = [];
+
+ interpolate = function(col1, col2, f, m) {
+ var interpol, len, o, res;
+ if (f == null) {
+ f = 0.5;
+ }
+ if (m == null) {
+ m = 'rgb';
+ }
+
+ /*
+ interpolates between colors
+ f = 0 --> me
+ f = 1 --> col
+ */
+ if (type(col1) !== 'object') {
+ col1 = chroma(col1);
+ }
+ if (type(col2) !== 'object') {
+ col2 = chroma(col2);
+ }
+ for (o = 0, len = _interpolators.length; o < len; o++) {
+ interpol = _interpolators[o];
+ if (m === interpol[0]) {
+ res = interpol[1](col1, col2, f, m);
+ break;
+ }
+ }
+ if (res == null) {
+ throw "color mode " + m + " is not supported";
+ }
+ return res.alpha(col1.alpha() + f * (col2.alpha() - col1.alpha()));
+ };
+
+ chroma.interpolate = interpolate;
+
+ Color.prototype.interpolate = function(col2, f, m) {
+ return interpolate(this, col2, f, m);
+ };
+
+ chroma.mix = interpolate;
+
+ Color.prototype.mix = Color.prototype.interpolate;
+
+ _input.rgb = function() {
+ var k, ref, results, v;
+ ref = unpack(arguments);
+ results = [];
+ for (k in ref) {
+ v = ref[k];
+ results.push(v);
+ }
+ return results;
+ };
+
+ chroma.rgb = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['rgb']), function(){});
+ };
+
+ Color.prototype.rgb = function(round) {
+ if (round == null) {
+ round = true;
+ }
+ if (round) {
+ return this._rgb.map(Math.round).slice(0, 3);
+ } else {
+ return this._rgb.slice(0, 3);
+ }
+ };
+
+ Color.prototype.rgba = function(round) {
+ if (round == null) {
+ round = true;
+ }
+ if (!round) {
+ return this._rgb.slice(0);
+ }
+ return [Math.round(this._rgb[0]), Math.round(this._rgb[1]), Math.round(this._rgb[2]), this._rgb[3]];
+ };
+
+ _guess_formats.push({
+ p: 3,
+ test: function(n) {
+ var a;
+ a = unpack(arguments);
+ if (type(a) === 'array' && a.length === 3) {
+ return 'rgb';
+ }
+ if (a.length === 4 && type(a[3]) === "number" && a[3] >= 0 && a[3] <= 1) {
+ return 'rgb';
+ }
+ }
+ });
+
+ _input.lrgb = _input.rgb;
+
+ interpolate_lrgb = function(col1, col2, f, m) {
+ var xyz0, xyz1;
+ xyz0 = col1._rgb;
+ xyz1 = col2._rgb;
+ return new Color(sqrt(pow(xyz0[0], 2) * (1 - f) + pow(xyz1[0], 2) * f), sqrt(pow(xyz0[1], 2) * (1 - f) + pow(xyz1[1], 2) * f), sqrt(pow(xyz0[2], 2) * (1 - f) + pow(xyz1[2], 2) * f), m);
+ };
+
+ _average_lrgb = function(colors) {
+ var col, f, len, o, rgb, xyz;
+ f = 1 / colors.length;
+ xyz = [0, 0, 0, 0];
+ for (o = 0, len = colors.length; o < len; o++) {
+ col = colors[o];
+ rgb = col._rgb;
+ xyz[0] += pow(rgb[0], 2) * f;
+ xyz[1] += pow(rgb[1], 2) * f;
+ xyz[2] += pow(rgb[2], 2) * f;
+ xyz[3] += rgb[3] * f;
+ }
+ xyz[0] = sqrt(xyz[0]);
+ xyz[1] = sqrt(xyz[1]);
+ xyz[2] = sqrt(xyz[2]);
+ if (xyz[3] > 1) {
+ xyz[3] = 1;
+ }
+ return new Color(clip_rgb(xyz));
+ };
+
+ _interpolators.push(['lrgb', interpolate_lrgb]);
+
+ chroma.average = function(colors, mode) {
+ var A, alpha, c, cnt, dx, dy, first, i, l, len, o, xyz, xyz2;
+ if (mode == null) {
+ mode = 'rgb';
+ }
+ l = colors.length;
+ colors = colors.map(function(c) {
+ return chroma(c);
+ });
+ first = colors.splice(0, 1)[0];
+ if (mode === 'lrgb') {
+ return _average_lrgb(colors);
+ }
+ xyz = first.get(mode);
+ cnt = [];
+ dx = 0;
+ dy = 0;
+ for (i in xyz) {
+ xyz[i] = xyz[i] || 0;
+ cnt.push(isNaN(xyz[i]) ? 0 : 1);
+ if (mode.charAt(i) === 'h' && !isNaN(xyz[i])) {
+ A = xyz[i] / 180 * PI;
+ dx += cos(A);
+ dy += sin(A);
+ }
+ }
+ alpha = first.alpha();
+ for (o = 0, len = colors.length; o < len; o++) {
+ c = colors[o];
+ xyz2 = c.get(mode);
+ alpha += c.alpha();
+ for (i in xyz) {
+ if (!isNaN(xyz2[i])) {
+ cnt[i] += 1;
+ if (mode.charAt(i) === 'h') {
+ A = xyz2[i] / 180 * PI;
+ dx += cos(A);
+ dy += sin(A);
+ } else {
+ xyz[i] += xyz2[i];
+ }
+ }
+ }
+ }
+ for (i in xyz) {
+ if (mode.charAt(i) === 'h') {
+ A = atan2(dy / cnt[i], dx / cnt[i]) / PI * 180;
+ while (A < 0) {
+ A += 360;
+ }
+ while (A >= 360) {
+ A -= 360;
+ }
+ xyz[i] = A;
+ } else {
+ xyz[i] = xyz[i] / cnt[i];
+ }
+ }
+ return chroma(xyz, mode).alpha(alpha / l);
+ };
+
+ hex2rgb = function(hex) {
+ var a, b, g, r, rgb, u;
+ if (hex.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)) {
+ if (hex.length === 4 || hex.length === 7) {
+ hex = hex.substr(1);
+ }
+ if (hex.length === 3) {
+ hex = hex.split("");
+ hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
+ }
+ u = parseInt(hex, 16);
+ r = u >> 16;
+ g = u >> 8 & 0xFF;
+ b = u & 0xFF;
+ return [r, g, b, 1];
+ }
+ if (hex.match(/^#?([A-Fa-f0-9]{8})$/)) {
+ if (hex.length === 9) {
+ hex = hex.substr(1);
+ }
+ u = parseInt(hex, 16);
+ r = u >> 24 & 0xFF;
+ g = u >> 16 & 0xFF;
+ b = u >> 8 & 0xFF;
+ a = round((u & 0xFF) / 0xFF * 100) / 100;
+ return [r, g, b, a];
+ }
+ if ((_input.css != null) && (rgb = _input.css(hex))) {
+ return rgb;
+ }
+ throw "unknown color: " + hex;
+ };
+
+ rgb2hex = function(channels, mode) {
+ var a, b, g, hxa, r, str, u;
+ if (mode == null) {
+ mode = 'auto';
+ }
+ r = channels[0], g = channels[1], b = channels[2], a = channels[3];
+ if (mode === 'auto') {
+ mode = a < 1 ? 'rgba' : 'rgb';
+ }
+ r = Math.round(r);
+ g = Math.round(g);
+ b = Math.round(b);
+ u = r << 16 | g << 8 | b;
+ str = "000000" + u.toString(16);
+ str = str.substr(str.length - 6);
+ hxa = '0' + round(a * 255).toString(16);
+ hxa = hxa.substr(hxa.length - 2);
+ return "#" + (function() {
+ switch (mode.toLowerCase()) {
+ case 'rgba':
+ return str + hxa;
+ case 'argb':
+ return hxa + str;
+ default:
+ return str;
+ }
+ })();
+ };
+
+ _input.hex = function(h) {
+ return hex2rgb(h);
+ };
+
+ chroma.hex = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['hex']), function(){});
+ };
+
+ Color.prototype.hex = function(mode) {
+ if (mode == null) {
+ mode = 'auto';
+ }
+ return rgb2hex(this._rgb, mode);
+ };
+
+ _guess_formats.push({
+ p: 4,
+ test: function(n) {
+ if (arguments.length === 1 && type(n) === "string") {
+ return 'hex';
+ }
+ }
+ });
+
+ hsl2rgb = function() {
+ var args, b, c, g, h, i, l, o, r, ref, s, t1, t2, t3;
+ args = unpack(arguments);
+ h = args[0], s = args[1], l = args[2];
+ if (s === 0) {
+ r = g = b = l * 255;
+ } else {
+ t3 = [0, 0, 0];
+ c = [0, 0, 0];
+ t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
+ t1 = 2 * l - t2;
+ h /= 360;
+ t3[0] = h + 1 / 3;
+ t3[1] = h;
+ t3[2] = h - 1 / 3;
+ for (i = o = 0; o <= 2; i = ++o) {
+ if (t3[i] < 0) {
+ t3[i] += 1;
+ }
+ if (t3[i] > 1) {
+ t3[i] -= 1;
+ }
+ if (6 * t3[i] < 1) {
+ c[i] = t1 + (t2 - t1) * 6 * t3[i];
+ } else if (2 * t3[i] < 1) {
+ c[i] = t2;
+ } else if (3 * t3[i] < 2) {
+ c[i] = t1 + (t2 - t1) * ((2 / 3) - t3[i]) * 6;
+ } else {
+ c[i] = t1;
+ }
+ }
+ ref = [round(c[0] * 255), round(c[1] * 255), round(c[2] * 255)], r = ref[0], g = ref[1], b = ref[2];
+ }
+ if (args.length > 3) {
+ return [r, g, b, args[3]];
+ } else {
+ return [r, g, b];
+ }
+ };
+
+ rgb2hsl = function(r, g, b) {
+ var h, l, min, ref, s;
+ if (r !== void 0 && r.length >= 3) {
+ ref = r, r = ref[0], g = ref[1], b = ref[2];
+ }
+ r /= 255;
+ g /= 255;
+ b /= 255;
+ min = Math.min(r, g, b);
+ max = Math.max(r, g, b);
+ l = (max + min) / 2;
+ if (max === min) {
+ s = 0;
+ h = Number.NaN;
+ } else {
+ s = l < 0.5 ? (max - min) / (max + min) : (max - min) / (2 - max - min);
+ }
+ if (r === max) {
+ h = (g - b) / (max - min);
+ } else if (g === max) {
+ h = 2 + (b - r) / (max - min);
+ } else if (b === max) {
+ h = 4 + (r - g) / (max - min);
+ }
+ h *= 60;
+ if (h < 0) {
+ h += 360;
+ }
+ return [h, s, l];
+ };
+
+ chroma.hsl = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['hsl']), function(){});
+ };
+
+ _input.hsl = hsl2rgb;
+
+ Color.prototype.hsl = function() {
+ return rgb2hsl(this._rgb);
+ };
+
+ hsv2rgb = function() {
+ var args, b, f, g, h, i, p, q, r, ref, ref1, ref2, ref3, ref4, ref5, s, t, v;
+ args = unpack(arguments);
+ h = args[0], s = args[1], v = args[2];
+ v *= 255;
+ if (s === 0) {
+ r = g = b = v;
+ } else {
+ if (h === 360) {
+ h = 0;
+ }
+ if (h > 360) {
+ h -= 360;
+ }
+ if (h < 0) {
+ h += 360;
+ }
+ h /= 60;
+ i = floor(h);
+ f = h - i;
+ p = v * (1 - s);
+ q = v * (1 - s * f);
+ t = v * (1 - s * (1 - f));
+ switch (i) {
+ case 0:
+ ref = [v, t, p], r = ref[0], g = ref[1], b = ref[2];
+ break;
+ case 1:
+ ref1 = [q, v, p], r = ref1[0], g = ref1[1], b = ref1[2];
+ break;
+ case 2:
+ ref2 = [p, v, t], r = ref2[0], g = ref2[1], b = ref2[2];
+ break;
+ case 3:
+ ref3 = [p, q, v], r = ref3[0], g = ref3[1], b = ref3[2];
+ break;
+ case 4:
+ ref4 = [t, p, v], r = ref4[0], g = ref4[1], b = ref4[2];
+ break;
+ case 5:
+ ref5 = [v, p, q], r = ref5[0], g = ref5[1], b = ref5[2];
+ }
+ }
+ return [r, g, b, args.length > 3 ? args[3] : 1];
+ };
+
+ rgb2hsv = function() {
+ var b, delta, g, h, min, r, ref, s, v;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ min = Math.min(r, g, b);
+ max = Math.max(r, g, b);
+ delta = max - min;
+ v = max / 255.0;
+ if (max === 0) {
+ h = Number.NaN;
+ s = 0;
+ } else {
+ s = delta / max;
+ if (r === max) {
+ h = (g - b) / delta;
+ }
+ if (g === max) {
+ h = 2 + (b - r) / delta;
+ }
+ if (b === max) {
+ h = 4 + (r - g) / delta;
+ }
+ h *= 60;
+ if (h < 0) {
+ h += 360;
+ }
+ }
+ return [h, s, v];
+ };
+
+ chroma.hsv = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['hsv']), function(){});
+ };
+
+ _input.hsv = hsv2rgb;
+
+ Color.prototype.hsv = function() {
+ return rgb2hsv(this._rgb);
+ };
+
+ num2rgb = function(num) {
+ var b, g, r;
+ if (type(num) === "number" && num >= 0 && num <= 0xFFFFFF) {
+ r = num >> 16;
+ g = (num >> 8) & 0xFF;
+ b = num & 0xFF;
+ return [r, g, b, 1];
+ }
+ console.warn("unknown num color: " + num);
+ return [0, 0, 0, 1];
+ };
+
+ rgb2num = function() {
+ var b, g, r, ref;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ return (r << 16) + (g << 8) + b;
+ };
+
+ chroma.num = function(num) {
+ return new Color(num, 'num');
+ };
+
+ Color.prototype.num = function(mode) {
+ if (mode == null) {
+ mode = 'rgb';
+ }
+ return rgb2num(this._rgb, mode);
+ };
+
+ _input.num = num2rgb;
+
+ _guess_formats.push({
+ p: 1,
+ test: function(n) {
+ if (arguments.length === 1 && type(n) === "number" && n >= 0 && n <= 0xFFFFFF) {
+ return 'num';
+ }
+ }
+ });
+
+ hcg2rgb = function() {
+ var _c, _g, args, b, c, f, g, h, i, p, q, r, ref, ref1, ref2, ref3, ref4, ref5, t, v;
+ args = unpack(arguments);
+ h = args[0], c = args[1], _g = args[2];
+ c = c / 100;
+ g = g / 100 * 255;
+ _c = c * 255;
+ if (c === 0) {
+ r = g = b = _g;
+ } else {
+ if (h === 360) {
+ h = 0;
+ }
+ if (h > 360) {
+ h -= 360;
+ }
+ if (h < 0) {
+ h += 360;
+ }
+ h /= 60;
+ i = floor(h);
+ f = h - i;
+ p = _g * (1 - c);
+ q = p + _c * (1 - f);
+ t = p + _c * f;
+ v = p + _c;
+ switch (i) {
+ case 0:
+ ref = [v, t, p], r = ref[0], g = ref[1], b = ref[2];
+ break;
+ case 1:
+ ref1 = [q, v, p], r = ref1[0], g = ref1[1], b = ref1[2];
+ break;
+ case 2:
+ ref2 = [p, v, t], r = ref2[0], g = ref2[1], b = ref2[2];
+ break;
+ case 3:
+ ref3 = [p, q, v], r = ref3[0], g = ref3[1], b = ref3[2];
+ break;
+ case 4:
+ ref4 = [t, p, v], r = ref4[0], g = ref4[1], b = ref4[2];
+ break;
+ case 5:
+ ref5 = [v, p, q], r = ref5[0], g = ref5[1], b = ref5[2];
+ }
+ }
+ return [r, g, b, args.length > 3 ? args[3] : 1];
+ };
+
+ rgb2hcg = function() {
+ var _g, b, c, delta, g, h, min, r, ref;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ min = Math.min(r, g, b);
+ max = Math.max(r, g, b);
+ delta = max - min;
+ c = delta * 100 / 255;
+ _g = min / (255 - delta) * 100;
+ if (delta === 0) {
+ h = Number.NaN;
+ } else {
+ if (r === max) {
+ h = (g - b) / delta;
+ }
+ if (g === max) {
+ h = 2 + (b - r) / delta;
+ }
+ if (b === max) {
+ h = 4 + (r - g) / delta;
+ }
+ h *= 60;
+ if (h < 0) {
+ h += 360;
+ }
+ }
+ return [h, c, _g];
+ };
+
+ chroma.hcg = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['hcg']), function(){});
+ };
+
+ _input.hcg = hcg2rgb;
+
+ Color.prototype.hcg = function() {
+ return rgb2hcg(this._rgb);
+ };
+
+ css2rgb = function(css) {
+ var aa, ab, hsl, i, m, o, rgb, w;
+ css = css.toLowerCase();
+ if ((chroma.colors != null) && chroma.colors[css]) {
+ return hex2rgb(chroma.colors[css]);
+ }
+ if (m = css.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)) {
+ rgb = m.slice(1, 4);
+ for (i = o = 0; o <= 2; i = ++o) {
+ rgb[i] = +rgb[i];
+ }
+ rgb[3] = 1;
+ } else if (m = css.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/)) {
+ rgb = m.slice(1, 5);
+ for (i = w = 0; w <= 3; i = ++w) {
+ rgb[i] = +rgb[i];
+ }
+ } else if (m = css.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)) {
+ rgb = m.slice(1, 4);
+ for (i = aa = 0; aa <= 2; i = ++aa) {
+ rgb[i] = round(rgb[i] * 2.55);
+ }
+ rgb[3] = 1;
+ } else if (m = css.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)) {
+ rgb = m.slice(1, 5);
+ for (i = ab = 0; ab <= 2; i = ++ab) {
+ rgb[i] = round(rgb[i] * 2.55);
+ }
+ rgb[3] = +rgb[3];
+ } else if (m = css.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)) {
+ hsl = m.slice(1, 4);
+ hsl[1] *= 0.01;
+ hsl[2] *= 0.01;
+ rgb = hsl2rgb(hsl);
+ rgb[3] = 1;
+ } else if (m = css.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)) {
+ hsl = m.slice(1, 4);
+ hsl[1] *= 0.01;
+ hsl[2] *= 0.01;
+ rgb = hsl2rgb(hsl);
+ rgb[3] = +m[4];
+ }
+ return rgb;
+ };
+
+ rgb2css = function(rgba) {
+ var mode;
+ mode = rgba[3] < 1 ? 'rgba' : 'rgb';
+ if (mode === 'rgb') {
+ return mode + '(' + rgba.slice(0, 3).map(round).join(',') + ')';
+ } else if (mode === 'rgba') {
+ return mode + '(' + rgba.slice(0, 3).map(round).join(',') + ',' + rgba[3] + ')';
+ } else {
+
+ }
+ };
+
+ rnd = function(a) {
+ return round(a * 100) / 100;
+ };
+
+ hsl2css = function(hsl, alpha) {
+ var mode;
+ mode = alpha < 1 ? 'hsla' : 'hsl';
+ hsl[0] = rnd(hsl[0] || 0);
+ hsl[1] = rnd(hsl[1] * 100) + '%';
+ hsl[2] = rnd(hsl[2] * 100) + '%';
+ if (mode === 'hsla') {
+ hsl[3] = alpha;
+ }
+ return mode + '(' + hsl.join(',') + ')';
+ };
+
+ _input.css = function(h) {
+ return css2rgb(h);
+ };
+
+ chroma.css = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['css']), function(){});
+ };
+
+ Color.prototype.css = function(mode) {
+ if (mode == null) {
+ mode = 'rgb';
+ }
+ if (mode.slice(0, 3) === 'rgb') {
+ return rgb2css(this._rgb);
+ } else if (mode.slice(0, 3) === 'hsl') {
+ return hsl2css(this.hsl(), this.alpha());
+ }
+ };
+
+ _input.named = function(name) {
+ return hex2rgb(w3cx11[name]);
+ };
+
+ _guess_formats.push({
+ p: 5,
+ test: function(n) {
+ if (arguments.length === 1 && (w3cx11[n] != null)) {
+ return 'named';
+ }
+ }
+ });
+
+ Color.prototype.name = function(n) {
+ var h, k;
+ if (arguments.length) {
+ if (w3cx11[n]) {
+ this._rgb = hex2rgb(w3cx11[n]);
+ }
+ this._rgb[3] = 1;
+ this;
+ }
+ h = this.hex('rgb');
+ for (k in w3cx11) {
+ if (h === w3cx11[k]) {
+ return k;
+ }
+ }
+ return h;
+ };
+
+ lch2lab = function() {
+
+ /*
+ Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.
+ These formulas were invented by David Dalrymple to obtain maximum contrast without going
+ out of gamut if the parameters are in the range 0-1.
+
+ A saturation multiplier was added by Gregor Aisch
+ */
+ var c, h, l, ref;
+ ref = unpack(arguments), l = ref[0], c = ref[1], h = ref[2];
+ h = h * DEG2RAD;
+ return [l, cos(h) * c, sin(h) * c];
+ };
+
+ lch2rgb = function() {
+ var L, a, args, b, c, g, h, l, r, ref, ref1;
+ args = unpack(arguments);
+ l = args[0], c = args[1], h = args[2];
+ ref = lch2lab(l, c, h), L = ref[0], a = ref[1], b = ref[2];
+ ref1 = lab2rgb(L, a, b), r = ref1[0], g = ref1[1], b = ref1[2];
+ return [r, g, b, args.length > 3 ? args[3] : 1];
+ };
+
+ lab2lch = function() {
+ var a, b, c, h, l, ref;
+ ref = unpack(arguments), l = ref[0], a = ref[1], b = ref[2];
+ c = sqrt(a * a + b * b);
+ h = (atan2(b, a) * RAD2DEG + 360) % 360;
+ if (round(c * 10000) === 0) {
+ h = Number.NaN;
+ }
+ return [l, c, h];
+ };
+
+ rgb2lch = function() {
+ var a, b, g, l, r, ref, ref1;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ ref1 = rgb2lab(r, g, b), l = ref1[0], a = ref1[1], b = ref1[2];
+ return lab2lch(l, a, b);
+ };
+
+ chroma.lch = function() {
+ var args;
+ args = unpack(arguments);
+ return new Color(args, 'lch');
+ };
+
+ chroma.hcl = function() {
+ var args;
+ args = unpack(arguments);
+ return new Color(args, 'hcl');
+ };
+
+ _input.lch = lch2rgb;
+
+ _input.hcl = function() {
+ var c, h, l, ref;
+ ref = unpack(arguments), h = ref[0], c = ref[1], l = ref[2];
+ return lch2rgb([l, c, h]);
+ };
+
+ Color.prototype.lch = function() {
+ return rgb2lch(this._rgb);
+ };
+
+ Color.prototype.hcl = function() {
+ return rgb2lch(this._rgb).reverse();
+ };
+
+ rgb2cmyk = function(mode) {
+ var b, c, f, g, k, m, r, ref, y;
+ if (mode == null) {
+ mode = 'rgb';
+ }
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ r = r / 255;
+ g = g / 255;
+ b = b / 255;
+ k = 1 - Math.max(r, Math.max(g, b));
+ f = k < 1 ? 1 / (1 - k) : 0;
+ c = (1 - r - k) * f;
+ m = (1 - g - k) * f;
+ y = (1 - b - k) * f;
+ return [c, m, y, k];
+ };
+
+ cmyk2rgb = function() {
+ var alpha, args, b, c, g, k, m, r, y;
+ args = unpack(arguments);
+ c = args[0], m = args[1], y = args[2], k = args[3];
+ alpha = args.length > 4 ? args[4] : 1;
+ if (k === 1) {
+ return [0, 0, 0, alpha];
+ }
+ r = c >= 1 ? 0 : 255 * (1 - c) * (1 - k);
+ g = m >= 1 ? 0 : 255 * (1 - m) * (1 - k);
+ b = y >= 1 ? 0 : 255 * (1 - y) * (1 - k);
+ return [r, g, b, alpha];
+ };
+
+ _input.cmyk = function() {
+ return cmyk2rgb(unpack(arguments));
+ };
+
+ chroma.cmyk = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['cmyk']), function(){});
+ };
+
+ Color.prototype.cmyk = function() {
+ return rgb2cmyk(this._rgb);
+ };
+
+ _input.gl = function() {
+ var i, k, o, rgb, v;
+ rgb = (function() {
+ var ref, results;
+ ref = unpack(arguments);
+ results = [];
+ for (k in ref) {
+ v = ref[k];
+ results.push(v);
+ }
+ return results;
+ }).apply(this, arguments);
+ for (i = o = 0; o <= 2; i = ++o) {
+ rgb[i] *= 255;
+ }
+ return rgb;
+ };
+
+ chroma.gl = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['gl']), function(){});
+ };
+
+ Color.prototype.gl = function() {
+ var rgb;
+ rgb = this._rgb;
+ return [rgb[0] / 255, rgb[1] / 255, rgb[2] / 255, rgb[3]];
+ };
+
+ rgb2luminance = function(r, g, b) {
+ var ref;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ r = luminance_x(r);
+ g = luminance_x(g);
+ b = luminance_x(b);
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
+ };
+
+ luminance_x = function(x) {
+ x /= 255;
+ if (x <= 0.03928) {
+ return x / 12.92;
+ } else {
+ return pow((x + 0.055) / 1.055, 2.4);
+ }
+ };
+
+ interpolate_rgb = function(col1, col2, f, m) {
+ var xyz0, xyz1;
+ xyz0 = col1._rgb;
+ xyz1 = col2._rgb;
+ return new Color(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), m);
+ };
+
+ _interpolators.push(['rgb', interpolate_rgb]);
+
+ Color.prototype.luminance = function(lum, mode) {
+ var cur_lum, eps, max_iter, rgba, test;
+ if (mode == null) {
+ mode = 'rgb';
+ }
+ if (!arguments.length) {
+ return rgb2luminance(this._rgb);
+ }
+ rgba = this._rgb;
+ if (lum === 0) {
+ rgba = [0, 0, 0, this._rgb[3]];
+ } else if (lum === 1) {
+ rgba = [255, 255, 255, this[3]];
+ } else {
+ cur_lum = rgb2luminance(this._rgb);
+ eps = 1e-7;
+ max_iter = 20;
+ test = function(l, h) {
+ var lm, m;
+ m = l.interpolate(h, 0.5, mode);
+ lm = m.luminance();
+ if (Math.abs(lum - lm) < eps || !max_iter--) {
+ return m;
+ }
+ if (lm > lum) {
+ return test(l, m);
+ }
+ return test(m, h);
+ };
+ if (cur_lum > lum) {
+ rgba = test(chroma('black'), this).rgba();
+ } else {
+ rgba = test(this, chroma('white')).rgba();
+ }
+ }
+ return chroma(rgba).alpha(this.alpha());
+ };
+
+ temperature2rgb = function(kelvin) {
+ var b, g, r, temp;
+ temp = kelvin / 100;
+ if (temp < 66) {
+ r = 255;
+ g = -155.25485562709179 - 0.44596950469579133 * (g = temp - 2) + 104.49216199393888 * log(g);
+ b = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b = temp - 10) + 115.67994401066147 * log(b);
+ } else {
+ r = 351.97690566805693 + 0.114206453784165 * (r = temp - 55) - 40.25366309332127 * log(r);
+ g = 325.4494125711974 + 0.07943456536662342 * (g = temp - 50) - 28.0852963507957 * log(g);
+ b = 255;
+ }
+ return [r, g, b];
+ };
+
+ rgb2temperature = function() {
+ var b, eps, g, maxTemp, minTemp, r, ref, rgb, temp;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ minTemp = 1000;
+ maxTemp = 40000;
+ eps = 0.4;
+ while (maxTemp - minTemp > eps) {
+ temp = (maxTemp + minTemp) * 0.5;
+ rgb = temperature2rgb(temp);
+ if ((rgb[2] / rgb[0]) >= (b / r)) {
+ maxTemp = temp;
+ } else {
+ minTemp = temp;
+ }
+ }
+ return round(temp);
+ };
+
+ chroma.temperature = chroma.kelvin = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['temperature']), function(){});
+ };
+
+ _input.temperature = _input.kelvin = _input.K = temperature2rgb;
+
+ Color.prototype.temperature = function() {
+ return rgb2temperature(this._rgb);
+ };
+
+ Color.prototype.kelvin = Color.prototype.temperature;
+
+ chroma.contrast = function(a, b) {
+ var l1, l2, ref, ref1;
+ if ((ref = type(a)) === 'string' || ref === 'number') {
+ a = new Color(a);
+ }
+ if ((ref1 = type(b)) === 'string' || ref1 === 'number') {
+ b = new Color(b);
+ }
+ l1 = a.luminance();
+ l2 = b.luminance();
+ if (l1 > l2) {
+ return (l1 + 0.05) / (l2 + 0.05);
+ } else {
+ return (l2 + 0.05) / (l1 + 0.05);
+ }
+ };
+
+ chroma.distance = function(a, b, mode) {
+ var d, i, l1, l2, ref, ref1, sum_sq;
+ if (mode == null) {
+ mode = 'lab';
+ }
+ if ((ref = type(a)) === 'string' || ref === 'number') {
+ a = new Color(a);
+ }
+ if ((ref1 = type(b)) === 'string' || ref1 === 'number') {
+ b = new Color(b);
+ }
+ l1 = a.get(mode);
+ l2 = b.get(mode);
+ sum_sq = 0;
+ for (i in l1) {
+ d = (l1[i] || 0) - (l2[i] || 0);
+ sum_sq += d * d;
+ }
+ return Math.sqrt(sum_sq);
+ };
+
+ chroma.deltaE = function(a, b, L, C) {
+ var L1, L2, a1, a2, b1, b2, c1, c2, c4, dH2, delA, delB, delC, delL, f, h1, ref, ref1, ref2, ref3, sc, sh, sl, t, v1, v2, v3;
+ if (L == null) {
+ L = 1;
+ }
+ if (C == null) {
+ C = 1;
+ }
+ if ((ref = type(a)) === 'string' || ref === 'number') {
+ a = new Color(a);
+ }
+ if ((ref1 = type(b)) === 'string' || ref1 === 'number') {
+ b = new Color(b);
+ }
+ ref2 = a.lab(), L1 = ref2[0], a1 = ref2[1], b1 = ref2[2];
+ ref3 = b.lab(), L2 = ref3[0], a2 = ref3[1], b2 = ref3[2];
+ c1 = sqrt(a1 * a1 + b1 * b1);
+ c2 = sqrt(a2 * a2 + b2 * b2);
+ sl = L1 < 16.0 ? 0.511 : (0.040975 * L1) / (1.0 + 0.01765 * L1);
+ sc = (0.0638 * c1) / (1.0 + 0.0131 * c1) + 0.638;
+ h1 = c1 < 0.000001 ? 0.0 : (atan2(b1, a1) * 180.0) / PI;
+ while (h1 < 0) {
+ h1 += 360;
+ }
+ while (h1 >= 360) {
+ h1 -= 360;
+ }
+ t = (h1 >= 164.0) && (h1 <= 345.0) ? 0.56 + abs(0.2 * cos((PI * (h1 + 168.0)) / 180.0)) : 0.36 + abs(0.4 * cos((PI * (h1 + 35.0)) / 180.0));
+ c4 = c1 * c1 * c1 * c1;
+ f = sqrt(c4 / (c4 + 1900.0));
+ sh = sc * (f * t + 1.0 - f);
+ delL = L1 - L2;
+ delC = c1 - c2;
+ delA = a1 - a2;
+ delB = b1 - b2;
+ dH2 = delA * delA + delB * delB - delC * delC;
+ v1 = delL / (L * sl);
+ v2 = delC / (C * sc);
+ v3 = sh;
+ return sqrt(v1 * v1 + v2 * v2 + (dH2 / (v3 * v3)));
+ };
+
+ Color.prototype.get = function(modechan) {
+ var channel, i, me, mode, ref, src;
+ me = this;
+ ref = modechan.split('.'), mode = ref[0], channel = ref[1];
+ src = me[mode]();
+ if (channel) {
+ i = mode.indexOf(channel);
+ if (i > -1) {
+ return src[i];
+ } else {
+ return console.warn('unknown channel ' + channel + ' in mode ' + mode);
+ }
+ } else {
+ return src;
+ }
+ };
+
+ Color.prototype.set = function(modechan, value) {
+ var channel, i, me, mode, ref, src;
+ me = this;
+ ref = modechan.split('.'), mode = ref[0], channel = ref[1];
+ if (channel) {
+ src = me[mode]();
+ i = mode.indexOf(channel);
+ if (i > -1) {
+ if (type(value) === 'string') {
+ switch (value.charAt(0)) {
+ case '+':
+ src[i] += +value;
+ break;
+ case '-':
+ src[i] += +value;
+ break;
+ case '*':
+ src[i] *= +(value.substr(1));
+ break;
+ case '/':
+ src[i] /= +(value.substr(1));
+ break;
+ default:
+ src[i] = +value;
+ }
+ } else {
+ src[i] = value;
+ }
+ } else {
+ console.warn('unknown channel ' + channel + ' in mode ' + mode);
+ }
+ } else {
+ src = value;
+ }
+ return chroma(src, mode).alpha(me.alpha());
+ };
+
+ Color.prototype.clipped = function() {
+ return this._rgb._clipped || false;
+ };
+
+ Color.prototype.alpha = function(a) {
+ if (arguments.length) {
+ return chroma.rgb([this._rgb[0], this._rgb[1], this._rgb[2], a]);
+ }
+ return this._rgb[3];
+ };
+
+ Color.prototype.darken = function(amount) {
+ var lab, me;
+ if (amount == null) {
+ amount = 1;
+ }
+ me = this;
+ lab = me.lab();
+ lab[0] -= LAB_CONSTANTS.Kn * amount;
+ return chroma.lab(lab).alpha(me.alpha());
+ };
+
+ Color.prototype.brighten = function(amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return this.darken(-amount);
+ };
+
+ Color.prototype.darker = Color.prototype.darken;
+
+ Color.prototype.brighter = Color.prototype.brighten;
+
+ Color.prototype.saturate = function(amount) {
+ var lch, me;
+ if (amount == null) {
+ amount = 1;
+ }
+ me = this;
+ lch = me.lch();
+ lch[1] += amount * LAB_CONSTANTS.Kn;
+ if (lch[1] < 0) {
+ lch[1] = 0;
+ }
+ return chroma.lch(lch).alpha(me.alpha());
+ };
+
+ Color.prototype.desaturate = function(amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return this.saturate(-amount);
+ };
+
+ Color.prototype.premultiply = function() {
+ var a, rgb;
+ rgb = this.rgb();
+ a = this.alpha();
+ return chroma(rgb[0] * a, rgb[1] * a, rgb[2] * a, a);
+ };
+
+ blend = function(bottom, top, mode) {
+ if (!blend[mode]) {
+ throw 'unknown blend mode ' + mode;
+ }
+ return blend[mode](bottom, top);
+ };
+
+ blend_f = function(f) {
+ return function(bottom, top) {
+ var c0, c1;
+ c0 = chroma(top).rgb();
+ c1 = chroma(bottom).rgb();
+ return chroma(f(c0, c1), 'rgb');
+ };
+ };
+
+ each = function(f) {
+ return function(c0, c1) {
+ var i, o, out;
+ out = [];
+ for (i = o = 0; o <= 3; i = ++o) {
+ out[i] = f(c0[i], c1[i]);
+ }
+ return out;
+ };
+ };
+
+ normal = function(a, b) {
+ return a;
+ };
+
+ multiply = function(a, b) {
+ return a * b / 255;
+ };
+
+ darken = function(a, b) {
+ if (a > b) {
+ return b;
+ } else {
+ return a;
+ }
+ };
+
+ lighten = function(a, b) {
+ if (a > b) {
+ return a;
+ } else {
+ return b;
+ }
+ };
+
+ screen = function(a, b) {
+ return 255 * (1 - (1 - a / 255) * (1 - b / 255));
+ };
+
+ overlay = function(a, b) {
+ if (b < 128) {
+ return 2 * a * b / 255;
+ } else {
+ return 255 * (1 - 2 * (1 - a / 255) * (1 - b / 255));
+ }
+ };
+
+ burn = function(a, b) {
+ return 255 * (1 - (1 - b / 255) / (a / 255));
+ };
+
+ dodge = function(a, b) {
+ if (a === 255) {
+ return 255;
+ }
+ a = 255 * (b / 255) / (1 - a / 255);
+ if (a > 255) {
+ return 255;
+ } else {
+ return a;
+ }
+ };
+
+ blend.normal = blend_f(each(normal));
+
+ blend.multiply = blend_f(each(multiply));
+
+ blend.screen = blend_f(each(screen));
+
+ blend.overlay = blend_f(each(overlay));
+
+ blend.darken = blend_f(each(darken));
+
+ blend.lighten = blend_f(each(lighten));
+
+ blend.dodge = blend_f(each(dodge));
+
+ blend.burn = blend_f(each(burn));
+
+ chroma.blend = blend;
+
+ chroma.analyze = function(data) {
+ var len, o, r, val;
+ r = {
+ min: Number.MAX_VALUE,
+ max: Number.MAX_VALUE * -1,
+ sum: 0,
+ values: [],
+ count: 0
+ };
+ for (o = 0, len = data.length; o < len; o++) {
+ val = data[o];
+ if ((val != null) && !isNaN(val)) {
+ r.values.push(val);
+ r.sum += val;
+ if (val < r.min) {
+ r.min = val;
+ }
+ if (val > r.max) {
+ r.max = val;
+ }
+ r.count += 1;
+ }
+ }
+ r.domain = [r.min, r.max];
+ r.limits = function(mode, num) {
+ return chroma.limits(r, mode, num);
+ };
+ return r;
+ };
+
+ chroma.scale = function(colors, positions) {
+ var _classes, _colorCache, _colors, _correctLightness, _domain, _fixed, _gamma, _max, _min, _mode, _nacol, _out, _padding, _pos, _spread, _useCache, classifyValue, f, getClass, getColor, resetCache, setColors, tmap;
+ _mode = 'rgb';
+ _nacol = chroma('#ccc');
+ _spread = 0;
+ _fixed = false;
+ _domain = [0, 1];
+ _pos = [];
+ _padding = [0, 0];
+ _classes = false;
+ _colors = [];
+ _out = false;
+ _min = 0;
+ _max = 1;
+ _correctLightness = false;
+ _colorCache = {};
+ _useCache = true;
+ _gamma = 1;
+ setColors = function(colors) {
+ var c, col, o, ref, ref1, w;
+ if (colors == null) {
+ colors = ['#fff', '#000'];
+ }
+ if ((colors != null) && type(colors) === 'string' && (chroma.brewer != null)) {
+ colors = chroma.brewer[colors] || chroma.brewer[colors.toLowerCase()] || colors;
+ }
+ if (type(colors) === 'array') {
+ if (colors.length === 1) {
+ colors = [colors[0], colors[0]];
+ }
+ colors = colors.slice(0);
+ for (c = o = 0, ref = colors.length - 1; 0 <= ref ? o <= ref : o >= ref; c = 0 <= ref ? ++o : --o) {
+ col = colors[c];
+ if (type(col) === "string") {
+ colors[c] = chroma(col);
+ }
+ }
+ _pos.length = 0;
+ for (c = w = 0, ref1 = colors.length - 1; 0 <= ref1 ? w <= ref1 : w >= ref1; c = 0 <= ref1 ? ++w : --w) {
+ _pos.push(c / (colors.length - 1));
+ }
+ }
+ resetCache();
+ return _colors = colors;
+ };
+ getClass = function(value) {
+ var i, n;
+ if (_classes != null) {
+ n = _classes.length - 1;
+ i = 0;
+ while (i < n && value >= _classes[i]) {
+ i++;
+ }
+ return i - 1;
+ }
+ return 0;
+ };
+ tmap = function(t) {
+ return t;
+ };
+ classifyValue = function(value) {
+ var i, maxc, minc, n, val;
+ val = value;
+ if (_classes.length > 2) {
+ n = _classes.length - 1;
+ i = getClass(value);
+ minc = _classes[0] + (_classes[1] - _classes[0]) * (0 + _spread * 0.5);
+ maxc = _classes[n - 1] + (_classes[n] - _classes[n - 1]) * (1 - _spread * 0.5);
+ val = _min + ((_classes[i] + (_classes[i + 1] - _classes[i]) * 0.5 - minc) / (maxc - minc)) * (_max - _min);
+ }
+ return val;
+ };
+ getColor = function(val, bypassMap) {
+ var c, col, i, k, o, p, ref, t;
+ if (bypassMap == null) {
+ bypassMap = false;
+ }
+ if (isNaN(val)) {
+ return _nacol;
+ }
+ if (!bypassMap) {
+ if (_classes && _classes.length > 2) {
+ c = getClass(val);
+ t = c / (_classes.length - 2);
+ } else if (_max !== _min) {
+ t = (val - _min) / (_max - _min);
+ } else {
+ t = 1;
+ }
+ } else {
+ t = val;
+ }
+ if (!bypassMap) {
+ t = tmap(t);
+ }
+ if (_gamma !== 1) {
+ t = pow(t, _gamma);
+ }
+ t = _padding[0] + (t * (1 - _padding[0] - _padding[1]));
+ t = Math.min(1, Math.max(0, t));
+ k = Math.floor(t * 10000);
+ if (_useCache && _colorCache[k]) {
+ col = _colorCache[k];
+ } else {
+ if (type(_colors) === 'array') {
+ for (i = o = 0, ref = _pos.length - 1; 0 <= ref ? o <= ref : o >= ref; i = 0 <= ref ? ++o : --o) {
+ p = _pos[i];
+ if (t <= p) {
+ col = _colors[i];
+ break;
+ }
+ if (t >= p && i === _pos.length - 1) {
+ col = _colors[i];
+ break;
+ }
+ if (t > p && t < _pos[i + 1]) {
+ t = (t - p) / (_pos[i + 1] - p);
+ col = chroma.interpolate(_colors[i], _colors[i + 1], t, _mode);
+ break;
+ }
+ }
+ } else if (type(_colors) === 'function') {
+ col = _colors(t);
+ }
+ if (_useCache) {
+ _colorCache[k] = col;
+ }
+ }
+ return col;
+ };
+ resetCache = function() {
+ return _colorCache = {};
+ };
+ setColors(colors);
+ f = function(v) {
+ var c;
+ c = chroma(getColor(v));
+ if (_out && c[_out]) {
+ return c[_out]();
+ } else {
+ return c;
+ }
+ };
+ f.classes = function(classes) {
+ var d;
+ if (classes != null) {
+ if (type(classes) === 'array') {
+ _classes = classes;
+ _domain = [classes[0], classes[classes.length - 1]];
+ } else {
+ d = chroma.analyze(_domain);
+ if (classes === 0) {
+ _classes = [d.min, d.max];
+ } else {
+ _classes = chroma.limits(d, 'e', classes);
+ }
+ }
+ return f;
+ }
+ return _classes;
+ };
+ f.domain = function(domain) {
+ var c, d, k, len, o, ref, w;
+ if (!arguments.length) {
+ return _domain;
+ }
+ _min = domain[0];
+ _max = domain[domain.length - 1];
+ _pos = [];
+ k = _colors.length;
+ if (domain.length === k && _min !== _max) {
+ for (o = 0, len = domain.length; o < len; o++) {
+ d = domain[o];
+ _pos.push((d - _min) / (_max - _min));
+ }
+ } else {
+ for (c = w = 0, ref = k - 1; 0 <= ref ? w <= ref : w >= ref; c = 0 <= ref ? ++w : --w) {
+ _pos.push(c / (k - 1));
+ }
+ }
+ _domain = [_min, _max];
+ return f;
+ };
+ f.mode = function(_m) {
+ if (!arguments.length) {
+ return _mode;
+ }
+ _mode = _m;
+ resetCache();
+ return f;
+ };
+ f.range = function(colors, _pos) {
+ setColors(colors, _pos);
+ return f;
+ };
+ f.out = function(_o) {
+ _out = _o;
+ return f;
+ };
+ f.spread = function(val) {
+ if (!arguments.length) {
+ return _spread;
+ }
+ _spread = val;
+ return f;
+ };
+ f.correctLightness = function(v) {
+ if (v == null) {
+ v = true;
+ }
+ _correctLightness = v;
+ resetCache();
+ if (_correctLightness) {
+ tmap = function(t) {
+ var L0, L1, L_actual, L_diff, L_ideal, max_iter, pol, t0, t1;
+ L0 = getColor(0, true).lab()[0];
+ L1 = getColor(1, true).lab()[0];
+ pol = L0 > L1;
+ L_actual = getColor(t, true).lab()[0];
+ L_ideal = L0 + (L1 - L0) * t;
+ L_diff = L_actual - L_ideal;
+ t0 = 0;
+ t1 = 1;
+ max_iter = 20;
+ while (Math.abs(L_diff) > 1e-2 && max_iter-- > 0) {
+ (function() {
+ if (pol) {
+ L_diff *= -1;
+ }
+ if (L_diff < 0) {
+ t0 = t;
+ t += (t1 - t) * 0.5;
+ } else {
+ t1 = t;
+ t += (t0 - t) * 0.5;
+ }
+ L_actual = getColor(t, true).lab()[0];
+ return L_diff = L_actual - L_ideal;
+ })();
+ }
+ return t;
+ };
+ } else {
+ tmap = function(t) {
+ return t;
+ };
+ }
+ return f;
+ };
+ f.padding = function(p) {
+ if (p != null) {
+ if (type(p) === 'number') {
+ p = [p, p];
+ }
+ _padding = p;
+ return f;
+ } else {
+ return _padding;
+ }
+ };
+ f.colors = function(numColors, out) {
+ var dd, dm, i, o, ref, result, results, samples, w;
+ if (arguments.length < 2) {
+ out = 'hex';
+ }
+ result = [];
+ if (arguments.length === 0) {
+ result = _colors.slice(0);
+ } else if (numColors === 1) {
+ result = [f(0.5)];
+ } else if (numColors > 1) {
+ dm = _domain[0];
+ dd = _domain[1] - dm;
+ result = (function() {
+ results = [];
+ for (var o = 0; 0 <= numColors ? o < numColors : o > numColors; 0 <= numColors ? o++ : o--){ results.push(o); }
+ return results;
+ }).apply(this).map(function(i) {
+ return f(dm + i / (numColors - 1) * dd);
+ });
+ } else {
+ colors = [];
+ samples = [];
+ if (_classes && _classes.length > 2) {
+ for (i = w = 1, ref = _classes.length; 1 <= ref ? w < ref : w > ref; i = 1 <= ref ? ++w : --w) {
+ samples.push((_classes[i - 1] + _classes[i]) * 0.5);
+ }
+ } else {
+ samples = _domain;
+ }
+ result = samples.map(function(v) {
+ return f(v);
+ });
+ }
+ if (chroma[out]) {
+ result = result.map(function(c) {
+ return c[out]();
+ });
+ }
+ return result;
+ };
+ f.cache = function(c) {
+ if (c != null) {
+ _useCache = c;
+ return f;
+ } else {
+ return _useCache;
+ }
+ };
+ f.gamma = function(g) {
+ if (g != null) {
+ _gamma = g;
+ return f;
+ } else {
+ return _gamma;
+ }
+ };
+ return f;
+ };
+
+ if (chroma.scales == null) {
+ chroma.scales = {};
+ }
+
+ chroma.scales.cool = function() {
+ return chroma.scale([chroma.hsl(180, 1, .9), chroma.hsl(250, .7, .4)]);
+ };
+
+ chroma.scales.hot = function() {
+ return chroma.scale(['#000', '#f00', '#ff0', '#fff'], [0, .25, .75, 1]).mode('rgb');
+ };
+
+ chroma.analyze = function(data, key, filter) {
+ var add, k, len, o, r, val, visit;
+ r = {
+ min: Number.MAX_VALUE,
+ max: Number.MAX_VALUE * -1,
+ sum: 0,
+ values: [],
+ count: 0
+ };
+ if (filter == null) {
+ filter = function() {
+ return true;
+ };
+ }
+ add = function(val) {
+ if ((val != null) && !isNaN(val)) {
+ r.values.push(val);
+ r.sum += val;
+ if (val < r.min) {
+ r.min = val;
+ }
+ if (val > r.max) {
+ r.max = val;
+ }
+ r.count += 1;
+ }
+ };
+ visit = function(val, k) {
+ if (filter(val, k)) {
+ if ((key != null) && type(key) === 'function') {
+ return add(key(val));
+ } else if ((key != null) && type(key) === 'string' || type(key) === 'number') {
+ return add(val[key]);
+ } else {
+ return add(val);
+ }
+ }
+ };
+ if (type(data) === 'array') {
+ for (o = 0, len = data.length; o < len; o++) {
+ val = data[o];
+ visit(val);
+ }
+ } else {
+ for (k in data) {
+ val = data[k];
+ visit(val, k);
+ }
+ }
+ r.domain = [r.min, r.max];
+ r.limits = function(mode, num) {
+ return chroma.limits(r, mode, num);
+ };
+ return r;
+ };
+
+ chroma.limits = function(data, mode, num) {
+ var aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, assignments, best, centroids, cluster, clusterSizes, dist, i, j, kClusters, limits, max_log, min, min_log, mindist, n, nb_iters, newCentroids, o, p, pb, pr, ref, ref1, ref10, ref11, ref12, ref13, ref14, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, repeat, sum, tmpKMeansBreaks, v, value, values, w;
+ if (mode == null) {
+ mode = 'equal';
+ }
+ if (num == null) {
+ num = 7;
+ }
+ if (type(data) === 'array') {
+ data = chroma.analyze(data);
+ }
+ min = data.min;
+ max = data.max;
+ sum = data.sum;
+ values = data.values.sort(function(a, b) {
+ return a - b;
+ });
+ if (num === 1) {
+ return [min, max];
+ }
+ limits = [];
+ if (mode.substr(0, 1) === 'c') {
+ limits.push(min);
+ limits.push(max);
+ }
+ if (mode.substr(0, 1) === 'e') {
+ limits.push(min);
+ for (i = o = 1, ref = num - 1; 1 <= ref ? o <= ref : o >= ref; i = 1 <= ref ? ++o : --o) {
+ limits.push(min + (i / num) * (max - min));
+ }
+ limits.push(max);
+ } else if (mode.substr(0, 1) === 'l') {
+ if (min <= 0) {
+ throw 'Logarithmic scales are only possible for values > 0';
+ }
+ min_log = Math.LOG10E * log(min);
+ max_log = Math.LOG10E * log(max);
+ limits.push(min);
+ for (i = w = 1, ref1 = num - 1; 1 <= ref1 ? w <= ref1 : w >= ref1; i = 1 <= ref1 ? ++w : --w) {
+ limits.push(pow(10, min_log + (i / num) * (max_log - min_log)));
+ }
+ limits.push(max);
+ } else if (mode.substr(0, 1) === 'q') {
+ limits.push(min);
+ for (i = aa = 1, ref2 = num - 1; 1 <= ref2 ? aa <= ref2 : aa >= ref2; i = 1 <= ref2 ? ++aa : --aa) {
+ p = (values.length - 1) * i / num;
+ pb = floor(p);
+ if (pb === p) {
+ limits.push(values[pb]);
+ } else {
+ pr = p - pb;
+ limits.push(values[pb] * (1 - pr) + values[pb + 1] * pr);
+ }
+ }
+ limits.push(max);
+ } else if (mode.substr(0, 1) === 'k') {
+
+ /*
+ implementation based on
+ http://code.google.com/p/figue/source/browse/trunk/figue.js#336
+ simplified for 1-d input values
+ */
+ n = values.length;
+ assignments = new Array(n);
+ clusterSizes = new Array(num);
+ repeat = true;
+ nb_iters = 0;
+ centroids = null;
+ centroids = [];
+ centroids.push(min);
+ for (i = ab = 1, ref3 = num - 1; 1 <= ref3 ? ab <= ref3 : ab >= ref3; i = 1 <= ref3 ? ++ab : --ab) {
+ centroids.push(min + (i / num) * (max - min));
+ }
+ centroids.push(max);
+ while (repeat) {
+ for (j = ac = 0, ref4 = num - 1; 0 <= ref4 ? ac <= ref4 : ac >= ref4; j = 0 <= ref4 ? ++ac : --ac) {
+ clusterSizes[j] = 0;
+ }
+ for (i = ad = 0, ref5 = n - 1; 0 <= ref5 ? ad <= ref5 : ad >= ref5; i = 0 <= ref5 ? ++ad : --ad) {
+ value = values[i];
+ mindist = Number.MAX_VALUE;
+ for (j = ae = 0, ref6 = num - 1; 0 <= ref6 ? ae <= ref6 : ae >= ref6; j = 0 <= ref6 ? ++ae : --ae) {
+ dist = abs(centroids[j] - value);
+ if (dist < mindist) {
+ mindist = dist;
+ best = j;
+ }
+ }
+ clusterSizes[best]++;
+ assignments[i] = best;
+ }
+ newCentroids = new Array(num);
+ for (j = af = 0, ref7 = num - 1; 0 <= ref7 ? af <= ref7 : af >= ref7; j = 0 <= ref7 ? ++af : --af) {
+ newCentroids[j] = null;
+ }
+ for (i = ag = 0, ref8 = n - 1; 0 <= ref8 ? ag <= ref8 : ag >= ref8; i = 0 <= ref8 ? ++ag : --ag) {
+ cluster = assignments[i];
+ if (newCentroids[cluster] === null) {
+ newCentroids[cluster] = values[i];
+ } else {
+ newCentroids[cluster] += values[i];
+ }
+ }
+ for (j = ah = 0, ref9 = num - 1; 0 <= ref9 ? ah <= ref9 : ah >= ref9; j = 0 <= ref9 ? ++ah : --ah) {
+ newCentroids[j] *= 1 / clusterSizes[j];
+ }
+ repeat = false;
+ for (j = ai = 0, ref10 = num - 1; 0 <= ref10 ? ai <= ref10 : ai >= ref10; j = 0 <= ref10 ? ++ai : --ai) {
+ if (newCentroids[j] !== centroids[i]) {
+ repeat = true;
+ break;
+ }
+ }
+ centroids = newCentroids;
+ nb_iters++;
+ if (nb_iters > 200) {
+ repeat = false;
+ }
+ }
+ kClusters = {};
+ for (j = aj = 0, ref11 = num - 1; 0 <= ref11 ? aj <= ref11 : aj >= ref11; j = 0 <= ref11 ? ++aj : --aj) {
+ kClusters[j] = [];
+ }
+ for (i = ak = 0, ref12 = n - 1; 0 <= ref12 ? ak <= ref12 : ak >= ref12; i = 0 <= ref12 ? ++ak : --ak) {
+ cluster = assignments[i];
+ kClusters[cluster].push(values[i]);
+ }
+ tmpKMeansBreaks = [];
+ for (j = al = 0, ref13 = num - 1; 0 <= ref13 ? al <= ref13 : al >= ref13; j = 0 <= ref13 ? ++al : --al) {
+ tmpKMeansBreaks.push(kClusters[j][0]);
+ tmpKMeansBreaks.push(kClusters[j][kClusters[j].length - 1]);
+ }
+ tmpKMeansBreaks = tmpKMeansBreaks.sort(function(a, b) {
+ return a - b;
+ });
+ limits.push(tmpKMeansBreaks[0]);
+ for (i = am = 1, ref14 = tmpKMeansBreaks.length - 1; am <= ref14; i = am += 2) {
+ v = tmpKMeansBreaks[i];
+ if (!isNaN(v) && limits.indexOf(v) === -1) {
+ limits.push(v);
+ }
+ }
+ }
+ return limits;
+ };
+
+ hsi2rgb = function(h, s, i) {
+
+ /*
+ borrowed from here:
+ http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/hsi2rgb.cpp
+ */
+ var args, b, g, r;
+ args = unpack(arguments);
+ h = args[0], s = args[1], i = args[2];
+ if (isNaN(h)) {
+ h = 0;
+ }
+ h /= 360;
+ if (h < 1 / 3) {
+ b = (1 - s) / 3;
+ r = (1 + s * cos(TWOPI * h) / cos(PITHIRD - TWOPI * h)) / 3;
+ g = 1 - (b + r);
+ } else if (h < 2 / 3) {
+ h -= 1 / 3;
+ r = (1 - s) / 3;
+ g = (1 + s * cos(TWOPI * h) / cos(PITHIRD - TWOPI * h)) / 3;
+ b = 1 - (r + g);
+ } else {
+ h -= 2 / 3;
+ g = (1 - s) / 3;
+ b = (1 + s * cos(TWOPI * h) / cos(PITHIRD - TWOPI * h)) / 3;
+ r = 1 - (g + b);
+ }
+ r = limit(i * r * 3);
+ g = limit(i * g * 3);
+ b = limit(i * b * 3);
+ return [r * 255, g * 255, b * 255, args.length > 3 ? args[3] : 1];
+ };
+
+ rgb2hsi = function() {
+
+ /*
+ borrowed from here:
+ http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/rgb2hsi.cpp
+ */
+ var b, g, h, i, min, r, ref, s;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ TWOPI = Math.PI * 2;
+ r /= 255;
+ g /= 255;
+ b /= 255;
+ min = Math.min(r, g, b);
+ i = (r + g + b) / 3;
+ s = 1 - min / i;
+ if (s === 0) {
+ h = 0;
+ } else {
+ h = ((r - g) + (r - b)) / 2;
+ h /= Math.sqrt((r - g) * (r - g) + (r - b) * (g - b));
+ h = Math.acos(h);
+ if (b > g) {
+ h = TWOPI - h;
+ }
+ h /= TWOPI;
+ }
+ return [h * 360, s, i];
+ };
+
+ chroma.hsi = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['hsi']), function(){});
+ };
+
+ _input.hsi = hsi2rgb;
+
+ Color.prototype.hsi = function() {
+ return rgb2hsi(this._rgb);
+ };
+
+ interpolate_hsx = function(col1, col2, f, m) {
+ var dh, hue, hue0, hue1, lbv, lbv0, lbv1, res, sat, sat0, sat1, xyz0, xyz1;
+ if (m === 'hsl') {
+ xyz0 = col1.hsl();
+ xyz1 = col2.hsl();
+ } else if (m === 'hsv') {
+ xyz0 = col1.hsv();
+ xyz1 = col2.hsv();
+ } else if (m === 'hcg') {
+ xyz0 = col1.hcg();
+ xyz1 = col2.hcg();
+ } else if (m === 'hsi') {
+ xyz0 = col1.hsi();
+ xyz1 = col2.hsi();
+ } else if (m === 'lch' || m === 'hcl') {
+ m = 'hcl';
+ xyz0 = col1.hcl();
+ xyz1 = col2.hcl();
+ }
+ if (m.substr(0, 1) === 'h') {
+ hue0 = xyz0[0], sat0 = xyz0[1], lbv0 = xyz0[2];
+ hue1 = xyz1[0], sat1 = xyz1[1], lbv1 = xyz1[2];
+ }
+ if (!isNaN(hue0) && !isNaN(hue1)) {
+ if (hue1 > hue0 && hue1 - hue0 > 180) {
+ dh = hue1 - (hue0 + 360);
+ } else if (hue1 < hue0 && hue0 - hue1 > 180) {
+ dh = hue1 + 360 - hue0;
+ } else {
+ dh = hue1 - hue0;
+ }
+ hue = hue0 + f * dh;
+ } else if (!isNaN(hue0)) {
+ hue = hue0;
+ if ((lbv1 === 1 || lbv1 === 0) && m !== 'hsv') {
+ sat = sat0;
+ }
+ } else if (!isNaN(hue1)) {
+ hue = hue1;
+ if ((lbv0 === 1 || lbv0 === 0) && m !== 'hsv') {
+ sat = sat1;
+ }
+ } else {
+ hue = Number.NaN;
+ }
+ if (sat == null) {
+ sat = sat0 + f * (sat1 - sat0);
+ }
+ lbv = lbv0 + f * (lbv1 - lbv0);
+ return res = chroma[m](hue, sat, lbv);
+ };
+
+ _interpolators = _interpolators.concat((function() {
+ var len, o, ref, results;
+ ref = ['hsv', 'hsl', 'hsi', 'hcl', 'lch', 'hcg'];
+ results = [];
+ for (o = 0, len = ref.length; o < len; o++) {
+ m = ref[o];
+ results.push([m, interpolate_hsx]);
+ }
+ return results;
+ })());
+
+ interpolate_num = function(col1, col2, f, m) {
+ var n1, n2;
+ n1 = col1.num();
+ n2 = col2.num();
+ return chroma.num(n1 + (n2 - n1) * f, 'num');
+ };
+
+ _interpolators.push(['num', interpolate_num]);
+
+ interpolate_lab = function(col1, col2, f, m) {
+ var res, xyz0, xyz1;
+ xyz0 = col1.lab();
+ xyz1 = col2.lab();
+ return res = new Color(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), m);
+ };
+
+ _interpolators.push(['lab', interpolate_lab]);
+
+}).call(this);
+
src/node_modules/chroma-js/chroma.min.js
+/*
+chroma.js - JavaScript library for color conversions
+
+Copyright (c) 2011-2017, Gregor Aisch
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. The name Gregor Aisch may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca=[].slice;xa=function(){var a,b,c,d,e;for(a={},e="Boolean Number String Function Array Date RegExp Undefined Null".split(" "),d=0,b=e.length;d<b;d++)c=e[d],a["[object "+c+"]"]=c.toLowerCase();return function(b){var c;return c=Object.prototype.toString.call(b),a[c]||"object"}}(),U=function(a,b,c){return null==b&&(b=0),null==c&&(c=1),a<b&&(a=b),a>c&&(a=c),a},ya=function(a){return a.length>=3?Array.prototype.slice.call(a):a[0]},u=function(a){var b,c;for(a._clipped=!1,a._unclipped=a.slice(0),b=c=0;c<3;b=++c)b<3?((a[b]<0||a[b]>255)&&(a._clipped=!0),a[b]<0&&(a[b]=0),a[b]>255&&(a[b]=255)):3===b&&(a[b]<0&&(a[b]=0),a[b]>1&&(a[b]=1));return a._clipped||delete a._unclipped,a},d=Math.PI,sa=Math.round,w=Math.cos,B=Math.floor,ba=Math.pow,V=Math.log,ua=Math.sin,va=Math.sqrt,n=Math.atan2,Y=Math.max,m=Math.abs,g=2*d,e=d/3,b=d/180,f=180/d,t=function(){return arguments[0]instanceof a?arguments[0]:function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,arguments,function(){})},t.default=t,l=[],"undefined"!=typeof module&&null!==module&&null!=module.exports&&(module.exports=t),"function"==typeof define&&define.amd?define([],function(){return t}):(ra="undefined"!=typeof exports&&null!==exports?exports:this,ra.chroma=t),t.version="1.4.0",k={},i=[],j=!1,a=function(){function a(){var a,b,c,d,e,f,g,h,l;for(f=this,b=[],h=0,d=arguments.length;h<d;h++)null!=(a=arguments[h])&&b.push(a);if(b.length>1&&(g=b[b.length-1]),null!=k[g])f._rgb=u(k[g](ya(b.slice(0,-1))));else{for(j||(i=i.sort(function(a,b){return b.p-a.p}),j=!0),l=0,e=i.length;l<e&&(c=i[l],!(g=c.test.apply(c,b)));l++);g&&(f._rgb=u(k[g].apply(k,b)))}null==f._rgb&&console.warn("unknown format: "+b),null==f._rgb&&(f._rgb=[0,0,0]),3===f._rgb.length&&f._rgb.push(1)}return a.prototype.toString=function(){return this.hex()},a}(),t._input=k,t.brewer=r={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},function(){var a,b;b=[];for(a in r)b.push(r[a.toLowerCase()]=r[a])}(),za={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},t.colors=za,P=function(){var a,b,d,e,f,g,h,i,j;return b=ya(arguments),f=b[0],a=b[1],d=b[2],i=(f+16)/116,h=isNaN(a)?i:i+a/500,j=isNaN(d)?i:i-d/200,i=c.Yn*Q(i),h=c.Xn*Q(h),j=c.Zn*Q(j),g=Ba(3.2404542*h-1.5371385*i-.4985314*j),e=Ba(-.969266*h+1.8760108*i+.041556*j),d=Ba(.0556434*h-.2040259*i+1.0572252*j),[g,e,d,b.length>3?b[3]:1]},Ba=function(a){return 255*(a<=.00304?12.92*a:1.055*ba(a,1/2.4)-.055)},Q=function(a){return a>c.t1?a*a*a:c.t2*(a-c.t0)},c={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},ja=function(){var a,b,c,d,e,f,g,h;return d=ya(arguments),c=d[0],b=d[1],a=d[2],e=oa(c,b,a),f=e[0],g=e[1],h=e[2],[116*g-16,500*(f-g),200*(g-h)]},pa=function(a){return(a/=255)<=.04045?a/12.92:ba((a+.055)/1.055,2.4)},Aa=function(a){return a>c.t3?ba(a,1/3):a/c.t2+c.t0},oa=function(){var a,b,d,e,f,g,h;return e=ya(arguments),d=e[0],b=e[1],a=e[2],d=pa(d),b=pa(b),a=pa(a),f=Aa((.4124564*d+.3575761*b+.1804375*a)/c.Xn),g=Aa((.2126729*d+.7151522*b+.072175*a)/c.Yn),h=Aa((.0193339*d+.119192*b+.9503041*a)/c.Zn),[f,g,h]},t.lab=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["lab"]),function(){})},k.lab=P,a.prototype.lab=function(){return ja(this._rgb)},o=function(a){var b,c,d,e,f,g,h,i,j,k,l;return a=function(){var b,c,d;for(d=[],c=0,b=a.length;c<b;c++)e=a[c],d.push(t(e));return d}(),2===a.length?(j=function(){var b,c,d;for(d=[],c=0,b=a.length;c<b;c++)e=a[c],d.push(e.lab());return d}(),f=j[0],g=j[1],b=function(a){var b,c;return c=function(){var c,d;for(d=[],b=c=0;c<=2;b=++c)d.push(f[b]+a*(g[b]-f[b]));return d}(),t.lab.apply(t,c)}):3===a.length?(k=function(){var b,c,d;for(d=[],c=0,b=a.length;c<b;c++)e=a[c],d.push(e.lab());return d}(),f=k[0],g=k[1],h=k[2],b=function(a){var b,c;return c=function(){var c,d;for(d=[],b=c=0;c<=2;b=++c)d.push((1-a)*(1-a)*f[b]+2*(1-a)*a*g[b]+a*a*h[b]);return d}(),t.lab.apply(t,c)}):4===a.length?(l=function(){var b,c,d;for(d=[],c=0,b=a.length;c<b;c++)e=a[c],d.push(e.lab());return d}(),f=l[0],g=l[1],h=l[2],i=l[3],b=function(a){var b,c;return c=function(){var c,d;for(d=[],b=c=0;c<=2;b=++c)d.push((1-a)*(1-a)*(1-a)*f[b]+3*(1-a)*(1-a)*a*g[b]+3*(1-a)*a*a*h[b]+a*a*a*i[b]);return d}(),t.lab.apply(t,c)}):5===a.length&&(c=o(a.slice(0,3)),d=o(a.slice(2,5)),b=function(a){return a<.5?c(2*a):d(2*(a-.5))}),b},t.bezier=function(a){var b;return b=o(a),b.scale=function(){return t.scale(b)},b},t.cubehelix=function(a,b,c,d,e){var f,h,i;return null==a&&(a=300),null==b&&(b=-1.5),null==c&&(c=1),null==d&&(d=1),null==e&&(e=[0,1]),f=0,"array"===xa(e)?h=e[1]-e[0]:(h=0,e=[e,e]),i=function(i){var j,k,l,m,n,o,p,q,r;return j=g*((a+120)/360+b*i),p=ba(e[0]+h*i,d),o=0!==f?c[0]+i*f:c,k=o*p*(1-p)/2,m=w(j),r=ua(j),q=p+k*(-.14861*m+1.78277*r),n=p+k*(-.29227*m-.90649*r),l=p+k*(1.97294*m),t(u([255*q,255*n,255*l,1]))},i.start=function(b){return null==b?a:(a=b,i)},i.rotations=function(a){return null==a?b:(b=a,i)},i.gamma=function(a){return null==a?d:(d=a,i)},i.hue=function(a){return null==a?c:(c=a,"array"===xa(c)?0===(f=c[1]-c[0])&&(c=c[1]):f=0,i)},i.lightness=function(a){return null==a?e:("array"===xa(a)?(e=a,h=a[1]-a[0]):(e=[a,a],h=0),i)},i.scale=function(){return t.scale(i)},i.hue(c),i},t.random=function(){var b,c,d;for(c="0123456789abcdef",b="#",d=0;d<6;++d)b+=c.charAt(B(16*Math.random()));return new a(b)},l=[],I=function(a,b,c,d){var e,f,g,h;for(null==c&&(c=.5),null==d&&(d="rgb"),"object"!==xa(a)&&(a=t(a)),"object"!==xa(b)&&(b=t(b)),g=0,f=l.length;g<f;g++)if(e=l[g],d===e[0]){h=e[1](a,b,c,d);break}if(null==h)throw"color mode "+d+" is not supported";return h.alpha(a.alpha()+c*(b.alpha()-a.alpha()))},t.interpolate=I,a.prototype.interpolate=function(a,b,c){return I(this,a,b,c)},t.mix=I,a.prototype.mix=a.prototype.interpolate,k.rgb=function(){var a,b,c,d;b=ya(arguments),c=[];for(a in b)d=b[a],c.push(d);return c},t.rgb=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["rgb"]),function(){})},a.prototype.rgb=function(a){return null==a&&(a=!0),a?this._rgb.map(Math.round).slice(0,3):this._rgb.slice(0,3)},a.prototype.rgba=function(a){return null==a&&(a=!0),a?[Math.round(this._rgb[0]),Math.round(this._rgb[1]),Math.round(this._rgb[2]),this._rgb[3]]:this._rgb.slice(0)},i.push({p:3,test:function(a){var b;return b=ya(arguments),"array"===xa(b)&&3===b.length?"rgb":4===b.length&&"number"===xa(b[3])&&b[3]>=0&&b[3]<=1?"rgb":void 0}}),k.lrgb=k.rgb,L=function(b,c,d,e){var f,g;return f=b._rgb,g=c._rgb,new a(va(ba(f[0],2)*(1-d)+ba(g[0],2)*d),va(ba(f[1],2)*(1-d)+ba(g[1],2)*d),va(ba(f[2],2)*(1-d)+ba(g[2],2)*d),e)},h=function(b){var c,d,e,f,g,h;for(d=1/b.length,h=[0,0,0,0],f=0,e=b.length;f<e;f++)c=b[f],g=c._rgb,h[0]+=ba(g[0],2)*d,h[1]+=ba(g[1],2)*d,h[2]+=ba(g[2],2)*d,h[3]+=g[3]*d;return h[0]=va(h[0]),h[1]=va(h[1]),h[2]=va(h[2]),h[3]>1&&(h[3]=1),new a(u(h))},l.push(["lrgb",L]),t.average=function(a,b){var c,e,f,g,i,j,k,l,m,o,p,q,r;if(null==b&&(b="rgb"),m=a.length,a=a.map(function(a){return t(a)}),k=a.splice(0,1)[0],"lrgb"===b)return h(a);q=k.get(b),g=[],i=0,j=0;for(l in q)q[l]=q[l]||0,g.push(isNaN(q[l])?0:1),"h"!==b.charAt(l)||isNaN(q[l])||(c=q[l]/180*d,i+=w(c),j+=ua(c));for(e=k.alpha(),p=0,o=a.length;p<o;p++){f=a[p],r=f.get(b),e+=f.alpha();for(l in q)isNaN(r[l])||(g[l]+=1,"h"===b.charAt(l)?(c=r[l]/180*d,i+=w(c),j+=ua(c)):q[l]+=r[l])}for(l in q)if("h"===b.charAt(l)){for(c=n(j/g[l],i/g[l])/d*180;c<0;)c+=360;for(;c>=360;)c-=360;q[l]=c}else q[l]=q[l]/g[l];return t(q,b).alpha(e/m)},D=function(a){var b,c,d,e,f,g;if(a.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return 4!==a.length&&7!==a.length||(a=a.substr(1)),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),g=parseInt(a,16),e=g>>16,d=g>>8&255,c=255&g,[e,d,c,1];if(a.match(/^#?([A-Fa-f0-9]{8})$/))return 9===a.length&&(a=a.substr(1)),g=parseInt(a,16),e=g>>24&255,d=g>>16&255,c=g>>8&255,b=sa((255&g)/255*100)/100,[e,d,c,b];if(null!=k.css&&(f=k.css(a)))return f;throw"unknown color: "+a},fa=function(a,b){var c,d,e,f,g,h,i;return null==b&&(b="auto"),g=a[0],e=a[1],d=a[2],c=a[3],"auto"===b&&(b=c<1?"rgba":"rgb"),g=Math.round(g),e=Math.round(e),d=Math.round(d),i=g<<16|e<<8|d,h="000000"+i.toString(16),h=h.substr(h.length-6),f="0"+sa(255*c).toString(16),f=f.substr(f.length-2),"#"+function(){switch(b.toLowerCase()){case"rgba":return h+f;case"argb":return f+h;default:return h}}()},k.hex=function(a){return D(a)},t.hex=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["hex"]),function(){})},a.prototype.hex=function(a){return null==a&&(a="auto"),fa(this._rgb,a)},i.push({p:4,test:function(a){if(1===arguments.length&&"string"===xa(a))return"hex"}}),G=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;if(a=ya(arguments),e=a[0],k=a[1],g=a[2],0===k)i=d=b=255*g;else{for(n=[0,0,0],c=[0,0,0],m=g<.5?g*(1+k):g+k-g*k,l=2*g-m,e/=360,n[0]=e+1/3,n[1]=e,n[2]=e-1/3,f=h=0;h<=2;f=++h)n[f]<0&&(n[f]+=1),n[f]>1&&(n[f]-=1),6*n[f]<1?c[f]=l+6*(m-l)*n[f]:2*n[f]<1?c[f]=m:3*n[f]<2?c[f]=l+(m-l)*(2/3-n[f])*6:c[f]=l;j=[sa(255*c[0]),sa(255*c[1]),sa(255*c[2])],i=j[0],d=j[1],b=j[2]}return a.length>3?[i,d,b,a[3]]:[i,d,b]},ha=function(a,b,c){var d,e,f,g,h;return void 0!==a&&a.length>=3&&(g=a,a=g[0],b=g[1],c=g[2]),a/=255,b/=255,c/=255,f=Math.min(a,b,c),Y=Math.max(a,b,c),e=(Y+f)/2,Y===f?(h=0,d=Number.NaN):h=e<.5?(Y-f)/(Y+f):(Y-f)/(2-Y-f),a===Y?d=(b-c)/(Y-f):b===Y?d=2+(c-a)/(Y-f):c===Y&&(d=4+(a-b)/(Y-f)),d*=60,d<0&&(d+=360),[d,h,e]},t.hsl=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["hsl"]),function(){})},k.hsl=G,a.prototype.hsl=function(){return ha(this._rgb)},H=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;if(a=ya(arguments),e=a[0],p=a[1],r=a[2],r*=255,0===p)i=d=b=r;else switch(360===e&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60,f=B(e),c=e-f,g=r*(1-p),h=r*(1-p*c),q=r*(1-p*(1-c)),f){case 0:j=[r,q,g],i=j[0],d=j[1],b=j[2];break;case 1:k=[h,r,g],i=k[0],d=k[1],b=k[2];break;case 2:l=[g,r,q],i=l[0],d=l[1],b=l[2];break;case 3:m=[g,h,r],i=m[0],d=m[1],b=m[2];break;case 4:n=[q,g,r],i=n[0],d=n[1],b=n[2];break;case 5:o=[r,g,h],i=o[0],d=o[1],b=o[2]}return[i,d,b,a.length>3?a[3]:1]},ia=function(){var a,b,c,d,e,f,g,h,i;return g=ya(arguments),f=g[0],c=g[1],a=g[2],e=Math.min(f,c,a),Y=Math.max(f,c,a),b=Y-e,i=Y/255,0===Y?(d=Number.NaN,h=0):(h=b/Y,f===Y&&(d=(c-a)/b),c===Y&&(d=2+(a-f)/b),a===Y&&(d=4+(f-c)/b),(d*=60)<0&&(d+=360)),[d,h,i]},t.hsv=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["hsv"]),function(){})},k.hsv=H,a.prototype.hsv=function(){return ia(this._rgb)},_=function(a){var b,c,d;return"number"===xa(a)&&a>=0&&a<=16777215?(d=a>>16,c=a>>8&255,b=255&a,[d,c,b,1]):(console.warn("unknown num color: "+a),[0,0,0,1])},ma=function(){var a,b,c,d;return d=ya(arguments),c=d[0],b=d[1],a=d[2],(c<<16)+(b<<8)+a},t.num=function(b){return new a(b,"num")},a.prototype.num=function(a){return null==a&&(a="rgb"),ma(this._rgb,a)},k.num=_,i.push({p:1,test:function(a){if(1===arguments.length&&"number"===xa(a)&&a>=0&&a<=16777215)return"num"}}),C=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;if(c=ya(arguments),h=c[0],e=c[1],b=c[2],e/=100,g=g/100*255,a=255*e,0===e)l=g=d=b;else switch(360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360),h/=60,i=B(h),f=h-i,j=b*(1-e),k=j+a*(1-f),s=j+a*f,t=j+a,i){case 0:m=[t,s,j],l=m[0],g=m[1],d=m[2];break;case 1:n=[k,t,j],l=n[0],g=n[1],d=n[2];break;case 2:o=[j,t,s],l=o[0],g=o[1],d=o[2];break;case 3:p=[j,k,t],l=p[0],g=p[1],d=p[2];break;case 4:q=[s,j,t],l=q[0],g=q[1],d=q[2];break;case 5:r=[t,j,k],l=r[0],g=r[1],d=r[2]}return[l,g,d,c.length>3?c[3]:1]},ea=function(){var a,b,c,d,e,f,g,h,i;return i=ya(arguments),h=i[0],e=i[1],b=i[2],g=Math.min(h,e,b),Y=Math.max(h,e,b),d=Y-g,c=100*d/255,a=g/(255-d)*100,0===d?f=Number.NaN:(h===Y&&(f=(e-b)/d),e===Y&&(f=2+(b-h)/d),b===Y&&(f=4+(h-e)/d),(f*=60)<0&&(f+=360)),[f,c,a]},t.hcg=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["hcg"]),function(){})},k.hcg=C,a.prototype.hcg=function(){return ea(this._rgb)},x=function(a){var b,c,d,e,f,g,h,i;if(a=a.toLowerCase(),null!=t.colors&&t.colors[a])return D(t.colors[a]);if(f=a.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(h=f.slice(1,4),e=g=0;g<=2;e=++g)h[e]=+h[e];h[3]=1}else if(f=a.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(h=f.slice(1,5),e=i=0;i<=3;e=++i)h[e]=+h[e];else if(f=a.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(h=f.slice(1,4),e=b=0;b<=2;e=++b)h[e]=sa(2.55*h[e]);h[3]=1}else if(f=a.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(h=f.slice(1,5),e=c=0;c<=2;e=++c)h[e]=sa(2.55*h[e]);h[3]=+h[3]}else(f=a.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?(d=f.slice(1,4),d[1]*=.01,d[2]*=.01,h=G(d),h[3]=1):(f=a.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&(d=f.slice(1,4),d[1]*=.01,d[2]*=.01,h=G(d),h[3]=+f[4]);return h},da=function(a){var b;return b=a[3]<1?"rgba":"rgb","rgb"===b?b+"("+a.slice(0,3).map(sa).join(",")+")":"rgba"===b?b+"("+a.slice(0,3).map(sa).join(",")+","+a[3]+")":void 0},qa=function(a){return sa(100*a)/100},F=function(a,b){var c;return c=b<1?"hsla":"hsl",a[0]=qa(a[0]||0),a[1]=qa(100*a[1])+"%",a[2]=qa(100*a[2])+"%","hsla"===c&&(a[3]=b),c+"("+a.join(",")+")"},k.css=function(a){return x(a)},t.css=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["css"]),function(){})},a.prototype.css=function(a){return null==a&&(a="rgb"),"rgb"===a.slice(0,3)?da(this._rgb):"hsl"===a.slice(0,3)?F(this.hsl(),this.alpha()):void 0},k.named=function(a){return D(za[a])},i.push({p:5,test:function(a){if(1===arguments.length&&null!=za[a])return"named"}}),a.prototype.name=function(a){var b,c;arguments.length&&(za[a]&&(this._rgb=D(za[a])),this._rgb[3]=1),b=this.hex("rgb");for(c in za)if(b===za[c])return c;return b},R=function(){var a,c,d,e;return e=ya(arguments),d=e[0],a=e[1],c=e[2],c*=b,[d,w(c)*a,ua(c)*a]},S=function(){var a,b,c,d,e,f,g,h,i,j,k;return c=ya(arguments),h=c[0],e=c[1],g=c[2],j=R(h,e,g),a=j[0],b=j[1],d=j[2],k=P(a,b,d),i=k[0],f=k[1],d=k[2],[i,f,d,c.length>3?c[3]:1]},O=function(){var a,b,c,d,e,g;return g=ya(arguments),e=g[0],a=g[1],b=g[2],c=va(a*a+b*b),d=(n(b,a)*f+360)%360,0===sa(1e4*c)&&(d=Number.NaN),[e,c,d]},ka=function(){var a,b,c,d,e,f,g;return f=ya(arguments),e=f[0],c=f[1],b=f[2],g=ja(e,c,b),d=g[0],a=g[1],b=g[2],O(d,a,b)},t.lch=function(){var b;return b=ya(arguments),new a(b,"lch")},t.hcl=function(){var b;return b=ya(arguments),new a(b,"hcl")},k.lch=S,k.hcl=function(){var a,b,c,d;return d=ya(arguments),b=d[0],a=d[1],c=d[2],S([c,a,b])},a.prototype.lch=function(){return ka(this._rgb)},a.prototype.hcl=function(){return ka(this._rgb).reverse()},ca=function(a){var b,c,d,e,f,g,h,i,j;return null==a&&(a="rgb"),i=ya(arguments),h=i[0],e=i[1],b=i[2],h/=255,e/=255,b/=255,f=1-Math.max(h,Math.max(e,b)),d=f<1?1/(1-f):0,c=(1-h-f)*d,g=(1-e-f)*d,j=(1-b-f)*d,[c,g,j,f]},v=function(){var a,b,c,d,e,f,g,h,i;return b=ya(arguments),d=b[0],g=b[1],i=b[2],f=b[3],a=b.length>4?b[4]:1,1===f?[0,0,0,a]:(h=d>=1?0:255*(1-d)*(1-f),e=g>=1?0:255*(1-g)*(1-f),c=i>=1?0:255*(1-i)*(1-f),[h,e,c,a])},k.cmyk=function(){return v(ya(arguments))},t.cmyk=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["cmyk"]),function(){})},a.prototype.cmyk=function(){return ca(this._rgb)},k.gl=function(){var a,b,c,d,e;for(d=function(){var a,c;a=ya(arguments),c=[];for(b in a)e=a[b],c.push(e);return c}.apply(this,arguments),a=c=0;c<=2;a=++c)d[a]*=255;return d},t.gl=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["gl"]),function(){})},a.prototype.gl=function(){var a;return a=this._rgb,[a[0]/255,a[1]/255,a[2]/255,a[3]]},la=function(a,b,c){var d;return d=ya(arguments),a=d[0],b=d[1],c=d[2],a=W(a),b=W(b),c=W(c),.2126*a+.7152*b+.0722*c},W=function(a){return a/=255,a<=.03928?a/12.92:ba((a+.055)/1.055,2.4)},N=function(b,c,d,e){var f,g;return f=b._rgb,g=c._rgb,new a(f[0]+d*(g[0]-f[0]),f[1]+d*(g[1]-f[1]),f[2]+d*(g[2]-f[2]),e)},l.push(["rgb",N]),a.prototype.luminance=function(a,b){var c,d,e,f,g;return null==b&&(b="rgb"),arguments.length?(f=this._rgb,0===a?f=[0,0,0,this._rgb[3]]:1===a?f=[255,255,255,this[3]]:(c=la(this._rgb),d=1e-7,e=20,g=function(c,f){var h,i;return i=c.interpolate(f,.5,b),h=i.luminance(),Math.abs(a-h)<d||!e--?i:h>a?g(c,i):g(i,f)},f=c>a?g(t("black"),this).rgba():g(this,t("white")).rgba()),t(f).alpha(this.alpha())):la(this._rgb)},wa=function(a){var b,c,d,e;return e=a/100,e<66?(d=255,c=-155.25485562709179-.44596950469579133*(c=e-2)+104.49216199393888*V(c),b=e<20?0:.8274096064007395*(b=e-10)-254.76935184120902+115.67994401066147*V(b)):(d=351.97690566805693+.114206453784165*(d=e-55)-40.25366309332127*V(d),c=325.4494125711974+.07943456536662342*(c=e-50)-28.0852963507957*V(c),b=255),[d,c,b]},na=function(){var a,b,c,d,e,f,g,h;for(f=ya(arguments),e=f[0],f[1],a=f[2],d=1e3,c=4e4,b=.4;c-d>b;)h=.5*(c+d),g=wa(h),g[2]/g[0]>=a/e?c=h:d=h;return sa(h)},t.temperature=t.kelvin=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["temperature"]),function(){})},k.temperature=k.kelvin=k.K=wa,a.prototype.temperature=function(){return na(this._rgb)},a.prototype.kelvin=a.prototype.temperature,t.contrast=function(b,c){var d,e,f,g;return"string"!==(f=xa(b))&&"number"!==f||(b=new a(b)),"string"!==(g=xa(c))&&"number"!==g||(c=new a(c)),d=b.luminance(),e=c.luminance(),d>e?(d+.05)/(e+.05):(e+.05)/(d+.05)},t.distance=function(b,c,d){var e,f,g,h,i,j,k;null==d&&(d="lab"),"string"!==(i=xa(b))&&"number"!==i||(b=new a(b)),"string"!==(j=xa(c))&&"number"!==j||(c=new a(c)),g=b.get(d),h=c.get(d),k=0;for(f in g)e=(g[f]||0)-(h[f]||0),k+=e*e;return Math.sqrt(k)},t.deltaE=function(b,c,e,f){var g,h,i,j,k,l,o,p,q,r,s,t,u,v,x,y,z,A,B,C,D,E,F,G,H,I,J;for(null==e&&(e=1),null==f&&(f=1),"string"!==(z=xa(b))&&"number"!==z||(b=new a(b)),"string"!==(A=xa(c))&&"number"!==A||(c=new a(c)),B=b.lab(),g=B[0],i=B[1],k=B[2],C=c.lab(),h=C[0],j=C[1],l=C[2],o=va(i*i+k*k),p=va(j*j+l*l),F=g<16?.511:.040975*g/(1+.01765*g),D=.0638*o/(1+.0131*o)+.638,y=o<1e-6?0:180*n(k,i)/d;y<0;)y+=360;for(;y>=360;)y-=360;return G=y>=164&&y<=345?.56+m(.2*w(d*(y+168)/180)):.36+m(.4*w(d*(y+35)/180)),q=o*o*o*o,x=va(q/(q+1900)),E=D*(x*G+1-x),v=g-h,u=o-p,s=i-j,t=k-l,r=s*s+t*t-u*u,H=v/(e*F),I=u/(f*D),J=E,va(H*H+I*I+r/(J*J))},a.prototype.get=function(a){var b,c,d,e,f,g;return d=this,f=a.split("."),e=f[0],b=f[1],g=d[e](),b?(c=e.indexOf(b),c>-1?g[c]:console.warn("unknown channel "+b+" in mode "+e)):g},a.prototype.set=function(a,b){var c,d,e,f,g,h;if(e=this,g=a.split("."),f=g[0],c=g[1],c)if(h=e[f](),(d=f.indexOf(c))>-1)if("string"===xa(b))switch(b.charAt(0)){case"+":case"-":h[d]+=+b;break;case"*":h[d]*=+b.substr(1);break;case"/":h[d]/=+b.substr(1);break;default:h[d]=+b}else h[d]=b;else console.warn("unknown channel "+c+" in mode "+f);else h=b;return t(h,f).alpha(e.alpha())},a.prototype.clipped=function(){return this._rgb._clipped||!1},a.prototype.alpha=function(a){return arguments.length?t.rgb([this._rgb[0],this._rgb[1],this._rgb[2],a]):this._rgb[3]},a.prototype.darken=function(a){var b,d;return null==a&&(a=1),d=this,b=d.lab(),b[0]-=c.Kn*a,t.lab(b).alpha(d.alpha())},a.prototype.brighten=function(a){return null==a&&(a=1),this.darken(-a)},a.prototype.darker=a.prototype.darken,a.prototype.brighter=a.prototype.brighten,a.prototype.saturate=function(a){var b,d;return null==a&&(a=1),d=this,b=d.lch(),b[1]+=a*c.Kn,b[1]<0&&(b[1]=0),t.lch(b).alpha(d.alpha())},a.prototype.desaturate=function(a){return null==a&&(a=1),this.saturate(-a)},a.prototype.premultiply=function(){var a,b;return b=this.rgb(),a=this.alpha(),t(b[0]*a,b[1]*a,b[2]*a,a)},p=function(a,b,c){if(!p[c])throw"unknown blend mode "+c;return p[c](a,b)},q=function(a){return function(b,c){var d,e;return d=t(c).rgb(),e=t(b).rgb(),t(a(d,e),"rgb")}},A=function(a){return function(b,c){var d,e,f;for(f=[],d=e=0;e<=3;d=++e)f[d]=a(b[d],c[d]);return f}},$=function(a,b){return a},Z=function(a,b){return a*b/255},y=function(a,b){return a>b?b:a},T=function(a,b){return a>b?a:b},ta=function(a,b){return 255*(1-(1-a/255)*(1-b/255))},aa=function(a,b){return b<128?2*a*b/255:255*(1-2*(1-a/255)*(1-b/255))},s=function(a,b){return 255*(1-(1-b/255)/(a/255))},z=function(a,b){return 255===a?255:(a=b/255*255/(1-a/255),a>255?255:a)},p.normal=q(A($)),p.multiply=q(A(Z)),p.screen=q(A(ta)),p.overlay=q(A(aa)),p.darken=q(A(y)),p.lighten=q(A(T)),p.dodge=q(A(z)),p.burn=q(A(s)),t.blend=p,t.analyze=function(a){var b,c,d,e;for(d={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},c=0,b=a.length;c<b;c++)null==(e=a[c])||isNaN(e)||(d.values.push(e),d.sum+=e,e<d.min&&(d.min=e),e>d.max&&(d.max=e),d.count+=1);return d.domain=[d.min,d.max],d.limits=function(a,b){return t.limits(d,a,b)},d},t.scale=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,u,v,w,x;return k="rgb",l=t("#ccc"),p=0,!1,g=[0,1],o=[],n=[0,0],c=!1,e=[],m=!1,j=0,i=1,f=!1,d={},q=!0,h=1,w=function(a){var b,c,d,f,g,h;if(null==a&&(a=["#fff","#000"]),null!=a&&"string"===xa(a)&&null!=t.brewer&&(a=t.brewer[a]||t.brewer[a.toLowerCase()]||a),"array"===xa(a)){for(1===a.length&&(a=[a[0],a[0]]),a=a.slice(0),b=d=0,f=a.length-1;0<=f?d<=f:d>=f;b=0<=f?++d:--d)c=a[b],"string"===xa(c)&&(a[b]=t(c));for(o.length=0,b=h=0,g=a.length-1;0<=g?h<=g:h>=g;b=0<=g?++h:--h)o.push(b/(a.length-1))}return v(),e=a},s=function(a){var b,d;if(null!=c){for(d=c.length-1,b=0;b<d&&a>=c[b];)b++;return b-1}return 0},x=function(a){return a},function(a){var b,d,e,f,g;return g=a,c.length>2&&(f=c.length-1,b=s(a),e=c[0]+(c[1]-c[0])*(0+.5*p),d=c[f-1]+(c[f]-c[f-1])*(1-.5*p),g=j+(c[b]+.5*(c[b+1]-c[b])-e)/(d-e)*(i-j)),g},u=function(a,b){var f,g,m,p,r,u,v,w;if(null==b&&(b=!1),isNaN(a))return l;if(b?w=a:c&&c.length>2?(f=s(a),w=f/(c.length-2)):w=i!==j?(a-j)/(i-j):1,b||(w=x(w)),1!==h&&(w=ba(w,h)),w=n[0]+w*(1-n[0]-n[1]),w=Math.min(1,Math.max(0,w)),p=Math.floor(1e4*w),q&&d[p])g=d[p];else{if("array"===xa(e))for(m=r=0,v=o.length-1;0<=v?r<=v:r>=v;m=0<=v?++r:--r){if(u=o[m],w<=u){g=e[m];break}if(w>=u&&m===o.length-1){g=e[m];break}if(w>u&&w<o[m+1]){w=(w-u)/(o[m+1]-u),g=t.interpolate(e[m],e[m+1],w,k);break}}else"function"===xa(e)&&(g=e(w));q&&(d[p]=g)}return g},v=function(){return d={}},w(a),r=function(a){var b;return b=t(u(a)),m&&b[m]?b[m]():b},r.classes=function(a){var b;return null!=a?("array"===xa(a)?(c=a,g=[a[0],a[a.length-1]]):(b=t.analyze(g),c=0===a?[b.min,b.max]:t.limits(b,"e",a)),r):c},r.domain=function(a){var b,c,d,f,h,k,l;if(!arguments.length)return g;if(j=a[0],i=a[a.length-1],o=[],d=e.length,a.length===d&&j!==i)for(h=0,f=a.length;h<f;h++)c=a[h],o.push((c-j)/(i-j));else for(b=l=0,k=d-1;0<=k?l<=k:l>=k;b=0<=k?++l:--l)o.push(b/(d-1));return g=[j,i],r},r.mode=function(a){return arguments.length?(k=a,v(),r):k},r.range=function(a,b){return w(a,b),r},r.out=function(a){return m=a,r},r.spread=function(a){return arguments.length?(p=a,r):p},r.correctLightness=function(a){return null==a&&(a=!0),f=a,v(),x=f?function(a){var b,c,d,e,f,g,h,i,j;for(b=u(0,!0).lab()[0],c=u(1,!0).lab()[0],h=b>c,d=u(a,!0).lab()[0],f=b+(c-b)*a,e=d-f,i=0,j=1,g=20;Math.abs(e)>.01&&g-- >0;)!function(){h&&(e*=-1),e<0?(i=a,a+=.5*(j-a)):(j=a,a+=.5*(i-a)),d=u(a,!0).lab()[0],e=d-f}();return a}:function(a){return a},r},r.padding=function(a){return null!=a?("number"===xa(a)&&(a=[a,a]),n=a,r):n},r.colors=function(b,d){var f,h,i,j,k,l,m,n;if(arguments.length<2&&(d="hex"),k=[],0===arguments.length)k=e.slice(0);else if(1===b)k=[r(.5)];else if(b>1)h=g[0],f=g[1]-h,k=function(){l=[];for(var a=0;0<=b?a<b:a>b;0<=b?a++:a--)l.push(a);return l}.apply(this).map(function(a){return r(h+a/(b-1)*f)});else{if(a=[],m=[],c&&c.length>2)for(i=n=1,j=c.length;1<=j?n<j:n>j;i=1<=j?++n:--n)m.push(.5*(c[i-1]+c[i]));else m=g;k=m.map(function(a){return r(a)})}return t[d]&&(k=k.map(function(a){return a[d]()})),k},r.cache=function(a){return null!=a?(q=a,r):q},r.gamma=function(a){return null!=a?(h=a,r):h},r},null==t.scales&&(t.scales={}),t.scales.cool=function(){return t.scale([t.hsl(180,1,.9),t.hsl(250,.7,.4)])},t.scales.hot=function(){return t.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},t.analyze=function(a,b,c){var d,e,f,g,h,i,j;if(h={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==c&&(c=function(){return!0}),d=function(a){null==a||isNaN(a)||(h.values.push(a),h.sum+=a,a<h.min&&(h.min=a),a>h.max&&(h.max=a),h.count+=1)},j=function(a,e){if(c(a,e))return d(null!=b&&"function"===xa(b)?b(a):null!=b&&"string"===xa(b)||"number"===xa(b)?a[b]:a)},
+"array"===xa(a))for(g=0,f=a.length;g<f;g++)i=a[g],j(i);else for(e in a)i=a[e],j(i,e);return h.domain=[h.min,h.max],h.limits=function(a,b){return t.limits(h,a,b)},h},t.limits=function(a,b,c){var d,e,f,g,h,i,j,k,l,n,o,p,q,r,s,u,v,w,x,y,z,A,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,W,X,Z,$,_,aa,ca,da,ea,fa,ga,ha,ia,ja;if(null==b&&(b="equal"),null==c&&(c=7),"array"===xa(a)&&(a=t.analyze(a)),E=a.min,Y=a.max,a.sum,ia=a.values.sort(function(a,b){return a-b}),1===c)return[E,Y];if(C=[],"c"===b.substr(0,1)&&(C.push(E),C.push(Y)),"e"===b.substr(0,1)){for(C.push(E),y=K=1,O=c-1;1<=O?K<=O:K>=O;y=1<=O?++K:--K)C.push(E+y/c*(Y-E));C.push(Y)}else if("l"===b.substr(0,1)){if(E<=0)throw"Logarithmic scales are only possible for values > 0";for(F=Math.LOG10E*V(E),D=Math.LOG10E*V(Y),C.push(E),y=ja=1,P=c-1;1<=P?ja<=P:ja>=P;y=1<=P?++ja:--ja)C.push(ba(10,F+y/c*(D-F)));C.push(Y)}else if("q"===b.substr(0,1)){for(C.push(E),y=d=1,W=c-1;1<=W?d<=W:d>=W;y=1<=W?++d:--d)L=(ia.length-1)*y/c,M=B(L),M===L?C.push(ia[M]):(N=L-M,C.push(ia[M]*(1-N)+ia[M+1]*N));C.push(Y)}else if("k"===b.substr(0,1)){for(H=ia.length,r=new Array(H),w=new Array(c),ea=!0,I=0,u=null,u=[],u.push(E),y=e=1,X=c-1;1<=X?e<=X:e>=X;y=1<=X?++e:--e)u.push(E+y/c*(Y-E));for(u.push(Y);ea;){for(z=f=0,Z=c-1;0<=Z?f<=Z:f>=Z;z=0<=Z?++f:--f)w[z]=0;for(y=g=0,$=H-1;0<=$?g<=$:g>=$;y=0<=$?++g:--g){for(ha=ia[y],G=Number.MAX_VALUE,z=h=0,_=c-1;0<=_?h<=_:h>=_;z=0<=_?++h:--h)(x=m(u[z]-ha))<G&&(G=x,s=z);w[s]++,r[y]=s}for(J=new Array(c),z=i=0,aa=c-1;0<=aa?i<=aa:i>=aa;z=0<=aa?++i:--i)J[z]=null;for(y=j=0,ca=H-1;0<=ca?j<=ca:j>=ca;y=0<=ca?++j:--j)v=r[y],null===J[v]?J[v]=ia[y]:J[v]+=ia[y];for(z=k=0,da=c-1;0<=da?k<=da:k>=da;z=0<=da?++k:--k)J[z]*=1/w[z];for(ea=!1,z=l=0,Q=c-1;0<=Q?l<=Q:l>=Q;z=0<=Q?++l:--l)if(J[z]!==u[y]){ea=!0;break}u=J,I++,I>200&&(ea=!1)}for(A={},z=n=0,R=c-1;0<=R?n<=R:n>=R;z=0<=R?++n:--n)A[z]=[];for(y=o=0,S=H-1;0<=S?o<=S:o>=S;y=0<=S?++o:--o)v=r[y],A[v].push(ia[y]);for(fa=[],z=p=0,T=c-1;0<=T?p<=T:p>=T;z=0<=T?++p:--p)fa.push(A[z][0]),fa.push(A[z][A[z].length-1]);for(fa=fa.sort(function(a,b){return a-b}),C.push(fa[0]),y=q=1,U=fa.length-1;q<=U;y=q+=2)ga=fa[y],isNaN(ga)||-1!==C.indexOf(ga)||C.push(ga)}return C},E=function(a,b,c){var d,f,h,i;return d=ya(arguments),a=d[0],b=d[1],c=d[2],isNaN(a)&&(a=0),a/=360,a<1/3?(f=(1-b)/3,i=(1+b*w(g*a)/w(e-g*a))/3,h=1-(f+i)):a<2/3?(a-=1/3,i=(1-b)/3,h=(1+b*w(g*a)/w(e-g*a))/3,f=1-(i+h)):(a-=2/3,h=(1-b)/3,f=(1+b*w(g*a)/w(e-g*a))/3,i=1-(h+f)),i=U(c*i*3),h=U(c*h*3),f=U(c*f*3),[255*i,255*h,255*f,d.length>3?d[3]:1]},ga=function(){var a,b,c,d,e,f,h,i;return h=ya(arguments),f=h[0],b=h[1],a=h[2],g=2*Math.PI,f/=255,b/=255,a/=255,e=Math.min(f,b,a),d=(f+b+a)/3,i=1-e/d,0===i?c=0:(c=(f-b+(f-a))/2,c/=Math.sqrt((f-b)*(f-b)+(f-a)*(b-a)),c=Math.acos(c),a>b&&(c=g-c),c/=g),[360*c,i,d]},t.hsi=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["hsi"]),function(){})},k.hsi=E,a.prototype.hsi=function(){return ga(this._rgb)},J=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p;return"hsl"===d?(o=a.hsl(),p=b.hsl()):"hsv"===d?(o=a.hsv(),p=b.hsv()):"hcg"===d?(o=a.hcg(),p=b.hcg()):"hsi"===d?(o=a.hsi(),p=b.hsi()):"lch"!==d&&"hcl"!==d||(d="hcl",o=a.hcl(),p=b.hcl()),"h"===d.substr(0,1)&&(g=o[0],m=o[1],j=o[2],h=p[0],n=p[1],k=p[2]),isNaN(g)||isNaN(h)?isNaN(g)?isNaN(h)?f=Number.NaN:(f=h,1!==j&&0!==j||"hsv"===d||(l=n)):(f=g,1!==k&&0!==k||"hsv"===d||(l=m)):(e=h>g&&h-g>180?h-(g+360):h<g&&g-h>180?h+360-g:h-g,f=g+c*e),null==l&&(l=m+c*(n-m)),i=j+c*(k-j),t[d](f,l,i)},l=l.concat(function(){var a,b,c,d;for(c=["hsv","hsl","hsi","hcl","lch","hcg"],d=[],b=0,a=c.length;b<a;b++)X=c[b],d.push([X,J]);return d}()),M=function(a,b,c,d){var e,f;return e=a.num(),f=b.num(),t.num(e+(f-e)*c,"num")},l.push(["num",M]),K=function(b,c,d,e){var f,g;return f=b.lab(),g=c.lab(),new a(f[0]+d*(g[0]-f[0]),f[1]+d*(g[1]-f[1]),f[2]+d*(g[2]-f[2]),e)},l.push(["lab",K])}).call(this);
src/node_modules/chroma-js/docs/Makefile
+all:
+ cat src/index.md ../CHANGELOG.md > tmp.md
+ node $$(which markdown) -f gfm -s src/index.css tmp.md --title "chroma.js api docs!" > index.html
+ bin/post-process
+ rm tmp.md
+
+preview:
+ http-server
+ # python -m SimpleHTTPServer
src/node_modules/chroma-js/docs/assets/bg.png
Binary files differ
src/node_modules/chroma-js/docs/bin/post-process
+#!/usr/bin/env node
+var fs = require('fs');
+
+var index = fs.readFileSync('index.html', 'utf-8'),
+ footer = fs.readFileSync('src/footer.inc.html', 'utf-8');
+
+index = index.replace('</body>', '\n'+footer+'\n</body>');
+index = index.replace('<body>', '<body><div class="wrap">');
+index = index.replace('</body>', '</div></body>');
+fs.writeFileSync('index.html', index);
src/node_modules/chroma-js/docs/index.html
+<!DOCTYPE html>
+<html>
+<head>
+ <title>chroma.js api docs!</title>
+ <link rel="stylesheet" href="src/index.css">
+</head>
+<body><div class="wrap">
+<h1 id="chroma-js">chroma.js</h1>
+<p><strong>chroma.js</strong> is a tiny JavaScript library (14kB) for dealing with colors!</p>
+<p><a href="https://travis-ci.org/gka/chroma.js"><img src="https://travis-ci.org/gka/chroma.js.svg?branch=master" alt="Build Status"></a></p>
+<h2 id="quick-start">Quick-start</h2>
+<p>Here are a couple of things chroma.js can do for you:</p>
+<ul>
+<li>read colors from a wide range of formats</li>
+<li>analyze and manipulate colors</li>
+<li>convert colors into wide range of formats</li>
+<li>linear and bezier interpolation in different color spaces</li>
+</ul>
+<p>Here&#39;s an example for a simple read / manipulate / output chain:</p>
+<pre><code class="lang-js">chroma(&#39;pink&#39;).darken().saturate(2).hex()
+</code></pre>
+<p>Aside from that, chroma.js can also help you <strong>generate nice colors</strong> using various methods, for instance to be <a href="https://www.vis4.net/blog/posts/avoid-equidistant-hsv-colors/">used</a> in color palette for maps or data visualization.</p>
+<pre><code class="lang-js">chroma.scale([&#39;#fafa6e&#39;,&#39;#2A4858&#39;])
+ .mode(&#39;lch&#39;).colors(6)
+</code></pre>
+<p>chroma.js has a lot more to offer, but that&#39;s the gist of it.</p>
+<h2 id="api">API</h2>
+<h3 id="chroma">chroma</h3>
+<h4 id="-color-">(<em>color</em>)</h4>
+<p>The first step is to get your color into chroma.js. That&#39;s what the generic constructor <code>chroma()</code> does. The function is trying to guess the color format for you. For instances, it will recognized any named color from the W3CX11 specification:</p>
+<pre><code class="lang-js">chroma(&#39;hotpink&#39;)
+</code></pre>
+<p>If there&#39;s no matching named color chroma.js checks for a <strong>hexadecimal string</strong>. It ignores case, the <code>#</code> sign is optional, and the shorter three letter format is recognized as well. So any of these are valid hexadecimal representations: <code>#ff3399</code>, <code>FF3399</code>, <code>#f39</code>, etc.</p>
+<pre><code class="lang-js">chroma(&#39;#ff3399&#39;);
+chroma(&#39;F39&#39;);
+</code></pre>
+<p>In addition to hex strings, <strong>hexadecimal numbers</strong> (in fact, just any number between <code>0</code> and <code>16777215</code>), will be recognized, too.</p>
+<pre><code class="lang-js">chroma(0xff3399)
+</code></pre>
+<p>If you pass the RGB channels individually, too. Each parameter must be within <code>0..255</code>. You can pass the numbers as individual arguments or as array.</p>
+<pre><code class="lang-js">chroma(0xff, 0x33, 0x99);
+chroma(255, 51, 153);
+chroma([255, 51, 153]);
+</code></pre>
+<p>You can construct colors from different color spaces by passing the name of color space as the last argument. Here we define the same color in HSL by passing the h<em>ue angle (0-360) and percentages for </em>s<em>aturation and </em>l*ightness:</p>
+<pre><code class="lang-js">chroma(330, 1, 0.6, &#39;hsl&#39;)
+</code></pre>
+<h3 id="chroma-hsl">chroma.hsl</h3>
+<h4 id="-hue-saturation-lightness-">(hue, saturation, lightness)</h4>
+<p>Alternatively, every color space has its own constructor function under the <code>chroma</code> namespace. For a list of all supported color spaces, check the <a href="#supported-color-spaces-and-output-formats">appendix</a>.</p>
+<pre><code class="lang-js">chroma.hsl(330, 1, 0.6)
+</code></pre>
+<h3 id="chroma-hsv">chroma.hsv</h3>
+<h4 id="-hue-saturation-value-">(hue, saturation, value)</h4>
+<h3 id="chroma-lab">chroma.lab</h3>
+<h4 id="-lightness-a-b-">(Lightness, a, b)</h4>
+<h3 id="chroma-lch">chroma.lch</h3>
+<h4 id="-lightness-chroma-hue-">(Lightness, chroma, hue)</h4>
+<p>The range for <code>lightness</code> and <code>chroma</code> depend on the hue, but go roughly from 0..100-150. The range for <code>hue</code> is 0..360.</p>
+<pre><code class="lang-js">chroma.lch(80, 40, 130);
+chroma(80, 40, 130, &#39;lch&#39;);
+</code></pre>
+<h3 id="chroma-hcl">chroma.hcl</h3>
+<h4 id="-hue-chroma-lightness-">(hue, chroma, lightness)</h4>
+<p>You can use <strong>hcl</strong> instead of Lch. Lightness and hue channels are switched to be more consistent with HSL.</p>
+<pre><code class="lang-js">chroma.hcl(130, 40, 80);
+chroma(130, 40, 80, &#39;hcl&#39;);
+</code></pre>
+<h3 id="chroma-cmyk">chroma.cmyk</h3>
+<h4 id="-cyan-magenta-yellow-black-">(cyan, magenta, yellow, black)</h4>
+<p>Each between 0 and 1.</p>
+<pre><code class="lang-js">chroma.cmyk(0.2, 0.8, 0, 0);
+chroma(0.2, 0.8, 0, 0, &#39;cmyk&#39;);
+</code></pre>
+<h3 id="chroma-gl">chroma.gl</h3>
+<h4 id="-red-green-blue-alpha-">(red, green, blue, [alpha])</h4>
+<p><strong>GL</strong> is a variant of RGB(A), with the only difference that the components are normalized to the range of <code>0..1</code>.</p>
+<pre><code class="lang-js">chroma.gl(0.6, 0, 0.8);
+chroma.gl(0.6, 0, 0.8, 0.5);
+chroma(0.6, 0, 0.8, &#39;gl&#39;);
+</code></pre>
+<h3 id="chroma-temperature">chroma.temperature</h3>
+<h4 id="-k-">(K)</h4>
+<p>Returns a color from the <a href="http://www.zombieprototypes.com/?p=210">color temperature</a> scale. Based on <a href="https://github.com/neilbartlett/color-temperature">Neil Bartlett&#39;s implementation</a>.</p>
+<pre><code class="lang-js">chroma.temperature(2000); // candle light
+chroma.temperature(3500); // sunset
+chroma.temperature(6500); // daylight
+</code></pre>
+<p>The effective temperature range goes from <code>0</code> to about <code>30000</code> Kelvin,</p>
+<pre><code class="lang-js">f = function(i) {
+ return chroma.temperature(i * 30000)
+}
+</code></pre>
+<h3 id="chroma-mix">chroma.mix</h3>
+<h4 id="-color1-color2-ratio-0-5-mode-rgb-">(color1, color2, ratio=0.5, mode=&#39;rgb&#39;)</h4>
+<p>Mixes two colors. The mix <em>ratio</em> is a value between 0 and 1.</p>
+<pre><code class="lang-js">chroma.mix(&#39;red&#39;, &#39;blue&#39;);
+chroma.mix(&#39;red&#39;, &#39;blue&#39;, 0.25);
+chroma.mix(&#39;red&#39;, &#39;blue&#39;, 0.75);
+</code></pre>
+<p>The color mixing produces different results based the color space used for interpolation.</p>
+<pre><code class="lang-js">chroma.mix(&#39;red&#39;, &#39;blue&#39;, 0.5, &#39;rgb&#39;);
+chroma.mix(&#39;red&#39;, &#39;blue&#39;, 0.5, &#39;hsl&#39;);
+chroma.mix(&#39;red&#39;, &#39;blue&#39;, 0.5, &#39;lab&#39;);
+chroma.mix(&#39;red&#39;, &#39;blue&#39;, 0.5, &#39;lch&#39;);
+chroma.mix(&#39;red&#39;, &#39;blue&#39;, 0.5, &#39;lrgb&#39;);
+</code></pre>
+<h3 id="chroma-average">chroma.average</h3>
+<h4 id="-colors-mode-rgb-">(colors, mode=&#39;rgb&#39;)</h4>
+<p>Similar to <code>chroma.mix</code>, but accepts more than two colors. Simple averaging of R,G,B components and the alpha channel.</p>
+<pre><code class="lang-js">colors = [&#39;#ddd&#39;, &#39;yellow&#39;, &#39;red&#39;, &#39;teal&#39;];
+chroma.average(colors); // rgb
+chroma.average(colors, &#39;lab&#39;);
+chroma.average(colors, &#39;lch&#39;);
+chroma.average(colors, &#39;lrgb&#39;);
+</code></pre>
+<p>Also works with alpha channels.</p>
+<pre><code class="lang-js">chroma.average([&#39;red&#39;, &#39;rgba(0,0,0,0.5)&#39;]).css();
+</code></pre>
+<h3 id="chroma-blend">chroma.blend</h3>
+<h4 id="-color1-color2-mode-">(color1, color2, mode)</h4>
+<p>Blends two colors using RGB channel-wise blend functions. Valid blend modes are <code>multiply</code>, <code>darken</code>, <code>lighten</code>, <code>screen</code>, <code>overlay</code>, <code>burn</code>, and <code>dodge</code>.</p>
+<pre><code class="lang-js">chroma.blend(&#39;4CBBFC&#39;, &#39;EEEE22&#39;, &#39;multiply&#39;);
+chroma.blend(&#39;4CBBFC&#39;, &#39;EEEE22&#39;, &#39;darken&#39;);
+chroma.blend(&#39;4CBBFC&#39;, &#39;EEEE22&#39;, &#39;lighten&#39;);
+</code></pre>
+<h3 id="chroma-random">chroma.random</h3>
+<h4 id="-">()</h4>
+<p>Creates a random color by generating a <a href="https://github.com/gka/chroma.js/blob/master/src/generator/random.coffee#L3-L7">random hexadecimal string</a>.</p>
+<pre><code class="lang-js">chroma.random();
+chroma.random();
+chroma.random();
+</code></pre>
+<h3 id="chroma-contrast">chroma.contrast</h3>
+<h4 id="-color1-color2-">(color1, color2)</h4>
+<p>Computes the WCAG contrast ratio between two colors. A minimum contrast of 4.5:1 <a href="http://www.w3.org/TR/WCAG20-TECHS/G18.html">is recommended</a> to ensure that text is still readable against a background color.</p>
+<pre><code class="lang-js">// contrast smaller than 4.5 = too low
+chroma.contrast(&#39;pink&#39;, &#39;hotpink&#39;);
+// contrast greater than 4.5 = high enough
+chroma.contrast(&#39;pink&#39;, &#39;purple&#39;);
+</code></pre>
+<h3 id="chroma-distance">chroma.distance</h3>
+<h4 id="-color1-color2-mode-lab-">(color1, color2, mode=&#39;lab&#39;)</h4>
+<p>Computes the <a href="https://en.wikipedia.org/wiki/Euclidean_distance#Three_dimensions">Euclidean distance</a> between two colors in a given color space (default is <code>Lab</code>).</p>
+<pre><code class="lang-js">chroma.distance(&#39;#fff&#39;, &#39;#ff0&#39;, &#39;rgb&#39;);
+chroma.distance(&#39;#fff&#39;, &#39;#f0f&#39;, &#39;rgb&#39;);
+chroma.distance(&#39;#fff&#39;, &#39;#ff0&#39;);
+chroma.distance(&#39;#fff&#39;, &#39;#f0f&#39;);
+</code></pre>
+<h3 id="chroma-deltae">chroma.deltaE</h3>
+<h4 id="-reference-sample-l-1-c-1-">(reference, sample, L=1, C=1)</h4>
+<p>Computes <a href="https://en.wikipedia.org/wiki/Color_difference#CMC_l:c_.281984.29">color difference</a> as developed by the Colour Measurement Committee of the Society of Dyers and Colourists (CMC) in 1984. The implementation is adapted from <a href="https://web.archive.org/web/20160306044036/http://www.brucelindbloom.com/javascript/ColorDiff.js">Bruce Lindbloom</a>. The parameters L and C are weighting factors for lightness and chromaticity.</p>
+<pre><code class="lang-js">chroma.deltaE(&#39;#ededee&#39;, &#39;#edeeed&#39;);
+chroma.deltaE(&#39;#ececee&#39;, &#39;#eceeec&#39;);
+chroma.deltaE(&#39;#e9e9ee&#39;, &#39;#e9eee9&#39;);
+chroma.deltaE(&#39;#e4e4ee&#39;, &#39;#e4eee4&#39;);
+chroma.deltaE(&#39;#e0e0ee&#39;, &#39;#e0eee0&#39;);
+</code></pre>
+<h3 id="chroma-brewer">chroma.brewer</h3>
+<p>chroma.brewer is an map of ColorBrewer scales that are included in chroma.js for convenience. chroma.scale uses the colors to construct.</p>
+<pre><code class="lang-js">chroma.brewer.OrRd
+</code></pre>
+<h3 id="chroma-limits">chroma.limits</h3>
+<h4 id="-data-mode-n-">(data, mode, n)</h4>
+<p>A helper function that computes class breaks for you, based on data. It supports the modes <em>equidistant</em> (e), <em>quantile</em> (q), <em>logarithmic</em> (l), and <em>k-means</em> (k). Let&#39;s take a few numbers as sample data.</p>
+<pre><code class="lang-js">var data = [2.0,3.5,3.6,3.8,3.8,4.1,4.3,4.4,
+ 4.6,4.9,5.2,5.3,5.4,5.7,5.8,5.9,
+ 6.2,6.5,6.8,7.2,8];
+</code></pre>
+<p><strong>equidistant</strong> breaks are computed by dividing the total range of the data into <em>n</em> groups of equal size.</p>
+<pre><code class="lang-js">chroma.limits(data, &#39;e&#39;, 4);
+</code></pre>
+<p>In the <strong>quantile</strong> mode, the input domain is divided by quantile ranges.</p>
+<pre><code class="lang-js">chroma.limits(data, &#39;q&#39;, 4);
+</code></pre>
+<p><strong>logarithmic</strong> breaks are equidistant breaks but on a logarithmic scale.</p>
+<pre><code class="lang-js">chroma.limits(data, &#39;l&#39;, 4);
+</code></pre>
+<p><strong>k-means</strong> break is using the 1-dimensional <a href="https://en.wikipedia.org/wiki/K-means_clustering">k-means clustering</a> algorithm to find (roughly) <em>n</em> groups of &quot;similar&quot; values. Note that this k-means implementation does not guarantee to find exactly <em>n</em> groups.</p>
+<pre><code class="lang-js">chroma.limits(data, &#39;k&#39;, 4);
+</code></pre>
+<h2 id="color">color</h2>
+<h3 id="color-alpha">color.alpha</h3>
+<h4 id="-a-">(a)</h4>
+<p>Get and set the color opacity using <code>color.alpha</code>.</p>
+<pre><code class="lang-js">chroma(&#39;red&#39;).alpha(0.5);
+chroma(&#39;rgba(255,0,0,0.35)&#39;).alpha();
+</code></pre>
+<h3 id="color-darken">color.darken</h3>
+<h4 id="-value-1-">(value=1)</h4>
+<p>Once loaded, chroma.js can change colors. One way we already saw above, you can change the lightness.</p>
+<pre><code class="lang-js">chroma(&#39;hotpink&#39;).darken();
+chroma(&#39;hotpink&#39;).darken(2);
+chroma(&#39;hotpink&#39;).darken(2.6);
+</code></pre>
+<h3 id="color-brighten">color.brighten</h3>
+<h4 id="-value-1-">(value=1)</h4>
+<p>Similar to <code>darken</code>, but the opposite direction</p>
+<pre><code class="lang-js">chroma(&#39;hotpink&#39;).brighten();
+chroma(&#39;hotpink&#39;).brighten(2);
+chroma(&#39;hotpink&#39;).brighten(3);
+</code></pre>
+<h3 id="color-saturate">color.saturate</h3>
+<h4 id="-value-1-">(value=1)</h4>
+<p>Changes the saturation of a color by manipulating the Lch chromaticity.</p>
+<pre><code class="lang-js">chroma(&#39;slategray&#39;).saturate();
+chroma(&#39;slategray&#39;).saturate(2);
+chroma(&#39;slategray&#39;).saturate(3);
+</code></pre>
+<h3 id="color-desaturate">color.desaturate</h3>
+<h4 id="-value-1-">(value=1)</h4>
+<p>Similar to <code>saturate</code>, but the opposite direction.</p>
+<pre><code class="lang-js">chroma(&#39;hotpink&#39;).desaturate();
+chroma(&#39;hotpink&#39;).desaturate(2);
+chroma(&#39;hotpink&#39;).desaturate(3);
+</code></pre>
+<h3 id="color-set">color.set</h3>
+<h4 id="-channel-value-">(channel, value)</h4>
+<p>Changes a single channel and returns the result a new <code>chroma</code> object.</p>
+<pre><code class="lang-js">// change hue to 0 deg (=red)
+chroma(&#39;skyblue&#39;).set(&#39;hsl.h&#39;, 0);
+// set chromaticity to 30
+chroma(&#39;hotpink&#39;).set(&#39;lch.c&#39;, 30);
+</code></pre>
+<p>Relative changes work, too:</p>
+<pre><code class="lang-js">// half Lab lightness
+chroma(&#39;orangered&#39;).set(&#39;lab.l&#39;, &#39;*0.5&#39;);
+// double Lch saturation
+chroma(&#39;darkseagreen&#39;).set(&#39;lch.c&#39;, &#39;*2&#39;);
+</code></pre>
+<h3 id="color-get">color.get</h3>
+<h4 id="-channel-">(channel)</h4>
+<p>Returns a single channel value.</p>
+<pre><code class="lang-js">chroma(&#39;orangered&#39;).get(&#39;lab.l&#39;);
+chroma(&#39;orangered&#39;).get(&#39;hsl.l&#39;);
+chroma(&#39;orangered&#39;).get(&#39;rgb.g&#39;);
+</code></pre>
+<h3 id="color-luminance">color.luminance</h3>
+<h4 id="-lum-mode-rgb-">([lum, mode=&#39;rgb&#39;])</h4>
+<p>If called without arguments color.luminance returns the relative brightness, according to the <a href="http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef">WCAG definition</a>. Normalized to <code>0</code> for darkest black and <code>1</code> for lightest white.</p>
+<pre><code class="lang-js">chroma(&#39;white&#39;).luminance();
+chroma(&#39;aquamarine&#39;).luminance();
+chroma(&#39;hotpink&#39;).luminance();
+chroma(&#39;darkslateblue&#39;).luminance();
+chroma(&#39;black&#39;).luminance();
+</code></pre>
+<p>chroma.js also allows you to <strong>adjust the luminance</strong> of a color. The source color will be interpolated with black or white until the correct luminance is found.</p>
+<pre><code class="lang-js">// set lumincance to 50% for all colors
+chroma(&#39;white&#39;).luminance(0.5);
+chroma(&#39;aquamarine&#39;).luminance(0.5);
+chroma(&#39;hotpink&#39;).luminance(0.5);
+chroma(&#39;darkslateblue&#39;).luminance(0.5);
+</code></pre>
+<p>By default, this interpolation is done in RGB, but you can interpolate in different color spaces by passing them as second argument:</p>
+<pre><code class="lang-js">chroma(&#39;aquamarine&#39;).luminance(0.5); // rgb
+chroma(&#39;aquamarine&#39;).luminance(0.5, &#39;lab&#39;);
+chroma(&#39;aquamarine&#39;).luminance(0.5, &#39;hsl&#39;);
+</code></pre>
+<h3 id="color-hex">color.hex</h3>
+<h4 id="-mode-auto-rgb-rgba-">(mode=&#39;auto|rgb|rgba&#39;)</h4>
+<p>Finally, chroma.js allows you to output colors in various color spaces and formats. Most often you will want to output the color as hexadecimal string.</p>
+<pre><code class="lang-js">chroma(&#39;orange&#39;).hex()
+</code></pre>
+<p><strong>Note</strong> that as of version 1.4.0 the default mode is &quot;auto&quot; which means that the hex string will include the alpha channel if it&#39;s less than 1. If you don&#39;t want the alpha channel to be included you must explicitly set the mode to &quot;rgb&quot; now:</p>
+<pre><code class="lang-js">chroma(&#39;orange&#39;).hex();
+chroma(&#39;orange&#39;).alpha(0.5).hex();
+chroma(&#39;orange&#39;).alpha(0.5).hex(&#39;rgb&#39;);
+</code></pre>
+<h3 id="color-name">color.name</h3>
+<p>Returns the named color. Falls back to hexadecimal RGB string, if the color isn&#39;t present.</p>
+<pre><code class="lang-js">chroma(&#39;#ffa500&#39;).name();
+chroma(&#39;#ffa505&#39;).name();
+</code></pre>
+<h3 id="color-css">color.css</h3>
+<p>Returns a <code>RGB()</code> or <code>HSL()</code> string representation that can be used as CSS-color definition.</p>
+<pre><code class="lang-js">chroma(&#39;teal&#39;).css();
+chroma(&#39;teal&#39;).alpha(0.5).css();
+chroma(&#39;teal&#39;).css(&#39;hsl&#39;);
+</code></pre>
+<h3 id="color-rgb">color.rgb</h3>
+<h4 id="-round-true-">(round=true)</h4>
+<p>Returns an array with the <code>red</code>, <code>green</code>, and <code>blue</code> component, each as number within the range <code>0..255</code>. Chroma internally stores RGB channels as floats but rounds the numbers before returning them. You can pass <code>false</code> to prevent the rounding.</p>
+<pre><code class="lang-js">chroma(&#39;orange&#39;).rgb();
+chroma(&#39;orange&#39;).darken().rgb();
+chroma(&#39;orange&#39;).darken().rgb(false);
+</code></pre>
+<h3 id="color-rgba">color.rgba</h3>
+<h4 id="-round-true-">(round=true)</h4>
+<p>Just like <code>color.rgb</code> but adds the alpha channel to the returned array.</p>
+<pre><code class="lang-js">chroma(&#39;orange&#39;).rgba();
+chroma(&#39;hsla(20, 100%, 40%, 0.5)&#39;).rgba();
+</code></pre>
+<h3 id="color-hsl">color.hsl</h3>
+<p>Returns an array with the <code>hue</code>, <code>saturation</code>, and <code>lightness</code> component. Hue is the color angle in degree (<code>0..360</code>), saturation and lightness are within <code>0..1</code>. Note that for hue-less colors (black, white, and grays), the hue component will be NaN.</p>
+<pre><code class="lang-js">chroma(&#39;orange&#39;).hsl();
+chroma(&#39;white&#39;).hsl();
+</code></pre>
+<h3 id="color-hsv">color.hsv</h3>
+<p>Returns an array with the <code>hue</code>, <code>saturation</code>, and <code>value</code> components. Hue is the color angle in degree (<code>0..360</code>), saturation and value are within <code>0..1</code>. Note that for hue-less colors (black, white, and grays), the hue component will be NaN.</p>
+<pre><code class="lang-js">chroma(&#39;orange&#39;).hsv();
+chroma(&#39;white&#39;).hsv();
+</code></pre>
+<h3 id="color-hsi">color.hsi</h3>
+<p>Returns an array with the <code>hue</code>, <code>saturation</code>, and <code>intensity</code> components, each as number between 0 and 255. Note that for hue-less colors (black, white, and grays), the hue component will be NaN.</p>
+<pre><code class="lang-js">chroma(&#39;orange&#39;).hsi();
+chroma(&#39;white&#39;).hsi();
+</code></pre>
+<h3 id="color-lab">color.lab</h3>
+<p>Returns an array with the <strong>L</strong>, <strong>a</strong>, and <strong>b</strong> components.</p>
+<pre><code class="lang-js">chroma(&#39;orange&#39;).lab()
+</code></pre>
+<h3 id="color-lch">color.lch</h3>
+<p>Returns an array with the <strong>Lightness</strong>, <strong>chroma</strong>, and <strong>hue</strong> components.</p>
+<pre><code class="lang-js">chroma(&#39;skyblue&#39;).lch()
+</code></pre>
+<h3 id="color-hcl">color.hcl</h3>
+<p>Alias of <a href="#color-lch">lch</a>, but with the components in reverse order.</p>
+<pre><code class="lang-js">chroma(&#39;skyblue&#39;).hcl()
+</code></pre>
+<h3 id="color-num">color.num</h3>
+<p>Returns the numeric representation of the hexadecimal RGB color.</p>
+<pre><code class="lang-js">chroma(&#39;#000000&#39;).num();
+chroma(&#39;#0000ff&#39;).num();
+chroma(&#39;#00ff00&#39;).num();
+chroma(&#39;#ff0000&#39;).num();
+</code></pre>
+<h3 id="color-temperature">color.temperature</h3>
+<p>Estimate the temperature in Kelvin of any given color, though this makes the only sense for colors from the <a href="#chroma-temperature">temperature gradient</a> above.</p>
+<pre><code class="lang-js">chroma(&#39;#ff3300&#39;).temperature();
+chroma(&#39;#ff8a13&#39;).temperature();
+chroma(&#39;#ffe3cd&#39;).temperature();
+chroma(&#39;#cbdbff&#39;).temperature();
+chroma(&#39;#b3ccff&#39;).temperature();
+</code></pre>
+<h3 id="color-gl">color.gl</h3>
+<p>Like RGB, but in the channel range of <code>[0..1]</code> instead of <code>[0..255]</code></p>
+<pre><code class="lang-js">chroma(&#39;33cc00&#39;).gl();
+</code></pre>
+<h3 id="color-clipped">color.clipped</h3>
+<p>When converting colors from CIELab color spaces to RGB the color channels get clipped to the range of <code>[0..255]</code>. Colors outside that range may exist in nature but are not displayable on RGB monitors (such as ultraviolet). you can use color.clipped to test if a color has been clipped or not.</p>
+<pre><code class="lang-js">[c = chroma.hcl(50, 40, 20), c.clipped()];
+[c = chroma.hcl(50, 40, 40), c.clipped()];
+[c = chroma.hcl(50, 40, 60), c.clipped()];
+[c = chroma.hcl(50, 40, 80), c.clipped()];
+[c = chroma.hcl(50, 40, 100), c.clipped()];
+</code></pre>
+<p>As a bonus feature you can access the unclipped RGB components using <code>color._rgb._unclipped</code>.</p>
+<pre><code class="lang-js">chroma.hcl(50, 40, 100).rgb();
+chroma.hcl(50, 40, 100)._rgb._unclipped;
+</code></pre>
+<h2 id="color-scales">color scales</h2>
+<h3 id="chroma-scale">chroma.scale</h3>
+<h4 id="-colors-white-black-">(colors=[&#39;white&#39;,&#39;black&#39;])</h4>
+<p>A color scale, created with <code>chroma.scale</code>, is a function that maps numeric values to a color palette. The default scale has the domain <code>0..1</code> and goes from white to black.</p>
+<pre><code class="lang-js">f = chroma.scale();
+f(0.25);
+f(0.5);
+f(0.75);
+</code></pre>
+<p>You can pass an array of colors to <code>chroma.scale</code>. Any color that can be read by <code>chroma()</code> will work here, too. If you pass more than two colors, they will be evenly distributed along the gradient.</p>
+<pre><code class="lang-js">chroma.scale([&#39;yellow&#39;, &#39;008ae5&#39;]);
+chroma.scale([&#39;yellow&#39;, &#39;red&#39;, &#39;black&#39;]);
+</code></pre>
+<h3 id="scale-domain">scale.domain</h3>
+<h4 id="-domain-">(domain)</h4>
+<p>You can change the input domain to match your specific use case.</p>
+<pre><code class="lang-js">// default domain is [0,1]
+chroma.scale([&#39;yellow&#39;, &#39;008ae5&#39;]);
+// set domain to [0,100]
+chroma.scale([&#39;yellow&#39;, &#39;008ae5&#39;]).domain([0,100]);
+</code></pre>
+<p>You can use the domain to set the exact positions of each color.</p>
+<pre><code class="lang-js">// default domain is [0,1]
+chroma.scale([&#39;yellow&#39;, &#39;lightgreen&#39;, &#39;008ae5&#39;])
+ .domain([0,0.25,1]);
+</code></pre>
+<h3 id="scale-mode">scale.mode</h3>
+<h4 id="-mode-">(mode)</h4>
+<p>As with <code>chroma.mix</code>, the result of the color interpolation will depend on the color mode in which the channels are interpolated. The default mode is <code>RGB</code>:</p>
+<pre><code class="lang-js">chroma.scale([&#39;yellow&#39;, &#39;008ae5&#39;]);
+</code></pre>
+<p>This is often fine, but sometimes, two-color <code>RGB</code> gradients goes through kind of grayish colors, and <code>Lab</code> interpolation produces better results:</p>
+<pre><code class="lang-js">chroma.scale([&#39;yellow&#39;, &#39;navy&#39;]);
+chroma.scale([&#39;yellow&#39;, &#39;navy&#39;]).mode(&#39;lab&#39;);
+</code></pre>
+<p>Also note how the RGB interpolation can get very dark around the center. You can achieve better results using <a href="https://www.youtube.com/watch?v=LKnqECcg6Gw">linear RGB interpolation</a>:</p>
+<pre><code class="lang-js">chroma.scale([&#39;#f00&#39;, &#39;#0f0&#39;]);
+chroma.scale([&#39;#f00&#39;, &#39;#0f0&#39;]).mode(&#39;lrgb&#39;);
+</code></pre>
+<p>Other useful interpolation modes could be <code>HSL</code> or <code>Lch</code>, though both tend to produce too saturated / glowing gradients.</p>
+<pre><code class="lang-js">chroma.scale([&#39;yellow&#39;, &#39;navy&#39;]).mode(&#39;lab&#39;);
+chroma.scale([&#39;yellow&#39;, &#39;navy&#39;]).mode(&#39;hsl&#39;);
+chroma.scale([&#39;yellow&#39;, &#39;navy&#39;]).mode(&#39;lch&#39;);
+</code></pre>
+<h3 id="scale-gamma">scale.gamma</h3>
+<p>Gamma-correction can be used to &quot;shift&quot; a scale&#39;s center more the the beginning (gamma &lt; 1) or end (gamma &gt; 1), typically used to &quot;even&quot; the lightness gradient. Default is 1.</p>
+<pre><code class="lang-js">chroma.scale(&#39;YlGn&#39;).gamma(0.5);
+chroma.scale(&#39;YlGn&#39;).gamma(1);
+chroma.scale(&#39;YlGn&#39;).gamma(2);
+</code></pre>
+<h3 id="scale-correctlightness">scale.correctLightness</h3>
+<p>This makes sure the lightness range is spread evenly across a color scale. Especially useful when working with <a href="https://www.vis4.net/blog/2013/09/mastering-multi-hued-color-scales/">multi-hue color scales</a>, where simple gamma correction can&#39;t help you very much.</p>
+<pre><code class="lang-js">chroma.scale([&#39;black&#39;,&#39;red&#39;,&#39;yellow&#39;,&#39;white&#39;]);
+
+chroma.scale([&#39;black&#39;,&#39;red&#39;,&#39;yellow&#39;,&#39;white&#39;])
+ .correctLightness();
+</code></pre>
+<h3 id="scale-cache">scale.cache</h3>
+<h4 id="-true-false-">(true|false)</h4>
+<p>By default <code>chroma.scale</code> instances will cache each computed value =&gt; color pair. You can turn off the cache by setting</p>
+<pre><code class="lang-js">chroma.scale([&#39;yellow&#39;, &#39;008ae5&#39;]).cache(false);
+</code></pre>
+<h3 id="scale-padding">scale.padding</h3>
+<h4 id="-pad-">(pad)</h4>
+<p>Reduces the color range by cutting of a fraction of the gradient on both sides. If you pass a single number, the same padding will be applied to both ends.</p>
+<pre><code class="lang-js">chroma.scale(&#39;RdYlBu&#39;);
+chroma.scale(&#39;RdYlBu&#39;).padding(0.15);
+chroma.scale(&#39;RdYlBu&#39;).padding(0.3);
+chroma.scale(&#39;RdYlBu&#39;).padding(-0.15);
+</code></pre>
+<p>Alternatively you can specify the padding for each sides individually by passing an array of two numbers.</p>
+<pre><code class="lang-js">chroma.scale(&#39;OrRd&#39;);
+chroma.scale(&#39;OrRd&#39;).padding([0.2, 0]);
+</code></pre>
+<h3 id="scale-colors">scale.colors</h3>
+<h4 id="-num-format-hex-">(num, format=&#39;hex&#39;)</h4>
+<p>You can call <code>scale.colors(n)</code> to quickly grab <code>n</code> equi-distant colors from a color scale. If called with no arguments, <code>scale.colors</code> returns the original array of colors used to create the scale.</p>
+<pre><code class="lang-js">chroma.scale(&#39;OrRd&#39;).colors(5);
+chroma.scale([&#39;white&#39;, &#39;black&#39;]).colors(12);
+</code></pre>
+<p>If you want to return <code>chroma</code> instances just pass <em>null</em> as <code>format</code>.</p>
+<h3 id="scale-classes">scale.classes</h3>
+<h4 id="-numorarray-">(numOrArray)</h4>
+<p>If you want the scale function to return a distinct set of colors instead of a continuous gradient, you can use <code>scale.classes</code>. If you pass a number the scale will broken into equi-distant classes:</p>
+<pre><code class="lang-js">// continuous
+chroma.scale(&#39;OrRd&#39;);
+// class breaks
+chroma.scale(&#39;OrRd&#39;).classes(5);
+chroma.scale(&#39;OrRd&#39;).classes(8);
+</code></pre>
+<p>You can also define custom class breaks by passing them as array:</p>
+<pre><code class="lang-js">chroma.scale(&#39;OrRd&#39;).classes([0,0.3,0.55,0.85,1]);
+</code></pre>
+<h3 id="chroma-brewer">chroma.brewer</h3>
+<p>chroma.js includes the definitions from <a href="http://colorbrewer2.org/">ColorBrewer2.org</a>. Read more about these colors <a href="http://www.albany.edu/faculty/fboscoe/papers/harrower2003.pdf">in the corresponding paper</a> by Mark Harrower and Cynthia A. Brewer.</p>
+<pre><code class="lang-js">chroma.scale(&#39;YlGnBu&#39;);
+chroma.scale(&#39;Spectral&#39;);
+</code></pre>
+<p>To reverse the colors you could simply reverse the domain:</p>
+<pre><code class="lang-js">chroma.scale(&#39;Spectral&#39;).domain([1,0]);
+</code></pre>
+<p>You can access the colors directly using <code>chroma.brewer</code>.</p>
+<pre><code class="lang-js">chroma.brewer.OrRd
+</code></pre>
+<h3 id="chroma-bezier">chroma.bezier</h3>
+<h4 id="-colors-">(colors)</h4>
+<p><code>chroma.bezier</code> returns a function that <a href="https://www.vis4.net/blog/posts/mastering-multi-hued-color-scales/">bezier-interpolates between colors</a> in <code>Lab</code> space. The input range of the function is <code>[0..1]</code>.</p>
+<pre><code class="lang-js">// linear interpolation
+chroma.scale([&#39;yellow&#39;, &#39;red&#39;, &#39;black&#39;]);
+// bezier interpolation
+chroma.bezier([&#39;yellow&#39;, &#39;red&#39;, &#39;black&#39;]);
+</code></pre>
+<p>You can convert an bezier interpolator into a chroma.scale instance</p>
+<pre><code class="lang-js">chroma.bezier([&#39;yellow&#39;, &#39;red&#39;, &#39;black&#39;])
+ .scale()
+ .colors(5);
+</code></pre>
+<h2 id="cubehelix">cubehelix</h2>
+<h3 id="chroma-cubehelix">chroma.cubehelix</h3>
+<h4 id="-start-300-rotations-1-5-hue-1-gamma-1-lightness-0-1-">(start=300, rotations=-1.5, hue=1, gamma=1, lightness=[0,1])</h4>
+<p>Dave Green&#39;s <a href="http://www.mrao.cam.ac.uk/~dag/CUBEHELIX/">cubehelix color scheme</a>!!</p>
+<pre><code class="lang-js">// use the default helix...
+chroma.cubehelix();
+// or customize it
+chroma.cubehelix()
+ .start(200)
+ .rotations(-0.5)
+ .gamma(0.8)
+ .lightness([0.3, 0.8]);
+</code></pre>
+<h3 id="cubehelix-start">cubehelix.start</h3>
+<h4 id="-hue-">(hue)</h4>
+<p><strong>start</strong> color for <a href="http://en.wikipedia.org/wiki/Hue#/media/File:HueScale.svg">hue rotation</a>, default=<code>300</code></p>
+<pre><code class="lang-js">chroma.cubehelix().start(300);
+chroma.cubehelix().start(200);
+</code></pre>
+<h3 id="cubehelix-rotations">cubehelix.rotations</h3>
+<h4 id="-num-">(num)</h4>
+<p>number (and direction) of hue rotations (e.g. 1=<code>360°</code>, 1.5=`540°``), default=-1.5</p>
+<pre><code class="lang-js">chroma.cubehelix().rotations(-1.5);
+chroma.cubehelix().rotations(0.5);
+chroma.cubehelix().rotations(3);
+</code></pre>
+<h3 id="cubehelix-hue">cubehelix.hue</h3>
+<h4 id="-numorrange-">(numOrRange)</h4>
+<p>hue controls how saturated the colour of all hues are. either single value or range, default=1</p>
+<pre><code class="lang-js">chroma.cubehelix();
+chroma.cubehelix().hue(0.5);
+chroma.cubehelix().hue([1,0]);
+</code></pre>
+<h3 id="cubehelix-gamma">cubehelix.gamma</h3>
+<h4 id="-factor-">(factor)</h4>
+<p>gamma factor can be used to emphasise low or high intensity values, default=1</p>
+<pre><code class="lang-js">chroma.cubehelix().gamma(1);
+chroma.cubehelix().gamma(0.5);
+</code></pre>
+<h3 id="cubehelix-lightness">cubehelix.lightness</h3>
+<h4 id="-range-">(range)</h4>
+<p>lightness range: default: [0,1] (black -&gt; white)</p>
+<pre><code class="lang-js">chroma.cubehelix().lightness([0,1]);
+chroma.cubehelix().lightness([1,0]);
+chroma.cubehelix().lightness([0.3,0.7]);
+</code></pre>
+<h3 id="cubehelix-scale">cubehelix.scale</h3>
+<p>You can call <code>cubehelix.scale()</code> to use the cube-helix through the <code>chroma.scale</code> interface.</p>
+<pre><code class="lang-js">chroma.cubehelix()
+ .start(200)
+ .rotations(-0.35)
+ .gamma(0.7)
+ .lightness([0.3, 0.8])
+ .scale() // convert to chroma.scale
+ .correctLightness()
+ .colors(5);
+</code></pre>
+<h2 id="changelog">Changelog</h2>
+<h3 id="1-4-0">1.4.0</h3>
+<ul>
+<li>color.hex() now automatically sets the mode to &#39;rgba&#39; if the colors alpha channel is &lt; 1. so <code>chroma(&#39;rgba(255,0,0,.5)&#39;).hex()</code> will now return <code>&quot;#ff000080&quot;</code> instead of <code>&quot;#ff0000&quot;</code>. if this is not what you want, you must explicitly set the mode to <code>rgb</code> using <code>.hex(&quot;rgb&quot;)</code>.</li>
+</ul>
+<h3 id="1-3-5">1.3.5</h3>
+<ul>
+<li>added LRGB interpolation</li>
+</ul>
+<h3 id="1-3-4">1.3.4</h3>
+<ul>
+<li>passing <em>null</em> as mode in scale.colors will return chroma objects</li>
+</ul>
+<h3 id="1-3-3">1.3.3</h3>
+<ul>
+<li>added <a href="https://gka.github.io/chroma.js/#color-clipped">color.clipped</a></li>
+<li>added <a href="https://gka.github.io/chroma.js/#chroma-distance">chroma.distance</a></li>
+<li>added <a href="https://gka.github.io/chroma.js/#chroma-deltae">chroma.deltaE</a></li>
+<li><a href="https://gka.github.io/chroma.js/#color-set">color.set</a> now returns a new chroma instance</li>
+<li>chroma.scale now allows <a href="https://gka.github.io/chroma.js/#scale-cache">disabling of internal cache</a></li>
+<li><a href="https://gka.github.io/chroma.js/#chroma-average">chroma.average</a> now works with any color mode</li>
+<li>added unit tests for color conversions</li>
+<li>use hex colors as default string representation</li>
+<li>RGB channels are now stored as floats internally for higher precision</li>
+<li>bugfix with cubehelix and constant lightness</li>
+<li>bugfix in chroma.limits quantiles</li>
+<li>bugfix when running scale.colors(1)</li>
+<li>bugfix in hsi2rgb color conversion</li>
+</ul>
+<h3 id="1-2-2">1.2.2</h3>
+<ul>
+<li>scale.colors() now returns the original colors instead of just min/max range</li>
+</ul>
+<h3 id="1-2-0">1.2.0</h3>
+<ul>
+<li>added chroma.average for averaging colors</li>
+</ul>
+<h3 id="1-1-0">1.1.0</h3>
+<ul>
+<li>refactored chroma.scale</li>
+<li>changed behaviour of scale.domain</li>
+<li>added scale.classes</li>
+<li>added scale.padding</li>
+</ul>
+<h3 id="1-0-2">1.0.2</h3>
+<ul>
+<li>standardized alpha channel construction</li>
+<li>chroma.bezier automatically returns chroma.scale</li>
+</ul>
+<h3 id="1-0-1">1.0.1</h3>
+<ul>
+<li>added simple color output to chroma.scale().colors()</li>
+</ul>
+<h3 id="1-0-0">1.0.0</h3>
+<ul>
+<li>numeric interpolation does what it should</li>
+<li>refactored and modularized code base</li>
+<li>changed argument order of Color::interpolate</li>
+</ul>
+
+<link rel="stylesheet" type="text/css" href="libs/codemirror/lib/codemirror.css">
+<script type="text/javascript" src="libs/jquery/jquery-1.11.1.min.js"></script>
+<script type="text/javascript" src="libs/chroma.min.js"></script>
+<script type="text/javascript" src="libs/codemirror/lib/codemirror.js"></script>
+<script type="text/javascript" src="libs/codemirror/mode/javascript/javascript.js"></script>
+
+<script type="text/javascript">
+
+(function($) {
+ $('code.lang-js').each(function() {
+
+ var code = this;
+
+ var cm = CodeMirror(function(elt) {
+ code.parentNode.replaceChild(elt, code);
+ }, {
+ value: code.innerHTML.trim(),
+ indentUnit: 4,
+ mode: 'javascript'
+ });
+
+ cm.on('update', function(_cm, change) {
+ showColors(_cm);
+ });
+
+ var resDisplay = $('<div class="result-display" />')
+ .appendTo(cm.display.wrapper.parentNode);
+
+ showColors(cm);
+
+ function showColors(cm) {
+ $('.cm-string', cm.display.wrapper).each(styleSpan);
+ $('.cm-number', cm.display.wrapper).each(enableSlider);
+
+ // evaluate script
+ var src = cm.getDoc().getValue();
+ //resDisplay.html('');
+ try {
+
+ var s = src.split(';').map(eval);
+ resDisplay.html('<ol><li>'+s.map(resRec)
+ .filter(function(d) { return d !== undefined; })
+ .join('</li><li>')+'</li></ol>');
+
+ $('.cm-string', resDisplay).each(styleSpan);
+
+ } catch (e) {
+ // console.warn(e);
+ }
+
+ function resRec(d) {
+ if ($.isArray(d)) {
+ return '['+d.map(d.length > 2 ? resShort : resLong).join(',')+']';
+ }
+ return resLong(d);
+
+ function resLong(d) {
+ if (typeof d == 'boolean') {
+ return '<span class="cm-number">'+(d ? 'true' : 'false')+'</span>';
+
+ } else if (typeof d == 'string') {
+ // string color, e.g. hex value
+ return '<span class="cm-string">"'+d+'"</span>';
+ } else if (typeof d == 'object' && d._rgb) {
+ // chroma.js object
+ return '<span class="cm-string cm-color" data-color="'+d.css()+'">'+d.hex()+'</span>';
+ } else if ($.isNumeric(d)) {
+ return '<span class="cm-number">'+round(d,3)+'</span>';
+ } else if ($.isFunction(d)) {
+ var s = '';
+ var dom = d.domain ? d.domain() : [0,1],
+ dmin = Math.min(dom[0], dom[dom.length-1]),
+ dmax = Math.max(dom[dom.length-1], dom[0]);
+ for (var i=0;i<=100;i++) {
+ s += '<span class="grad-step" style="background-color:'+d(dmin + i/100 * (dmax - dmin))+'"></span>';
+ }
+ s += '<span class="domain-min">'+dmin+'</span>';
+ s += '<span class="domain-med">'+((dmin + dmax)*0.5)+'</span>';
+ s += '<span class="domain-max">'+dmax+'</span>';
+ return '<div class="gradient">'+s+'</div>';
+ }
+ }
+
+ function resShort(d) {
+ if (typeof d == 'string') {
+ // string color, e.g. hex value
+ return '<span class="cm-string cm-color cm-small" data-color="'+d+'"><span class="cm-hidden-text">\''+chroma(d).hex()+'\'</span></span>';
+ } else if (typeof d == 'object' && d._rgb) {
+ // chroma.js object
+ return '<span class="cm-string cm-color cm-small" data-color="'+d.css()+'"><span class="cm-hidden-text">\''+d.hex()+'\'</span></span>';
+ } else if ($.isNumeric(d)) {
+ return '<span class="cm-number">'+round(d,2)+'</span>';
+ } else if (isNaN(d)) {
+ return '<span class="cm-number cm-nan">NaN</span>';
+ }
+ }
+
+ function round(d, p) {
+ var n = Math.pow(10, p);
+ return Math.round(d*n) / n;
+ }
+ }
+ }
+
+ function styleSpan() {
+ var span = $(this);
+ //setTimeout(function() {
+ val = span.data('color') || span.html().replace(/['"]/g, '').trim();
+ if (chroma[val]) {
+ span.attr('style', '');
+ return;
+ }
+
+ try {
+ var col = chroma(val),
+ l = col.luminance();
+ span.attr('style', [
+ 'background-color:'+col.hex(),
+ 'color:'+(l <0.5 ? 'white' : 'black'),
+ 'opacity:'+col.alpha()
+ ].join(';'));
+ } catch (e) {
+ //console.log(e);
+ span.attr('style', '');
+ // not a color, so ignore
+ }
+ //}, 50);
+ }
+
+ function enableSlider() {
+ return;
+ var span = $(this),
+ slider = $('<div></div>').addClass('slider'),
+ input = $('<input type="range" />').appendTo(slider);
+
+ span.off('mouseenter').on('mouseenter', function() {
+ var v = +span.text(),
+ d = Math.pow(10, Math.max(1, Math.log10(v))),
+ min = v - d,
+ max = v + d;
+ input.attr({ min: min, max: max })
+ .prop('value', v);
+ console.log('span', v);
+
+ span.append(slider);
+ });
+ span.off('mouseleave').on('mouseleave', function() {
+ //slider.remove();
+ });
+ }
+
+ });
+
+ var toc = $('<ul />')
+ .addClass('toc')
+ .appendTo(
+ $('<div>')
+ .addClass('toc-container')
+ .appendTo('.wrap')
+ );
+
+ var hue = Math.random() * 360;
+ $('h2,h3').each(function() {
+ var h = $(this),
+ l = h.attr('id'),
+ t = h.is('h2');
+ toc.append('<li class="'+('level-'+(t ? '1' : '2'))+'"><a style="color:'+chroma.lch(50,80,hue)+'" href="#'+l+'">' + h.text() +'</a></li>');
+ hue = (hue + 20) % 360;
+ var a = $('<a />')
+ .attr('href', '#'+l)
+ .html(h.html());
+ h.html('').append(a);
+ });
+
+ $('h3+h4').each(function(i,el) { el.previousElementSibling.appendChild(el); });
+
+})(jQuery);
+</script>
+<a href="https://github.com/gka/chroma.js" class="github-corner"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#64CEAA; color:#fff; position: absolute; top: 0; border: 0; right: 0;"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>
+<style>
+ .github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}
+ @keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}
+</style>
+
+</div></body>
+</html>
src/node_modules/chroma-js/docs/libs/chroma.js
+/**
+ * @license
+ *
+ * chroma.js - JavaScript library for color conversions
+ *
+ * Copyright (c) 2011-2017, Gregor Aisch
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name Gregor Aisch may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+(function() {
+ var Color, DEG2RAD, LAB_CONSTANTS, PI, PITHIRD, RAD2DEG, TWOPI, _average_lrgb, _guess_formats, _guess_formats_sorted, _input, _interpolators, abs, atan2, bezier, blend, blend_f, brewer, burn, chroma, clip_rgb, cmyk2rgb, colors, cos, css2rgb, darken, dodge, each, floor, hcg2rgb, hex2rgb, hsi2rgb, hsl2css, hsl2rgb, hsv2rgb, interpolate, interpolate_hsx, interpolate_lab, interpolate_lrgb, interpolate_num, interpolate_rgb, lab2lch, lab2rgb, lab_xyz, lch2lab, lch2rgb, lighten, limit, log, luminance_x, m, max, multiply, normal, num2rgb, overlay, pow, rgb2cmyk, rgb2css, rgb2hcg, rgb2hex, rgb2hsi, rgb2hsl, rgb2hsv, rgb2lab, rgb2lch, rgb2luminance, rgb2num, rgb2temperature, rgb2xyz, rgb_xyz, rnd, root, round, screen, sin, sqrt, temperature2rgb, type, unpack, w3cx11, xyz_lab, xyz_rgb,
+ slice = [].slice;
+
+ type = (function() {
+
+ /*
+ for browser-safe type checking+
+ ported from jQuery's $.type
+ */
+ var classToType, len, name, o, ref;
+ classToType = {};
+ ref = "Boolean Number String Function Array Date RegExp Undefined Null".split(" ");
+ for (o = 0, len = ref.length; o < len; o++) {
+ name = ref[o];
+ classToType["[object " + name + "]"] = name.toLowerCase();
+ }
+ return function(obj) {
+ var strType;
+ strType = Object.prototype.toString.call(obj);
+ return classToType[strType] || "object";
+ };
+ })();
+
+ limit = function(x, min, max) {
+ if (min == null) {
+ min = 0;
+ }
+ if (max == null) {
+ max = 1;
+ }
+ if (x < min) {
+ x = min;
+ }
+ if (x > max) {
+ x = max;
+ }
+ return x;
+ };
+
+ unpack = function(args) {
+ if (args.length >= 3) {
+ return Array.prototype.slice.call(args);
+ } else {
+ return args[0];
+ }
+ };
+
+ clip_rgb = function(rgb) {
+ var i, o;
+ rgb._clipped = false;
+ rgb._unclipped = rgb.slice(0);
+ for (i = o = 0; o < 3; i = ++o) {
+ if (i < 3) {
+ if (rgb[i] < 0 || rgb[i] > 255) {
+ rgb._clipped = true;
+ }
+ if (rgb[i] < 0) {
+ rgb[i] = 0;
+ }
+ if (rgb[i] > 255) {
+ rgb[i] = 255;
+ }
+ } else if (i === 3) {
+ if (rgb[i] < 0) {
+ rgb[i] = 0;
+ }
+ if (rgb[i] > 1) {
+ rgb[i] = 1;
+ }
+ }
+ }
+ if (!rgb._clipped) {
+ delete rgb._unclipped;
+ }
+ return rgb;
+ };
+
+ PI = Math.PI, round = Math.round, cos = Math.cos, floor = Math.floor, pow = Math.pow, log = Math.log, sin = Math.sin, sqrt = Math.sqrt, atan2 = Math.atan2, max = Math.max, abs = Math.abs;
+
+ TWOPI = PI * 2;
+
+ PITHIRD = PI / 3;
+
+ DEG2RAD = PI / 180;
+
+ RAD2DEG = 180 / PI;
+
+ chroma = function() {
+ if (arguments[0] instanceof Color) {
+ return arguments[0];
+ }
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, arguments, function(){});
+ };
+
+ chroma["default"] = chroma;
+
+ _interpolators = [];
+
+ if ((typeof module !== "undefined" && module !== null) && (module.exports != null)) {
+ module.exports = chroma;
+ }
+
+ if (typeof define === 'function' && define.amd) {
+ define([], function() {
+ return chroma;
+ });
+ } else {
+ root = typeof exports !== "undefined" && exports !== null ? exports : this;
+ root.chroma = chroma;
+ }
+
+ chroma.version = '1.4.0';
+
+ _input = {};
+
+ _guess_formats = [];
+
+ _guess_formats_sorted = false;
+
+ Color = (function() {
+ function Color() {
+ var arg, args, chk, len, len1, me, mode, o, w;
+ me = this;
+ args = [];
+ for (o = 0, len = arguments.length; o < len; o++) {
+ arg = arguments[o];
+ if (arg != null) {
+ args.push(arg);
+ }
+ }
+ if (args.length > 1) {
+ mode = args[args.length - 1];
+ }
+ if (_input[mode] != null) {
+ me._rgb = clip_rgb(_input[mode](unpack(args.slice(0, -1))));
+ } else {
+ if (!_guess_formats_sorted) {
+ _guess_formats = _guess_formats.sort(function(a, b) {
+ return b.p - a.p;
+ });
+ _guess_formats_sorted = true;
+ }
+ for (w = 0, len1 = _guess_formats.length; w < len1; w++) {
+ chk = _guess_formats[w];
+ mode = chk.test.apply(chk, args);
+ if (mode) {
+ break;
+ }
+ }
+ if (mode) {
+ me._rgb = clip_rgb(_input[mode].apply(_input, args));
+ }
+ }
+ if (me._rgb == null) {
+ console.warn('unknown format: ' + args);
+ }
+ if (me._rgb == null) {
+ me._rgb = [0, 0, 0];
+ }
+ if (me._rgb.length === 3) {
+ me._rgb.push(1);
+ }
+ }
+
+ Color.prototype.toString = function() {
+ return this.hex();
+ };
+
+ return Color;
+
+ })();
+
+ chroma._input = _input;
+
+
+ /**
+ ColorBrewer colors for chroma.js
+
+ Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The
+ Pennsylvania State University.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software distributed
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations under the License.
+
+ @preserve
+ */
+
+ chroma.brewer = brewer = {
+ OrRd: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000'],
+ PuBu: ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#045a8d', '#023858'],
+ BuPu: ['#f7fcfd', '#e0ecf4', '#bfd3e6', '#9ebcda', '#8c96c6', '#8c6bb1', '#88419d', '#810f7c', '#4d004b'],
+ Oranges: ['#fff5eb', '#fee6ce', '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801', '#a63603', '#7f2704'],
+ BuGn: ['#f7fcfd', '#e5f5f9', '#ccece6', '#99d8c9', '#66c2a4', '#41ae76', '#238b45', '#006d2c', '#00441b'],
+ YlOrBr: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506'],
+ YlGn: ['#ffffe5', '#f7fcb9', '#d9f0a3', '#addd8e', '#78c679', '#41ab5d', '#238443', '#006837', '#004529'],
+ Reds: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d'],
+ RdPu: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a'],
+ Greens: ['#f7fcf5', '#e5f5e0', '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#006d2c', '#00441b'],
+ YlGnBu: ['#ffffd9', '#edf8b1', '#c7e9b4', '#7fcdbb', '#41b6c4', '#1d91c0', '#225ea8', '#253494', '#081d58'],
+ Purples: ['#fcfbfd', '#efedf5', '#dadaeb', '#bcbddc', '#9e9ac8', '#807dba', '#6a51a3', '#54278f', '#3f007d'],
+ GnBu: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081'],
+ Greys: ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525', '#000000'],
+ YlOrRd: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026'],
+ PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f'],
+ Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'],
+ PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],
+ Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825'],
+ Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],
+ RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837'],
+ RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],
+ PiYG: ['#8e0152', '#c51b7d', '#de77ae', '#f1b6da', '#fde0ef', '#f7f7f7', '#e6f5d0', '#b8e186', '#7fbc41', '#4d9221', '#276419'],
+ PRGn: ['#40004b', '#762a83', '#9970ab', '#c2a5cf', '#e7d4e8', '#f7f7f7', '#d9f0d3', '#a6dba0', '#5aae61', '#1b7837', '#00441b'],
+ RdYlBu: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee090', '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', '#4575b4', '#313695'],
+ BrBG: ['#543005', '#8c510a', '#bf812d', '#dfc27d', '#f6e8c3', '#f5f5f5', '#c7eae5', '#80cdc1', '#35978f', '#01665e', '#003c30'],
+ RdGy: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#ffffff', '#e0e0e0', '#bababa', '#878787', '#4d4d4d', '#1a1a1a'],
+ PuOr: ['#7f3b08', '#b35806', '#e08214', '#fdb863', '#fee0b6', '#f7f7f7', '#d8daeb', '#b2abd2', '#8073ac', '#542788', '#2d004b'],
+ Set2: ['#66c2a5', '#fc8d62', '#8da0cb', '#e78ac3', '#a6d854', '#ffd92f', '#e5c494', '#b3b3b3'],
+ Accent: ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f', '#bf5b17', '#666666'],
+ Set1: ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33', '#a65628', '#f781bf', '#999999'],
+ Set3: ['#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f'],
+ Dark2: ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02', '#a6761d', '#666666'],
+ Paired: ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928'],
+ Pastel2: ['#b3e2cd', '#fdcdac', '#cbd5e8', '#f4cae4', '#e6f5c9', '#fff2ae', '#f1e2cc', '#cccccc'],
+ Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2']
+ };
+
+ (function() {
+ var key, results;
+ results = [];
+ for (key in brewer) {
+ results.push(brewer[key.toLowerCase()] = brewer[key]);
+ }
+ return results;
+ })();
+
+
+ /**
+ X11 color names
+
+ http://www.w3.org/TR/css3-color/#svg-color
+ */
+
+ w3cx11 = {
+ aliceblue: '#f0f8ff',
+ antiquewhite: '#faebd7',
+ aqua: '#00ffff',
+ aquamarine: '#7fffd4',
+ azure: '#f0ffff',
+ beige: '#f5f5dc',
+ bisque: '#ffe4c4',
+ black: '#000000',
+ blanchedalmond: '#ffebcd',
+ blue: '#0000ff',
+ blueviolet: '#8a2be2',
+ brown: '#a52a2a',
+ burlywood: '#deb887',
+ cadetblue: '#5f9ea0',
+ chartreuse: '#7fff00',
+ chocolate: '#d2691e',
+ coral: '#ff7f50',
+ cornflower: '#6495ed',
+ cornflowerblue: '#6495ed',
+ cornsilk: '#fff8dc',
+ crimson: '#dc143c',
+ cyan: '#00ffff',
+ darkblue: '#00008b',
+ darkcyan: '#008b8b',
+ darkgoldenrod: '#b8860b',
+ darkgray: '#a9a9a9',
+ darkgreen: '#006400',
+ darkgrey: '#a9a9a9',
+ darkkhaki: '#bdb76b',
+ darkmagenta: '#8b008b',
+ darkolivegreen: '#556b2f',
+ darkorange: '#ff8c00',
+ darkorchid: '#9932cc',
+ darkred: '#8b0000',
+ darksalmon: '#e9967a',
+ darkseagreen: '#8fbc8f',
+ darkslateblue: '#483d8b',
+ darkslategray: '#2f4f4f',
+ darkslategrey: '#2f4f4f',
+ darkturquoise: '#00ced1',
+ darkviolet: '#9400d3',
+ deeppink: '#ff1493',
+ deepskyblue: '#00bfff',
+ dimgray: '#696969',
+ dimgrey: '#696969',
+ dodgerblue: '#1e90ff',
+ firebrick: '#b22222',
+ floralwhite: '#fffaf0',
+ forestgreen: '#228b22',
+ fuchsia: '#ff00ff',
+ gainsboro: '#dcdcdc',
+ ghostwhite: '#f8f8ff',
+ gold: '#ffd700',
+ goldenrod: '#daa520',
+ gray: '#808080',
+ green: '#008000',
+ greenyellow: '#adff2f',
+ grey: '#808080',
+ honeydew: '#f0fff0',
+ hotpink: '#ff69b4',
+ indianred: '#cd5c5c',
+ indigo: '#4b0082',
+ ivory: '#fffff0',
+ khaki: '#f0e68c',
+ laserlemon: '#ffff54',
+ lavender: '#e6e6fa',
+ lavenderblush: '#fff0f5',
+ lawngreen: '#7cfc00',
+ lemonchiffon: '#fffacd',
+ lightblue: '#add8e6',
+ lightcoral: '#f08080',
+ lightcyan: '#e0ffff',
+ lightgoldenrod: '#fafad2',
+ lightgoldenrodyellow: '#fafad2',
+ lightgray: '#d3d3d3',
+ lightgreen: '#90ee90',
+ lightgrey: '#d3d3d3',
+ lightpink: '#ffb6c1',
+ lightsalmon: '#ffa07a',
+ lightseagreen: '#20b2aa',
+ lightskyblue: '#87cefa',
+ lightslategray: '#778899',
+ lightslategrey: '#778899',
+ lightsteelblue: '#b0c4de',
+ lightyellow: '#ffffe0',
+ lime: '#00ff00',
+ limegreen: '#32cd32',
+ linen: '#faf0e6',
+ magenta: '#ff00ff',
+ maroon: '#800000',
+ maroon2: '#7f0000',
+ maroon3: '#b03060',
+ mediumaquamarine: '#66cdaa',
+ mediumblue: '#0000cd',
+ mediumorchid: '#ba55d3',
+ mediumpurple: '#9370db',
+ mediumseagreen: '#3cb371',
+ mediumslateblue: '#7b68ee',
+ mediumspringgreen: '#00fa9a',
+ mediumturquoise: '#48d1cc',
+ mediumvioletred: '#c71585',
+ midnightblue: '#191970',
+ mintcream: '#f5fffa',
+ mistyrose: '#ffe4e1',
+ moccasin: '#ffe4b5',
+ navajowhite: '#ffdead',
+ navy: '#000080',
+ oldlace: '#fdf5e6',
+ olive: '#808000',
+ olivedrab: '#6b8e23',
+ orange: '#ffa500',
+ orangered: '#ff4500',
+ orchid: '#da70d6',
+ palegoldenrod: '#eee8aa',
+ palegreen: '#98fb98',
+ paleturquoise: '#afeeee',
+ palevioletred: '#db7093',
+ papayawhip: '#ffefd5',
+ peachpuff: '#ffdab9',
+ peru: '#cd853f',
+ pink: '#ffc0cb',
+ plum: '#dda0dd',
+ powderblue: '#b0e0e6',
+ purple: '#800080',
+ purple2: '#7f007f',
+ purple3: '#a020f0',
+ rebeccapurple: '#663399',
+ red: '#ff0000',
+ rosybrown: '#bc8f8f',
+ royalblue: '#4169e1',
+ saddlebrown: '#8b4513',
+ salmon: '#fa8072',
+ sandybrown: '#f4a460',
+ seagreen: '#2e8b57',
+ seashell: '#fff5ee',
+ sienna: '#a0522d',
+ silver: '#c0c0c0',
+ skyblue: '#87ceeb',
+ slateblue: '#6a5acd',
+ slategray: '#708090',
+ slategrey: '#708090',
+ snow: '#fffafa',
+ springgreen: '#00ff7f',
+ steelblue: '#4682b4',
+ tan: '#d2b48c',
+ teal: '#008080',
+ thistle: '#d8bfd8',
+ tomato: '#ff6347',
+ turquoise: '#40e0d0',
+ violet: '#ee82ee',
+ wheat: '#f5deb3',
+ white: '#ffffff',
+ whitesmoke: '#f5f5f5',
+ yellow: '#ffff00',
+ yellowgreen: '#9acd32'
+ };
+
+ chroma.colors = colors = w3cx11;
+
+ lab2rgb = function() {
+ var a, args, b, g, l, r, x, y, z;
+ args = unpack(arguments);
+ l = args[0], a = args[1], b = args[2];
+ y = (l + 16) / 116;
+ x = isNaN(a) ? y : y + a / 500;
+ z = isNaN(b) ? y : y - b / 200;
+ y = LAB_CONSTANTS.Yn * lab_xyz(y);
+ x = LAB_CONSTANTS.Xn * lab_xyz(x);
+ z = LAB_CONSTANTS.Zn * lab_xyz(z);
+ r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z);
+ g = xyz_rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z);
+ b = xyz_rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z);
+ return [r, g, b, args.length > 3 ? args[3] : 1];
+ };
+
+ xyz_rgb = function(r) {
+ return 255 * (r <= 0.00304 ? 12.92 * r : 1.055 * pow(r, 1 / 2.4) - 0.055);
+ };
+
+ lab_xyz = function(t) {
+ if (t > LAB_CONSTANTS.t1) {
+ return t * t * t;
+ } else {
+ return LAB_CONSTANTS.t2 * (t - LAB_CONSTANTS.t0);
+ }
+ };
+
+ LAB_CONSTANTS = {
+ Kn: 18,
+ Xn: 0.950470,
+ Yn: 1,
+ Zn: 1.088830,
+ t0: 0.137931034,
+ t1: 0.206896552,
+ t2: 0.12841855,
+ t3: 0.008856452
+ };
+
+ rgb2lab = function() {
+ var b, g, r, ref, ref1, x, y, z;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ ref1 = rgb2xyz(r, g, b), x = ref1[0], y = ref1[1], z = ref1[2];
+ return [116 * y - 16, 500 * (x - y), 200 * (y - z)];
+ };
+
+ rgb_xyz = function(r) {
+ if ((r /= 255) <= 0.04045) {
+ return r / 12.92;
+ } else {
+ return pow((r + 0.055) / 1.055, 2.4);
+ }
+ };
+
+ xyz_lab = function(t) {
+ if (t > LAB_CONSTANTS.t3) {
+ return pow(t, 1 / 3);
+ } else {
+ return t / LAB_CONSTANTS.t2 + LAB_CONSTANTS.t0;
+ }
+ };
+
+ rgb2xyz = function() {
+ var b, g, r, ref, x, y, z;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ r = rgb_xyz(r);
+ g = rgb_xyz(g);
+ b = rgb_xyz(b);
+ x = xyz_lab((0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / LAB_CONSTANTS.Xn);
+ y = xyz_lab((0.2126729 * r + 0.7151522 * g + 0.0721750 * b) / LAB_CONSTANTS.Yn);
+ z = xyz_lab((0.0193339 * r + 0.1191920 * g + 0.9503041 * b) / LAB_CONSTANTS.Zn);
+ return [x, y, z];
+ };
+
+ chroma.lab = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['lab']), function(){});
+ };
+
+ _input.lab = lab2rgb;
+
+ Color.prototype.lab = function() {
+ return rgb2lab(this._rgb);
+ };
+
+ bezier = function(colors) {
+ var I, I0, I1, c, lab0, lab1, lab2, lab3, ref, ref1, ref2;
+ colors = (function() {
+ var len, o, results;
+ results = [];
+ for (o = 0, len = colors.length; o < len; o++) {
+ c = colors[o];
+ results.push(chroma(c));
+ }
+ return results;
+ })();
+ if (colors.length === 2) {
+ ref = (function() {
+ var len, o, results;
+ results = [];
+ for (o = 0, len = colors.length; o < len; o++) {
+ c = colors[o];
+ results.push(c.lab());
+ }
+ return results;
+ })(), lab0 = ref[0], lab1 = ref[1];
+ I = function(t) {
+ var i, lab;
+ lab = (function() {
+ var o, results;
+ results = [];
+ for (i = o = 0; o <= 2; i = ++o) {
+ results.push(lab0[i] + t * (lab1[i] - lab0[i]));
+ }
+ return results;
+ })();
+ return chroma.lab.apply(chroma, lab);
+ };
+ } else if (colors.length === 3) {
+ ref1 = (function() {
+ var len, o, results;
+ results = [];
+ for (o = 0, len = colors.length; o < len; o++) {
+ c = colors[o];
+ results.push(c.lab());
+ }
+ return results;
+ })(), lab0 = ref1[0], lab1 = ref1[1], lab2 = ref1[2];
+ I = function(t) {
+ var i, lab;
+ lab = (function() {
+ var o, results;
+ results = [];
+ for (i = o = 0; o <= 2; i = ++o) {
+ results.push((1 - t) * (1 - t) * lab0[i] + 2 * (1 - t) * t * lab1[i] + t * t * lab2[i]);
+ }
+ return results;
+ })();
+ return chroma.lab.apply(chroma, lab);
+ };
+ } else if (colors.length === 4) {
+ ref2 = (function() {
+ var len, o, results;
+ results = [];
+ for (o = 0, len = colors.length; o < len; o++) {
+ c = colors[o];
+ results.push(c.lab());
+ }
+ return results;
+ })(), lab0 = ref2[0], lab1 = ref2[1], lab2 = ref2[2], lab3 = ref2[3];
+ I = function(t) {
+ var i, lab;
+ lab = (function() {
+ var o, results;
+ results = [];
+ for (i = o = 0; o <= 2; i = ++o) {
+ results.push((1 - t) * (1 - t) * (1 - t) * lab0[i] + 3 * (1 - t) * (1 - t) * t * lab1[i] + 3 * (1 - t) * t * t * lab2[i] + t * t * t * lab3[i]);
+ }
+ return results;
+ })();
+ return chroma.lab.apply(chroma, lab);
+ };
+ } else if (colors.length === 5) {
+ I0 = bezier(colors.slice(0, 3));
+ I1 = bezier(colors.slice(2, 5));
+ I = function(t) {
+ if (t < 0.5) {
+ return I0(t * 2);
+ } else {
+ return I1((t - 0.5) * 2);
+ }
+ };
+ }
+ return I;
+ };
+
+ chroma.bezier = function(colors) {
+ var f;
+ f = bezier(colors);
+ f.scale = function() {
+ return chroma.scale(f);
+ };
+ return f;
+ };
+
+ chroma.cubehelix = function(start, rotations, hue, gamma, lightness) {
+ var dh, dl, f;
+ if (start == null) {
+ start = 300;
+ }
+ if (rotations == null) {
+ rotations = -1.5;
+ }
+ if (hue == null) {
+ hue = 1;
+ }
+ if (gamma == null) {
+ gamma = 1;
+ }
+ if (lightness == null) {
+ lightness = [0, 1];
+ }
+ dh = 0;
+ if (type(lightness) === 'array') {
+ dl = lightness[1] - lightness[0];
+ } else {
+ dl = 0;
+ lightness = [lightness, lightness];
+ }
+ f = function(fract) {
+ var a, amp, b, cos_a, g, h, l, r, sin_a;
+ a = TWOPI * ((start + 120) / 360 + rotations * fract);
+ l = pow(lightness[0] + dl * fract, gamma);
+ h = dh !== 0 ? hue[0] + fract * dh : hue;
+ amp = h * l * (1 - l) / 2;
+ cos_a = cos(a);
+ sin_a = sin(a);
+ r = l + amp * (-0.14861 * cos_a + 1.78277 * sin_a);
+ g = l + amp * (-0.29227 * cos_a - 0.90649 * sin_a);
+ b = l + amp * (+1.97294 * cos_a);
+ return chroma(clip_rgb([r * 255, g * 255, b * 255, 1]));
+ };
+ f.start = function(s) {
+ if (s == null) {
+ return start;
+ }
+ start = s;
+ return f;
+ };
+ f.rotations = function(r) {
+ if (r == null) {
+ return rotations;
+ }
+ rotations = r;
+ return f;
+ };
+ f.gamma = function(g) {
+ if (g == null) {
+ return gamma;
+ }
+ gamma = g;
+ return f;
+ };
+ f.hue = function(h) {
+ if (h == null) {
+ return hue;
+ }
+ hue = h;
+ if (type(hue) === 'array') {
+ dh = hue[1] - hue[0];
+ if (dh === 0) {
+ hue = hue[1];
+ }
+ } else {
+ dh = 0;
+ }
+ return f;
+ };
+ f.lightness = function(h) {
+ if (h == null) {
+ return lightness;
+ }
+ if (type(h) === 'array') {
+ lightness = h;
+ dl = h[1] - h[0];
+ } else {
+ lightness = [h, h];
+ dl = 0;
+ }
+ return f;
+ };
+ f.scale = function() {
+ return chroma.scale(f);
+ };
+ f.hue(hue);
+ return f;
+ };
+
+ chroma.random = function() {
+ var code, digits, i, o;
+ digits = '0123456789abcdef';
+ code = '#';
+ for (i = o = 0; o < 6; i = ++o) {
+ code += digits.charAt(floor(Math.random() * 16));
+ }
+ return new Color(code);
+ };
+
+ _interpolators = [];
+
+ interpolate = function(col1, col2, f, m) {
+ var interpol, len, o, res;
+ if (f == null) {
+ f = 0.5;
+ }
+ if (m == null) {
+ m = 'rgb';
+ }
+
+ /*
+ interpolates between colors
+ f = 0 --> me
+ f = 1 --> col
+ */
+ if (type(col1) !== 'object') {
+ col1 = chroma(col1);
+ }
+ if (type(col2) !== 'object') {
+ col2 = chroma(col2);
+ }
+ for (o = 0, len = _interpolators.length; o < len; o++) {
+ interpol = _interpolators[o];
+ if (m === interpol[0]) {
+ res = interpol[1](col1, col2, f, m);
+ break;
+ }
+ }
+ if (res == null) {
+ throw "color mode " + m + " is not supported";
+ }
+ return res.alpha(col1.alpha() + f * (col2.alpha() - col1.alpha()));
+ };
+
+ chroma.interpolate = interpolate;
+
+ Color.prototype.interpolate = function(col2, f, m) {
+ return interpolate(this, col2, f, m);
+ };
+
+ chroma.mix = interpolate;
+
+ Color.prototype.mix = Color.prototype.interpolate;
+
+ _input.rgb = function() {
+ var k, ref, results, v;
+ ref = unpack(arguments);
+ results = [];
+ for (k in ref) {
+ v = ref[k];
+ results.push(v);
+ }
+ return results;
+ };
+
+ chroma.rgb = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['rgb']), function(){});
+ };
+
+ Color.prototype.rgb = function(round) {
+ if (round == null) {
+ round = true;
+ }
+ if (round) {
+ return this._rgb.map(Math.round).slice(0, 3);
+ } else {
+ return this._rgb.slice(0, 3);
+ }
+ };
+
+ Color.prototype.rgba = function(round) {
+ if (round == null) {
+ round = true;
+ }
+ if (!round) {
+ return this._rgb.slice(0);
+ }
+ return [Math.round(this._rgb[0]), Math.round(this._rgb[1]), Math.round(this._rgb[2]), this._rgb[3]];
+ };
+
+ _guess_formats.push({
+ p: 3,
+ test: function(n) {
+ var a;
+ a = unpack(arguments);
+ if (type(a) === 'array' && a.length === 3) {
+ return 'rgb';
+ }
+ if (a.length === 4 && type(a[3]) === "number" && a[3] >= 0 && a[3] <= 1) {
+ return 'rgb';
+ }
+ }
+ });
+
+ _input.lrgb = _input.rgb;
+
+ interpolate_lrgb = function(col1, col2, f, m) {
+ var xyz0, xyz1;
+ xyz0 = col1._rgb;
+ xyz1 = col2._rgb;
+ return new Color(sqrt(pow(xyz0[0], 2) * (1 - f) + pow(xyz1[0], 2) * f), sqrt(pow(xyz0[1], 2) * (1 - f) + pow(xyz1[1], 2) * f), sqrt(pow(xyz0[2], 2) * (1 - f) + pow(xyz1[2], 2) * f), m);
+ };
+
+ _average_lrgb = function(colors) {
+ var col, f, len, o, rgb, xyz;
+ f = 1 / colors.length;
+ xyz = [0, 0, 0, 0];
+ for (o = 0, len = colors.length; o < len; o++) {
+ col = colors[o];
+ rgb = col._rgb;
+ xyz[0] += pow(rgb[0], 2) * f;
+ xyz[1] += pow(rgb[1], 2) * f;
+ xyz[2] += pow(rgb[2], 2) * f;
+ xyz[3] += rgb[3] * f;
+ }
+ xyz[0] = sqrt(xyz[0]);
+ xyz[1] = sqrt(xyz[1]);
+ xyz[2] = sqrt(xyz[2]);
+ if (xyz[3] > 1) {
+ xyz[3] = 1;
+ }
+ return new Color(clip_rgb(xyz));
+ };
+
+ _interpolators.push(['lrgb', interpolate_lrgb]);
+
+ chroma.average = function(colors, mode) {
+ var A, alpha, c, cnt, dx, dy, first, i, l, len, o, xyz, xyz2;
+ if (mode == null) {
+ mode = 'rgb';
+ }
+ l = colors.length;
+ colors = colors.map(function(c) {
+ return chroma(c);
+ });
+ first = colors.splice(0, 1)[0];
+ if (mode === 'lrgb') {
+ return _average_lrgb(colors);
+ }
+ xyz = first.get(mode);
+ cnt = [];
+ dx = 0;
+ dy = 0;
+ for (i in xyz) {
+ xyz[i] = xyz[i] || 0;
+ cnt.push(isNaN(xyz[i]) ? 0 : 1);
+ if (mode.charAt(i) === 'h' && !isNaN(xyz[i])) {
+ A = xyz[i] / 180 * PI;
+ dx += cos(A);
+ dy += sin(A);
+ }
+ }
+ alpha = first.alpha();
+ for (o = 0, len = colors.length; o < len; o++) {
+ c = colors[o];
+ xyz2 = c.get(mode);
+ alpha += c.alpha();
+ for (i in xyz) {
+ if (!isNaN(xyz2[i])) {
+ cnt[i] += 1;
+ if (mode.charAt(i) === 'h') {
+ A = xyz2[i] / 180 * PI;
+ dx += cos(A);
+ dy += sin(A);
+ } else {
+ xyz[i] += xyz2[i];
+ }
+ }
+ }
+ }
+ for (i in xyz) {
+ if (mode.charAt(i) === 'h') {
+ A = atan2(dy / cnt[i], dx / cnt[i]) / PI * 180;
+ while (A < 0) {
+ A += 360;
+ }
+ while (A >= 360) {
+ A -= 360;
+ }
+ xyz[i] = A;
+ } else {
+ xyz[i] = xyz[i] / cnt[i];
+ }
+ }
+ return chroma(xyz, mode).alpha(alpha / l);
+ };
+
+ hex2rgb = function(hex) {
+ var a, b, g, r, rgb, u;
+ if (hex.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)) {
+ if (hex.length === 4 || hex.length === 7) {
+ hex = hex.substr(1);
+ }
+ if (hex.length === 3) {
+ hex = hex.split("");
+ hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
+ }
+ u = parseInt(hex, 16);
+ r = u >> 16;
+ g = u >> 8 & 0xFF;
+ b = u & 0xFF;
+ return [r, g, b, 1];
+ }
+ if (hex.match(/^#?([A-Fa-f0-9]{8})$/)) {
+ if (hex.length === 9) {
+ hex = hex.substr(1);
+ }
+ u = parseInt(hex, 16);
+ r = u >> 24 & 0xFF;
+ g = u >> 16 & 0xFF;
+ b = u >> 8 & 0xFF;
+ a = round((u & 0xFF) / 0xFF * 100) / 100;
+ return [r, g, b, a];
+ }
+ if ((_input.css != null) && (rgb = _input.css(hex))) {
+ return rgb;
+ }
+ throw "unknown color: " + hex;
+ };
+
+ rgb2hex = function(channels, mode) {
+ var a, b, g, hxa, r, str, u;
+ if (mode == null) {
+ mode = 'auto';
+ }
+ r = channels[0], g = channels[1], b = channels[2], a = channels[3];
+ if (mode === 'auto') {
+ mode = a < 1 ? 'rgba' : 'rgb';
+ }
+ r = Math.round(r);
+ g = Math.round(g);
+ b = Math.round(b);
+ u = r << 16 | g << 8 | b;
+ str = "000000" + u.toString(16);
+ str = str.substr(str.length - 6);
+ hxa = '0' + round(a * 255).toString(16);
+ hxa = hxa.substr(hxa.length - 2);
+ return "#" + (function() {
+ switch (mode.toLowerCase()) {
+ case 'rgba':
+ return str + hxa;
+ case 'argb':
+ return hxa + str;
+ default:
+ return str;
+ }
+ })();
+ };
+
+ _input.hex = function(h) {
+ return hex2rgb(h);
+ };
+
+ chroma.hex = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['hex']), function(){});
+ };
+
+ Color.prototype.hex = function(mode) {
+ if (mode == null) {
+ mode = 'auto';
+ }
+ return rgb2hex(this._rgb, mode);
+ };
+
+ _guess_formats.push({
+ p: 4,
+ test: function(n) {
+ if (arguments.length === 1 && type(n) === "string") {
+ return 'hex';
+ }
+ }
+ });
+
+ hsl2rgb = function() {
+ var args, b, c, g, h, i, l, o, r, ref, s, t1, t2, t3;
+ args = unpack(arguments);
+ h = args[0], s = args[1], l = args[2];
+ if (s === 0) {
+ r = g = b = l * 255;
+ } else {
+ t3 = [0, 0, 0];
+ c = [0, 0, 0];
+ t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
+ t1 = 2 * l - t2;
+ h /= 360;
+ t3[0] = h + 1 / 3;
+ t3[1] = h;
+ t3[2] = h - 1 / 3;
+ for (i = o = 0; o <= 2; i = ++o) {
+ if (t3[i] < 0) {
+ t3[i] += 1;
+ }
+ if (t3[i] > 1) {
+ t3[i] -= 1;
+ }
+ if (6 * t3[i] < 1) {
+ c[i] = t1 + (t2 - t1) * 6 * t3[i];
+ } else if (2 * t3[i] < 1) {
+ c[i] = t2;
+ } else if (3 * t3[i] < 2) {
+ c[i] = t1 + (t2 - t1) * ((2 / 3) - t3[i]) * 6;
+ } else {
+ c[i] = t1;
+ }
+ }
+ ref = [round(c[0] * 255), round(c[1] * 255), round(c[2] * 255)], r = ref[0], g = ref[1], b = ref[2];
+ }
+ if (args.length > 3) {
+ return [r, g, b, args[3]];
+ } else {
+ return [r, g, b];
+ }
+ };
+
+ rgb2hsl = function(r, g, b) {
+ var h, l, min, ref, s;
+ if (r !== void 0 && r.length >= 3) {
+ ref = r, r = ref[0], g = ref[1], b = ref[2];
+ }
+ r /= 255;
+ g /= 255;
+ b /= 255;
+ min = Math.min(r, g, b);
+ max = Math.max(r, g, b);
+ l = (max + min) / 2;
+ if (max === min) {
+ s = 0;
+ h = Number.NaN;
+ } else {
+ s = l < 0.5 ? (max - min) / (max + min) : (max - min) / (2 - max - min);
+ }
+ if (r === max) {
+ h = (g - b) / (max - min);
+ } else if (g === max) {
+ h = 2 + (b - r) / (max - min);
+ } else if (b === max) {
+ h = 4 + (r - g) / (max - min);
+ }
+ h *= 60;
+ if (h < 0) {
+ h += 360;
+ }
+ return [h, s, l];
+ };
+
+ chroma.hsl = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['hsl']), function(){});
+ };
+
+ _input.hsl = hsl2rgb;
+
+ Color.prototype.hsl = function() {
+ return rgb2hsl(this._rgb);
+ };
+
+ hsv2rgb = function() {
+ var args, b, f, g, h, i, p, q, r, ref, ref1, ref2, ref3, ref4, ref5, s, t, v;
+ args = unpack(arguments);
+ h = args[0], s = args[1], v = args[2];
+ v *= 255;
+ if (s === 0) {
+ r = g = b = v;
+ } else {
+ if (h === 360) {
+ h = 0;
+ }
+ if (h > 360) {
+ h -= 360;
+ }
+ if (h < 0) {
+ h += 360;
+ }
+ h /= 60;
+ i = floor(h);
+ f = h - i;
+ p = v * (1 - s);
+ q = v * (1 - s * f);
+ t = v * (1 - s * (1 - f));
+ switch (i) {
+ case 0:
+ ref = [v, t, p], r = ref[0], g = ref[1], b = ref[2];
+ break;
+ case 1:
+ ref1 = [q, v, p], r = ref1[0], g = ref1[1], b = ref1[2];
+ break;
+ case 2:
+ ref2 = [p, v, t], r = ref2[0], g = ref2[1], b = ref2[2];
+ break;
+ case 3:
+ ref3 = [p, q, v], r = ref3[0], g = ref3[1], b = ref3[2];
+ break;
+ case 4:
+ ref4 = [t, p, v], r = ref4[0], g = ref4[1], b = ref4[2];
+ break;
+ case 5:
+ ref5 = [v, p, q], r = ref5[0], g = ref5[1], b = ref5[2];
+ }
+ }
+ return [r, g, b, args.length > 3 ? args[3] : 1];
+ };
+
+ rgb2hsv = function() {
+ var b, delta, g, h, min, r, ref, s, v;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ min = Math.min(r, g, b);
+ max = Math.max(r, g, b);
+ delta = max - min;
+ v = max / 255.0;
+ if (max === 0) {
+ h = Number.NaN;
+ s = 0;
+ } else {
+ s = delta / max;
+ if (r === max) {
+ h = (g - b) / delta;
+ }
+ if (g === max) {
+ h = 2 + (b - r) / delta;
+ }
+ if (b === max) {
+ h = 4 + (r - g) / delta;
+ }
+ h *= 60;
+ if (h < 0) {
+ h += 360;
+ }
+ }
+ return [h, s, v];
+ };
+
+ chroma.hsv = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['hsv']), function(){});
+ };
+
+ _input.hsv = hsv2rgb;
+
+ Color.prototype.hsv = function() {
+ return rgb2hsv(this._rgb);
+ };
+
+ num2rgb = function(num) {
+ var b, g, r;
+ if (type(num) === "number" && num >= 0 && num <= 0xFFFFFF) {
+ r = num >> 16;
+ g = (num >> 8) & 0xFF;
+ b = num & 0xFF;
+ return [r, g, b, 1];
+ }
+ console.warn("unknown num color: " + num);
+ return [0, 0, 0, 1];
+ };
+
+ rgb2num = function() {
+ var b, g, r, ref;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ return (r << 16) + (g << 8) + b;
+ };
+
+ chroma.num = function(num) {
+ return new Color(num, 'num');
+ };
+
+ Color.prototype.num = function(mode) {
+ if (mode == null) {
+ mode = 'rgb';
+ }
+ return rgb2num(this._rgb, mode);
+ };
+
+ _input.num = num2rgb;
+
+ _guess_formats.push({
+ p: 1,
+ test: function(n) {
+ if (arguments.length === 1 && type(n) === "number" && n >= 0 && n <= 0xFFFFFF) {
+ return 'num';
+ }
+ }
+ });
+
+ hcg2rgb = function() {
+ var _c, _g, args, b, c, f, g, h, i, p, q, r, ref, ref1, ref2, ref3, ref4, ref5, t, v;
+ args = unpack(arguments);
+ h = args[0], c = args[1], _g = args[2];
+ c = c / 100;
+ g = g / 100 * 255;
+ _c = c * 255;
+ if (c === 0) {
+ r = g = b = _g;
+ } else {
+ if (h === 360) {
+ h = 0;
+ }
+ if (h > 360) {
+ h -= 360;
+ }
+ if (h < 0) {
+ h += 360;
+ }
+ h /= 60;
+ i = floor(h);
+ f = h - i;
+ p = _g * (1 - c);
+ q = p + _c * (1 - f);
+ t = p + _c * f;
+ v = p + _c;
+ switch (i) {
+ case 0:
+ ref = [v, t, p], r = ref[0], g = ref[1], b = ref[2];
+ break;
+ case 1:
+ ref1 = [q, v, p], r = ref1[0], g = ref1[1], b = ref1[2];
+ break;
+ case 2:
+ ref2 = [p, v, t], r = ref2[0], g = ref2[1], b = ref2[2];
+ break;
+ case 3:
+ ref3 = [p, q, v], r = ref3[0], g = ref3[1], b = ref3[2];
+ break;
+ case 4:
+ ref4 = [t, p, v], r = ref4[0], g = ref4[1], b = ref4[2];
+ break;
+ case 5:
+ ref5 = [v, p, q], r = ref5[0], g = ref5[1], b = ref5[2];
+ }
+ }
+ return [r, g, b, args.length > 3 ? args[3] : 1];
+ };
+
+ rgb2hcg = function() {
+ var _g, b, c, delta, g, h, min, r, ref;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ min = Math.min(r, g, b);
+ max = Math.max(r, g, b);
+ delta = max - min;
+ c = delta * 100 / 255;
+ _g = min / (255 - delta) * 100;
+ if (delta === 0) {
+ h = Number.NaN;
+ } else {
+ if (r === max) {
+ h = (g - b) / delta;
+ }
+ if (g === max) {
+ h = 2 + (b - r) / delta;
+ }
+ if (b === max) {
+ h = 4 + (r - g) / delta;
+ }
+ h *= 60;
+ if (h < 0) {
+ h += 360;
+ }
+ }
+ return [h, c, _g];
+ };
+
+ chroma.hcg = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['hcg']), function(){});
+ };
+
+ _input.hcg = hcg2rgb;
+
+ Color.prototype.hcg = function() {
+ return rgb2hcg(this._rgb);
+ };
+
+ css2rgb = function(css) {
+ var aa, ab, hsl, i, m, o, rgb, w;
+ css = css.toLowerCase();
+ if ((chroma.colors != null) && chroma.colors[css]) {
+ return hex2rgb(chroma.colors[css]);
+ }
+ if (m = css.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)) {
+ rgb = m.slice(1, 4);
+ for (i = o = 0; o <= 2; i = ++o) {
+ rgb[i] = +rgb[i];
+ }
+ rgb[3] = 1;
+ } else if (m = css.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/)) {
+ rgb = m.slice(1, 5);
+ for (i = w = 0; w <= 3; i = ++w) {
+ rgb[i] = +rgb[i];
+ }
+ } else if (m = css.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)) {
+ rgb = m.slice(1, 4);
+ for (i = aa = 0; aa <= 2; i = ++aa) {
+ rgb[i] = round(rgb[i] * 2.55);
+ }
+ rgb[3] = 1;
+ } else if (m = css.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)) {
+ rgb = m.slice(1, 5);
+ for (i = ab = 0; ab <= 2; i = ++ab) {
+ rgb[i] = round(rgb[i] * 2.55);
+ }
+ rgb[3] = +rgb[3];
+ } else if (m = css.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)) {
+ hsl = m.slice(1, 4);
+ hsl[1] *= 0.01;
+ hsl[2] *= 0.01;
+ rgb = hsl2rgb(hsl);
+ rgb[3] = 1;
+ } else if (m = css.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)) {
+ hsl = m.slice(1, 4);
+ hsl[1] *= 0.01;
+ hsl[2] *= 0.01;
+ rgb = hsl2rgb(hsl);
+ rgb[3] = +m[4];
+ }
+ return rgb;
+ };
+
+ rgb2css = function(rgba) {
+ var mode;
+ mode = rgba[3] < 1 ? 'rgba' : 'rgb';
+ if (mode === 'rgb') {
+ return mode + '(' + rgba.slice(0, 3).map(round).join(',') + ')';
+ } else if (mode === 'rgba') {
+ return mode + '(' + rgba.slice(0, 3).map(round).join(',') + ',' + rgba[3] + ')';
+ } else {
+
+ }
+ };
+
+ rnd = function(a) {
+ return round(a * 100) / 100;
+ };
+
+ hsl2css = function(hsl, alpha) {
+ var mode;
+ mode = alpha < 1 ? 'hsla' : 'hsl';
+ hsl[0] = rnd(hsl[0] || 0);
+ hsl[1] = rnd(hsl[1] * 100) + '%';
+ hsl[2] = rnd(hsl[2] * 100) + '%';
+ if (mode === 'hsla') {
+ hsl[3] = alpha;
+ }
+ return mode + '(' + hsl.join(',') + ')';
+ };
+
+ _input.css = function(h) {
+ return css2rgb(h);
+ };
+
+ chroma.css = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['css']), function(){});
+ };
+
+ Color.prototype.css = function(mode) {
+ if (mode == null) {
+ mode = 'rgb';
+ }
+ if (mode.slice(0, 3) === 'rgb') {
+ return rgb2css(this._rgb);
+ } else if (mode.slice(0, 3) === 'hsl') {
+ return hsl2css(this.hsl(), this.alpha());
+ }
+ };
+
+ _input.named = function(name) {
+ return hex2rgb(w3cx11[name]);
+ };
+
+ _guess_formats.push({
+ p: 5,
+ test: function(n) {
+ if (arguments.length === 1 && (w3cx11[n] != null)) {
+ return 'named';
+ }
+ }
+ });
+
+ Color.prototype.name = function(n) {
+ var h, k;
+ if (arguments.length) {
+ if (w3cx11[n]) {
+ this._rgb = hex2rgb(w3cx11[n]);
+ }
+ this._rgb[3] = 1;
+ this;
+ }
+ h = this.hex('rgb');
+ for (k in w3cx11) {
+ if (h === w3cx11[k]) {
+ return k;
+ }
+ }
+ return h;
+ };
+
+ lch2lab = function() {
+
+ /*
+ Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.
+ These formulas were invented by David Dalrymple to obtain maximum contrast without going
+ out of gamut if the parameters are in the range 0-1.
+
+ A saturation multiplier was added by Gregor Aisch
+ */
+ var c, h, l, ref;
+ ref = unpack(arguments), l = ref[0], c = ref[1], h = ref[2];
+ h = h * DEG2RAD;
+ return [l, cos(h) * c, sin(h) * c];
+ };
+
+ lch2rgb = function() {
+ var L, a, args, b, c, g, h, l, r, ref, ref1;
+ args = unpack(arguments);
+ l = args[0], c = args[1], h = args[2];
+ ref = lch2lab(l, c, h), L = ref[0], a = ref[1], b = ref[2];
+ ref1 = lab2rgb(L, a, b), r = ref1[0], g = ref1[1], b = ref1[2];
+ return [r, g, b, args.length > 3 ? args[3] : 1];
+ };
+
+ lab2lch = function() {
+ var a, b, c, h, l, ref;
+ ref = unpack(arguments), l = ref[0], a = ref[1], b = ref[2];
+ c = sqrt(a * a + b * b);
+ h = (atan2(b, a) * RAD2DEG + 360) % 360;
+ if (round(c * 10000) === 0) {
+ h = Number.NaN;
+ }
+ return [l, c, h];
+ };
+
+ rgb2lch = function() {
+ var a, b, g, l, r, ref, ref1;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ ref1 = rgb2lab(r, g, b), l = ref1[0], a = ref1[1], b = ref1[2];
+ return lab2lch(l, a, b);
+ };
+
+ chroma.lch = function() {
+ var args;
+ args = unpack(arguments);
+ return new Color(args, 'lch');
+ };
+
+ chroma.hcl = function() {
+ var args;
+ args = unpack(arguments);
+ return new Color(args, 'hcl');
+ };
+
+ _input.lch = lch2rgb;
+
+ _input.hcl = function() {
+ var c, h, l, ref;
+ ref = unpack(arguments), h = ref[0], c = ref[1], l = ref[2];
+ return lch2rgb([l, c, h]);
+ };
+
+ Color.prototype.lch = function() {
+ return rgb2lch(this._rgb);
+ };
+
+ Color.prototype.hcl = function() {
+ return rgb2lch(this._rgb).reverse();
+ };
+
+ rgb2cmyk = function(mode) {
+ var b, c, f, g, k, m, r, ref, y;
+ if (mode == null) {
+ mode = 'rgb';
+ }
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ r = r / 255;
+ g = g / 255;
+ b = b / 255;
+ k = 1 - Math.max(r, Math.max(g, b));
+ f = k < 1 ? 1 / (1 - k) : 0;
+ c = (1 - r - k) * f;
+ m = (1 - g - k) * f;
+ y = (1 - b - k) * f;
+ return [c, m, y, k];
+ };
+
+ cmyk2rgb = function() {
+ var alpha, args, b, c, g, k, m, r, y;
+ args = unpack(arguments);
+ c = args[0], m = args[1], y = args[2], k = args[3];
+ alpha = args.length > 4 ? args[4] : 1;
+ if (k === 1) {
+ return [0, 0, 0, alpha];
+ }
+ r = c >= 1 ? 0 : 255 * (1 - c) * (1 - k);
+ g = m >= 1 ? 0 : 255 * (1 - m) * (1 - k);
+ b = y >= 1 ? 0 : 255 * (1 - y) * (1 - k);
+ return [r, g, b, alpha];
+ };
+
+ _input.cmyk = function() {
+ return cmyk2rgb(unpack(arguments));
+ };
+
+ chroma.cmyk = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['cmyk']), function(){});
+ };
+
+ Color.prototype.cmyk = function() {
+ return rgb2cmyk(this._rgb);
+ };
+
+ _input.gl = function() {
+ var i, k, o, rgb, v;
+ rgb = (function() {
+ var ref, results;
+ ref = unpack(arguments);
+ results = [];
+ for (k in ref) {
+ v = ref[k];
+ results.push(v);
+ }
+ return results;
+ }).apply(this, arguments);
+ for (i = o = 0; o <= 2; i = ++o) {
+ rgb[i] *= 255;
+ }
+ return rgb;
+ };
+
+ chroma.gl = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['gl']), function(){});
+ };
+
+ Color.prototype.gl = function() {
+ var rgb;
+ rgb = this._rgb;
+ return [rgb[0] / 255, rgb[1] / 255, rgb[2] / 255, rgb[3]];
+ };
+
+ rgb2luminance = function(r, g, b) {
+ var ref;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ r = luminance_x(r);
+ g = luminance_x(g);
+ b = luminance_x(b);
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
+ };
+
+ luminance_x = function(x) {
+ x /= 255;
+ if (x <= 0.03928) {
+ return x / 12.92;
+ } else {
+ return pow((x + 0.055) / 1.055, 2.4);
+ }
+ };
+
+ interpolate_rgb = function(col1, col2, f, m) {
+ var xyz0, xyz1;
+ xyz0 = col1._rgb;
+ xyz1 = col2._rgb;
+ return new Color(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), m);
+ };
+
+ _interpolators.push(['rgb', interpolate_rgb]);
+
+ Color.prototype.luminance = function(lum, mode) {
+ var cur_lum, eps, max_iter, rgba, test;
+ if (mode == null) {
+ mode = 'rgb';
+ }
+ if (!arguments.length) {
+ return rgb2luminance(this._rgb);
+ }
+ rgba = this._rgb;
+ if (lum === 0) {
+ rgba = [0, 0, 0, this._rgb[3]];
+ } else if (lum === 1) {
+ rgba = [255, 255, 255, this[3]];
+ } else {
+ cur_lum = rgb2luminance(this._rgb);
+ eps = 1e-7;
+ max_iter = 20;
+ test = function(l, h) {
+ var lm, m;
+ m = l.interpolate(h, 0.5, mode);
+ lm = m.luminance();
+ if (Math.abs(lum - lm) < eps || !max_iter--) {
+ return m;
+ }
+ if (lm > lum) {
+ return test(l, m);
+ }
+ return test(m, h);
+ };
+ if (cur_lum > lum) {
+ rgba = test(chroma('black'), this).rgba();
+ } else {
+ rgba = test(this, chroma('white')).rgba();
+ }
+ }
+ return chroma(rgba).alpha(this.alpha());
+ };
+
+ temperature2rgb = function(kelvin) {
+ var b, g, r, temp;
+ temp = kelvin / 100;
+ if (temp < 66) {
+ r = 255;
+ g = -155.25485562709179 - 0.44596950469579133 * (g = temp - 2) + 104.49216199393888 * log(g);
+ b = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b = temp - 10) + 115.67994401066147 * log(b);
+ } else {
+ r = 351.97690566805693 + 0.114206453784165 * (r = temp - 55) - 40.25366309332127 * log(r);
+ g = 325.4494125711974 + 0.07943456536662342 * (g = temp - 50) - 28.0852963507957 * log(g);
+ b = 255;
+ }
+ return [r, g, b];
+ };
+
+ rgb2temperature = function() {
+ var b, eps, g, maxTemp, minTemp, r, ref, rgb, temp;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ minTemp = 1000;
+ maxTemp = 40000;
+ eps = 0.4;
+ while (maxTemp - minTemp > eps) {
+ temp = (maxTemp + minTemp) * 0.5;
+ rgb = temperature2rgb(temp);
+ if ((rgb[2] / rgb[0]) >= (b / r)) {
+ maxTemp = temp;
+ } else {
+ minTemp = temp;
+ }
+ }
+ return round(temp);
+ };
+
+ chroma.temperature = chroma.kelvin = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['temperature']), function(){});
+ };
+
+ _input.temperature = _input.kelvin = _input.K = temperature2rgb;
+
+ Color.prototype.temperature = function() {
+ return rgb2temperature(this._rgb);
+ };
+
+ Color.prototype.kelvin = Color.prototype.temperature;
+
+ chroma.contrast = function(a, b) {
+ var l1, l2, ref, ref1;
+ if ((ref = type(a)) === 'string' || ref === 'number') {
+ a = new Color(a);
+ }
+ if ((ref1 = type(b)) === 'string' || ref1 === 'number') {
+ b = new Color(b);
+ }
+ l1 = a.luminance();
+ l2 = b.luminance();
+ if (l1 > l2) {
+ return (l1 + 0.05) / (l2 + 0.05);
+ } else {
+ return (l2 + 0.05) / (l1 + 0.05);
+ }
+ };
+
+ chroma.distance = function(a, b, mode) {
+ var d, i, l1, l2, ref, ref1, sum_sq;
+ if (mode == null) {
+ mode = 'lab';
+ }
+ if ((ref = type(a)) === 'string' || ref === 'number') {
+ a = new Color(a);
+ }
+ if ((ref1 = type(b)) === 'string' || ref1 === 'number') {
+ b = new Color(b);
+ }
+ l1 = a.get(mode);
+ l2 = b.get(mode);
+ sum_sq = 0;
+ for (i in l1) {
+ d = (l1[i] || 0) - (l2[i] || 0);
+ sum_sq += d * d;
+ }
+ return Math.sqrt(sum_sq);
+ };
+
+ chroma.deltaE = function(a, b, L, C) {
+ var L1, L2, a1, a2, b1, b2, c1, c2, c4, dH2, delA, delB, delC, delL, f, h1, ref, ref1, ref2, ref3, sc, sh, sl, t, v1, v2, v3;
+ if (L == null) {
+ L = 1;
+ }
+ if (C == null) {
+ C = 1;
+ }
+ if ((ref = type(a)) === 'string' || ref === 'number') {
+ a = new Color(a);
+ }
+ if ((ref1 = type(b)) === 'string' || ref1 === 'number') {
+ b = new Color(b);
+ }
+ ref2 = a.lab(), L1 = ref2[0], a1 = ref2[1], b1 = ref2[2];
+ ref3 = b.lab(), L2 = ref3[0], a2 = ref3[1], b2 = ref3[2];
+ c1 = sqrt(a1 * a1 + b1 * b1);
+ c2 = sqrt(a2 * a2 + b2 * b2);
+ sl = L1 < 16.0 ? 0.511 : (0.040975 * L1) / (1.0 + 0.01765 * L1);
+ sc = (0.0638 * c1) / (1.0 + 0.0131 * c1) + 0.638;
+ h1 = c1 < 0.000001 ? 0.0 : (atan2(b1, a1) * 180.0) / PI;
+ while (h1 < 0) {
+ h1 += 360;
+ }
+ while (h1 >= 360) {
+ h1 -= 360;
+ }
+ t = (h1 >= 164.0) && (h1 <= 345.0) ? 0.56 + abs(0.2 * cos((PI * (h1 + 168.0)) / 180.0)) : 0.36 + abs(0.4 * cos((PI * (h1 + 35.0)) / 180.0));
+ c4 = c1 * c1 * c1 * c1;
+ f = sqrt(c4 / (c4 + 1900.0));
+ sh = sc * (f * t + 1.0 - f);
+ delL = L1 - L2;
+ delC = c1 - c2;
+ delA = a1 - a2;
+ delB = b1 - b2;
+ dH2 = delA * delA + delB * delB - delC * delC;
+ v1 = delL / (L * sl);
+ v2 = delC / (C * sc);
+ v3 = sh;
+ return sqrt(v1 * v1 + v2 * v2 + (dH2 / (v3 * v3)));
+ };
+
+ Color.prototype.get = function(modechan) {
+ var channel, i, me, mode, ref, src;
+ me = this;
+ ref = modechan.split('.'), mode = ref[0], channel = ref[1];
+ src = me[mode]();
+ if (channel) {
+ i = mode.indexOf(channel);
+ if (i > -1) {
+ return src[i];
+ } else {
+ return console.warn('unknown channel ' + channel + ' in mode ' + mode);
+ }
+ } else {
+ return src;
+ }
+ };
+
+ Color.prototype.set = function(modechan, value) {
+ var channel, i, me, mode, ref, src;
+ me = this;
+ ref = modechan.split('.'), mode = ref[0], channel = ref[1];
+ if (channel) {
+ src = me[mode]();
+ i = mode.indexOf(channel);
+ if (i > -1) {
+ if (type(value) === 'string') {
+ switch (value.charAt(0)) {
+ case '+':
+ src[i] += +value;
+ break;
+ case '-':
+ src[i] += +value;
+ break;
+ case '*':
+ src[i] *= +(value.substr(1));
+ break;
+ case '/':
+ src[i] /= +(value.substr(1));
+ break;
+ default:
+ src[i] = +value;
+ }
+ } else {
+ src[i] = value;
+ }
+ } else {
+ console.warn('unknown channel ' + channel + ' in mode ' + mode);
+ }
+ } else {
+ src = value;
+ }
+ return chroma(src, mode).alpha(me.alpha());
+ };
+
+ Color.prototype.clipped = function() {
+ return this._rgb._clipped || false;
+ };
+
+ Color.prototype.alpha = function(a) {
+ if (arguments.length) {
+ return chroma.rgb([this._rgb[0], this._rgb[1], this._rgb[2], a]);
+ }
+ return this._rgb[3];
+ };
+
+ Color.prototype.darken = function(amount) {
+ var lab, me;
+ if (amount == null) {
+ amount = 1;
+ }
+ me = this;
+ lab = me.lab();
+ lab[0] -= LAB_CONSTANTS.Kn * amount;
+ return chroma.lab(lab).alpha(me.alpha());
+ };
+
+ Color.prototype.brighten = function(amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return this.darken(-amount);
+ };
+
+ Color.prototype.darker = Color.prototype.darken;
+
+ Color.prototype.brighter = Color.prototype.brighten;
+
+ Color.prototype.saturate = function(amount) {
+ var lch, me;
+ if (amount == null) {
+ amount = 1;
+ }
+ me = this;
+ lch = me.lch();
+ lch[1] += amount * LAB_CONSTANTS.Kn;
+ if (lch[1] < 0) {
+ lch[1] = 0;
+ }
+ return chroma.lch(lch).alpha(me.alpha());
+ };
+
+ Color.prototype.desaturate = function(amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return this.saturate(-amount);
+ };
+
+ Color.prototype.premultiply = function() {
+ var a, rgb;
+ rgb = this.rgb();
+ a = this.alpha();
+ return chroma(rgb[0] * a, rgb[1] * a, rgb[2] * a, a);
+ };
+
+ blend = function(bottom, top, mode) {
+ if (!blend[mode]) {
+ throw 'unknown blend mode ' + mode;
+ }
+ return blend[mode](bottom, top);
+ };
+
+ blend_f = function(f) {
+ return function(bottom, top) {
+ var c0, c1;
+ c0 = chroma(top).rgb();
+ c1 = chroma(bottom).rgb();
+ return chroma(f(c0, c1), 'rgb');
+ };
+ };
+
+ each = function(f) {
+ return function(c0, c1) {
+ var i, o, out;
+ out = [];
+ for (i = o = 0; o <= 3; i = ++o) {
+ out[i] = f(c0[i], c1[i]);
+ }
+ return out;
+ };
+ };
+
+ normal = function(a, b) {
+ return a;
+ };
+
+ multiply = function(a, b) {
+ return a * b / 255;
+ };
+
+ darken = function(a, b) {
+ if (a > b) {
+ return b;
+ } else {
+ return a;
+ }
+ };
+
+ lighten = function(a, b) {
+ if (a > b) {
+ return a;
+ } else {
+ return b;
+ }
+ };
+
+ screen = function(a, b) {
+ return 255 * (1 - (1 - a / 255) * (1 - b / 255));
+ };
+
+ overlay = function(a, b) {
+ if (b < 128) {
+ return 2 * a * b / 255;
+ } else {
+ return 255 * (1 - 2 * (1 - a / 255) * (1 - b / 255));
+ }
+ };
+
+ burn = function(a, b) {
+ return 255 * (1 - (1 - b / 255) / (a / 255));
+ };
+
+ dodge = function(a, b) {
+ if (a === 255) {
+ return 255;
+ }
+ a = 255 * (b / 255) / (1 - a / 255);
+ if (a > 255) {
+ return 255;
+ } else {
+ return a;
+ }
+ };
+
+ blend.normal = blend_f(each(normal));
+
+ blend.multiply = blend_f(each(multiply));
+
+ blend.screen = blend_f(each(screen));
+
+ blend.overlay = blend_f(each(overlay));
+
+ blend.darken = blend_f(each(darken));
+
+ blend.lighten = blend_f(each(lighten));
+
+ blend.dodge = blend_f(each(dodge));
+
+ blend.burn = blend_f(each(burn));
+
+ chroma.blend = blend;
+
+ chroma.analyze = function(data) {
+ var len, o, r, val;
+ r = {
+ min: Number.MAX_VALUE,
+ max: Number.MAX_VALUE * -1,
+ sum: 0,
+ values: [],
+ count: 0
+ };
+ for (o = 0, len = data.length; o < len; o++) {
+ val = data[o];
+ if ((val != null) && !isNaN(val)) {
+ r.values.push(val);
+ r.sum += val;
+ if (val < r.min) {
+ r.min = val;
+ }
+ if (val > r.max) {
+ r.max = val;
+ }
+ r.count += 1;
+ }
+ }
+ r.domain = [r.min, r.max];
+ r.limits = function(mode, num) {
+ return chroma.limits(r, mode, num);
+ };
+ return r;
+ };
+
+ chroma.scale = function(colors, positions) {
+ var _classes, _colorCache, _colors, _correctLightness, _domain, _fixed, _gamma, _max, _min, _mode, _nacol, _out, _padding, _pos, _spread, _useCache, classifyValue, f, getClass, getColor, resetCache, setColors, tmap;
+ _mode = 'rgb';
+ _nacol = chroma('#ccc');
+ _spread = 0;
+ _fixed = false;
+ _domain = [0, 1];
+ _pos = [];
+ _padding = [0, 0];
+ _classes = false;
+ _colors = [];
+ _out = false;
+ _min = 0;
+ _max = 1;
+ _correctLightness = false;
+ _colorCache = {};
+ _useCache = true;
+ _gamma = 1;
+ setColors = function(colors) {
+ var c, col, o, ref, ref1, w;
+ if (colors == null) {
+ colors = ['#fff', '#000'];
+ }
+ if ((colors != null) && type(colors) === 'string' && (chroma.brewer != null)) {
+ colors = chroma.brewer[colors] || chroma.brewer[colors.toLowerCase()] || colors;
+ }
+ if (type(colors) === 'array') {
+ if (colors.length === 1) {
+ colors = [colors[0], colors[0]];
+ }
+ colors = colors.slice(0);
+ for (c = o = 0, ref = colors.length - 1; 0 <= ref ? o <= ref : o >= ref; c = 0 <= ref ? ++o : --o) {
+ col = colors[c];
+ if (type(col) === "string") {
+ colors[c] = chroma(col);
+ }
+ }
+ _pos.length = 0;
+ for (c = w = 0, ref1 = colors.length - 1; 0 <= ref1 ? w <= ref1 : w >= ref1; c = 0 <= ref1 ? ++w : --w) {
+ _pos.push(c / (colors.length - 1));
+ }
+ }
+ resetCache();
+ return _colors = colors;
+ };
+ getClass = function(value) {
+ var i, n;
+ if (_classes != null) {
+ n = _classes.length - 1;
+ i = 0;
+ while (i < n && value >= _classes[i]) {
+ i++;
+ }
+ return i - 1;
+ }
+ return 0;
+ };
+ tmap = function(t) {
+ return t;
+ };
+ classifyValue = function(value) {
+ var i, maxc, minc, n, val;
+ val = value;
+ if (_classes.length > 2) {
+ n = _classes.length - 1;
+ i = getClass(value);
+ minc = _classes[0] + (_classes[1] - _classes[0]) * (0 + _spread * 0.5);
+ maxc = _classes[n - 1] + (_classes[n] - _classes[n - 1]) * (1 - _spread * 0.5);
+ val = _min + ((_classes[i] + (_classes[i + 1] - _classes[i]) * 0.5 - minc) / (maxc - minc)) * (_max - _min);
+ }
+ return val;
+ };
+ getColor = function(val, bypassMap) {
+ var c, col, i, k, o, p, ref, t;
+ if (bypassMap == null) {
+ bypassMap = false;
+ }
+ if (isNaN(val)) {
+ return _nacol;
+ }
+ if (!bypassMap) {
+ if (_classes && _classes.length > 2) {
+ c = getClass(val);
+ t = c / (_classes.length - 2);
+ } else if (_max !== _min) {
+ t = (val - _min) / (_max - _min);
+ } else {
+ t = 1;
+ }
+ } else {
+ t = val;
+ }
+ if (!bypassMap) {
+ t = tmap(t);
+ }
+ if (_gamma !== 1) {
+ t = pow(t, _gamma);
+ }
+ t = _padding[0] + (t * (1 - _padding[0] - _padding[1]));
+ t = Math.min(1, Math.max(0, t));
+ k = Math.floor(t * 10000);
+ if (_useCache && _colorCache[k]) {
+ col = _colorCache[k];
+ } else {
+ if (type(_colors) === 'array') {
+ for (i = o = 0, ref = _pos.length - 1; 0 <= ref ? o <= ref : o >= ref; i = 0 <= ref ? ++o : --o) {
+ p = _pos[i];
+ if (t <= p) {
+ col = _colors[i];
+ break;
+ }
+ if (t >= p && i === _pos.length - 1) {
+ col = _colors[i];
+ break;
+ }
+ if (t > p && t < _pos[i + 1]) {
+ t = (t - p) / (_pos[i + 1] - p);
+ col = chroma.interpolate(_colors[i], _colors[i + 1], t, _mode);
+ break;
+ }
+ }
+ } else if (type(_colors) === 'function') {
+ col = _colors(t);
+ }
+ if (_useCache) {
+ _colorCache[k] = col;
+ }
+ }
+ return col;
+ };
+ resetCache = function() {
+ return _colorCache = {};
+ };
+ setColors(colors);
+ f = function(v) {
+ var c;
+ c = chroma(getColor(v));
+ if (_out && c[_out]) {
+ return c[_out]();
+ } else {
+ return c;
+ }
+ };
+ f.classes = function(classes) {
+ var d;
+ if (classes != null) {
+ if (type(classes) === 'array') {
+ _classes = classes;
+ _domain = [classes[0], classes[classes.length - 1]];
+ } else {
+ d = chroma.analyze(_domain);
+ if (classes === 0) {
+ _classes = [d.min, d.max];
+ } else {
+ _classes = chroma.limits(d, 'e', classes);
+ }
+ }
+ return f;
+ }
+ return _classes;
+ };
+ f.domain = function(domain) {
+ var c, d, k, len, o, ref, w;
+ if (!arguments.length) {
+ return _domain;
+ }
+ _min = domain[0];
+ _max = domain[domain.length - 1];
+ _pos = [];
+ k = _colors.length;
+ if (domain.length === k && _min !== _max) {
+ for (o = 0, len = domain.length; o < len; o++) {
+ d = domain[o];
+ _pos.push((d - _min) / (_max - _min));
+ }
+ } else {
+ for (c = w = 0, ref = k - 1; 0 <= ref ? w <= ref : w >= ref; c = 0 <= ref ? ++w : --w) {
+ _pos.push(c / (k - 1));
+ }
+ }
+ _domain = [_min, _max];
+ return f;
+ };
+ f.mode = function(_m) {
+ if (!arguments.length) {
+ return _mode;
+ }
+ _mode = _m;
+ resetCache();
+ return f;
+ };
+ f.range = function(colors, _pos) {
+ setColors(colors, _pos);
+ return f;
+ };
+ f.out = function(_o) {
+ _out = _o;
+ return f;
+ };
+ f.spread = function(val) {
+ if (!arguments.length) {
+ return _spread;
+ }
+ _spread = val;
+ return f;
+ };
+ f.correctLightness = function(v) {
+ if (v == null) {
+ v = true;
+ }
+ _correctLightness = v;
+ resetCache();
+ if (_correctLightness) {
+ tmap = function(t) {
+ var L0, L1, L_actual, L_diff, L_ideal, max_iter, pol, t0, t1;
+ L0 = getColor(0, true).lab()[0];
+ L1 = getColor(1, true).lab()[0];
+ pol = L0 > L1;
+ L_actual = getColor(t, true).lab()[0];
+ L_ideal = L0 + (L1 - L0) * t;
+ L_diff = L_actual - L_ideal;
+ t0 = 0;
+ t1 = 1;
+ max_iter = 20;
+ while (Math.abs(L_diff) > 1e-2 && max_iter-- > 0) {
+ (function() {
+ if (pol) {
+ L_diff *= -1;
+ }
+ if (L_diff < 0) {
+ t0 = t;
+ t += (t1 - t) * 0.5;
+ } else {
+ t1 = t;
+ t += (t0 - t) * 0.5;
+ }
+ L_actual = getColor(t, true).lab()[0];
+ return L_diff = L_actual - L_ideal;
+ })();
+ }
+ return t;
+ };
+ } else {
+ tmap = function(t) {
+ return t;
+ };
+ }
+ return f;
+ };
+ f.padding = function(p) {
+ if (p != null) {
+ if (type(p) === 'number') {
+ p = [p, p];
+ }
+ _padding = p;
+ return f;
+ } else {
+ return _padding;
+ }
+ };
+ f.colors = function(numColors, out) {
+ var dd, dm, i, o, ref, result, results, samples, w;
+ if (arguments.length < 2) {
+ out = 'hex';
+ }
+ result = [];
+ if (arguments.length === 0) {
+ result = _colors.slice(0);
+ } else if (numColors === 1) {
+ result = [f(0.5)];
+ } else if (numColors > 1) {
+ dm = _domain[0];
+ dd = _domain[1] - dm;
+ result = (function() {
+ results = [];
+ for (var o = 0; 0 <= numColors ? o < numColors : o > numColors; 0 <= numColors ? o++ : o--){ results.push(o); }
+ return results;
+ }).apply(this).map(function(i) {
+ return f(dm + i / (numColors - 1) * dd);
+ });
+ } else {
+ colors = [];
+ samples = [];
+ if (_classes && _classes.length > 2) {
+ for (i = w = 1, ref = _classes.length; 1 <= ref ? w < ref : w > ref; i = 1 <= ref ? ++w : --w) {
+ samples.push((_classes[i - 1] + _classes[i]) * 0.5);
+ }
+ } else {
+ samples = _domain;
+ }
+ result = samples.map(function(v) {
+ return f(v);
+ });
+ }
+ if (chroma[out]) {
+ result = result.map(function(c) {
+ return c[out]();
+ });
+ }
+ return result;
+ };
+ f.cache = function(c) {
+ if (c != null) {
+ _useCache = c;
+ return f;
+ } else {
+ return _useCache;
+ }
+ };
+ f.gamma = function(g) {
+ if (g != null) {
+ _gamma = g;
+ return f;
+ } else {
+ return _gamma;
+ }
+ };
+ return f;
+ };
+
+ if (chroma.scales == null) {
+ chroma.scales = {};
+ }
+
+ chroma.scales.cool = function() {
+ return chroma.scale([chroma.hsl(180, 1, .9), chroma.hsl(250, .7, .4)]);
+ };
+
+ chroma.scales.hot = function() {
+ return chroma.scale(['#000', '#f00', '#ff0', '#fff'], [0, .25, .75, 1]).mode('rgb');
+ };
+
+ chroma.analyze = function(data, key, filter) {
+ var add, k, len, o, r, val, visit;
+ r = {
+ min: Number.MAX_VALUE,
+ max: Number.MAX_VALUE * -1,
+ sum: 0,
+ values: [],
+ count: 0
+ };
+ if (filter == null) {
+ filter = function() {
+ return true;
+ };
+ }
+ add = function(val) {
+ if ((val != null) && !isNaN(val)) {
+ r.values.push(val);
+ r.sum += val;
+ if (val < r.min) {
+ r.min = val;
+ }
+ if (val > r.max) {
+ r.max = val;
+ }
+ r.count += 1;
+ }
+ };
+ visit = function(val, k) {
+ if (filter(val, k)) {
+ if ((key != null) && type(key) === 'function') {
+ return add(key(val));
+ } else if ((key != null) && type(key) === 'string' || type(key) === 'number') {
+ return add(val[key]);
+ } else {
+ return add(val);
+ }
+ }
+ };
+ if (type(data) === 'array') {
+ for (o = 0, len = data.length; o < len; o++) {
+ val = data[o];
+ visit(val);
+ }
+ } else {
+ for (k in data) {
+ val = data[k];
+ visit(val, k);
+ }
+ }
+ r.domain = [r.min, r.max];
+ r.limits = function(mode, num) {
+ return chroma.limits(r, mode, num);
+ };
+ return r;
+ };
+
+ chroma.limits = function(data, mode, num) {
+ var aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, assignments, best, centroids, cluster, clusterSizes, dist, i, j, kClusters, limits, max_log, min, min_log, mindist, n, nb_iters, newCentroids, o, p, pb, pr, ref, ref1, ref10, ref11, ref12, ref13, ref14, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, repeat, sum, tmpKMeansBreaks, v, value, values, w;
+ if (mode == null) {
+ mode = 'equal';
+ }
+ if (num == null) {
+ num = 7;
+ }
+ if (type(data) === 'array') {
+ data = chroma.analyze(data);
+ }
+ min = data.min;
+ max = data.max;
+ sum = data.sum;
+ values = data.values.sort(function(a, b) {
+ return a - b;
+ });
+ if (num === 1) {
+ return [min, max];
+ }
+ limits = [];
+ if (mode.substr(0, 1) === 'c') {
+ limits.push(min);
+ limits.push(max);
+ }
+ if (mode.substr(0, 1) === 'e') {
+ limits.push(min);
+ for (i = o = 1, ref = num - 1; 1 <= ref ? o <= ref : o >= ref; i = 1 <= ref ? ++o : --o) {
+ limits.push(min + (i / num) * (max - min));
+ }
+ limits.push(max);
+ } else if (mode.substr(0, 1) === 'l') {
+ if (min <= 0) {
+ throw 'Logarithmic scales are only possible for values > 0';
+ }
+ min_log = Math.LOG10E * log(min);
+ max_log = Math.LOG10E * log(max);
+ limits.push(min);
+ for (i = w = 1, ref1 = num - 1; 1 <= ref1 ? w <= ref1 : w >= ref1; i = 1 <= ref1 ? ++w : --w) {
+ limits.push(pow(10, min_log + (i / num) * (max_log - min_log)));
+ }
+ limits.push(max);
+ } else if (mode.substr(0, 1) === 'q') {
+ limits.push(min);
+ for (i = aa = 1, ref2 = num - 1; 1 <= ref2 ? aa <= ref2 : aa >= ref2; i = 1 <= ref2 ? ++aa : --aa) {
+ p = (values.length - 1) * i / num;
+ pb = floor(p);
+ if (pb === p) {
+ limits.push(values[pb]);
+ } else {
+ pr = p - pb;
+ limits.push(values[pb] * (1 - pr) + values[pb + 1] * pr);
+ }
+ }
+ limits.push(max);
+ } else if (mode.substr(0, 1) === 'k') {
+
+ /*
+ implementation based on
+ http://code.google.com/p/figue/source/browse/trunk/figue.js#336
+ simplified for 1-d input values
+ */
+ n = values.length;
+ assignments = new Array(n);
+ clusterSizes = new Array(num);
+ repeat = true;
+ nb_iters = 0;
+ centroids = null;
+ centroids = [];
+ centroids.push(min);
+ for (i = ab = 1, ref3 = num - 1; 1 <= ref3 ? ab <= ref3 : ab >= ref3; i = 1 <= ref3 ? ++ab : --ab) {
+ centroids.push(min + (i / num) * (max - min));
+ }
+ centroids.push(max);
+ while (repeat) {
+ for (j = ac = 0, ref4 = num - 1; 0 <= ref4 ? ac <= ref4 : ac >= ref4; j = 0 <= ref4 ? ++ac : --ac) {
+ clusterSizes[j] = 0;
+ }
+ for (i = ad = 0, ref5 = n - 1; 0 <= ref5 ? ad <= ref5 : ad >= ref5; i = 0 <= ref5 ? ++ad : --ad) {
+ value = values[i];
+ mindist = Number.MAX_VALUE;
+ for (j = ae = 0, ref6 = num - 1; 0 <= ref6 ? ae <= ref6 : ae >= ref6; j = 0 <= ref6 ? ++ae : --ae) {
+ dist = abs(centroids[j] - value);
+ if (dist < mindist) {
+ mindist = dist;
+ best = j;
+ }
+ }
+ clusterSizes[best]++;
+ assignments[i] = best;
+ }
+ newCentroids = new Array(num);
+ for (j = af = 0, ref7 = num - 1; 0 <= ref7 ? af <= ref7 : af >= ref7; j = 0 <= ref7 ? ++af : --af) {
+ newCentroids[j] = null;
+ }
+ for (i = ag = 0, ref8 = n - 1; 0 <= ref8 ? ag <= ref8 : ag >= ref8; i = 0 <= ref8 ? ++ag : --ag) {
+ cluster = assignments[i];
+ if (newCentroids[cluster] === null) {
+ newCentroids[cluster] = values[i];
+ } else {
+ newCentroids[cluster] += values[i];
+ }
+ }
+ for (j = ah = 0, ref9 = num - 1; 0 <= ref9 ? ah <= ref9 : ah >= ref9; j = 0 <= ref9 ? ++ah : --ah) {
+ newCentroids[j] *= 1 / clusterSizes[j];
+ }
+ repeat = false;
+ for (j = ai = 0, ref10 = num - 1; 0 <= ref10 ? ai <= ref10 : ai >= ref10; j = 0 <= ref10 ? ++ai : --ai) {
+ if (newCentroids[j] !== centroids[i]) {
+ repeat = true;
+ break;
+ }
+ }
+ centroids = newCentroids;
+ nb_iters++;
+ if (nb_iters > 200) {
+ repeat = false;
+ }
+ }
+ kClusters = {};
+ for (j = aj = 0, ref11 = num - 1; 0 <= ref11 ? aj <= ref11 : aj >= ref11; j = 0 <= ref11 ? ++aj : --aj) {
+ kClusters[j] = [];
+ }
+ for (i = ak = 0, ref12 = n - 1; 0 <= ref12 ? ak <= ref12 : ak >= ref12; i = 0 <= ref12 ? ++ak : --ak) {
+ cluster = assignments[i];
+ kClusters[cluster].push(values[i]);
+ }
+ tmpKMeansBreaks = [];
+ for (j = al = 0, ref13 = num - 1; 0 <= ref13 ? al <= ref13 : al >= ref13; j = 0 <= ref13 ? ++al : --al) {
+ tmpKMeansBreaks.push(kClusters[j][0]);
+ tmpKMeansBreaks.push(kClusters[j][kClusters[j].length - 1]);
+ }
+ tmpKMeansBreaks = tmpKMeansBreaks.sort(function(a, b) {
+ return a - b;
+ });
+ limits.push(tmpKMeansBreaks[0]);
+ for (i = am = 1, ref14 = tmpKMeansBreaks.length - 1; am <= ref14; i = am += 2) {
+ v = tmpKMeansBreaks[i];
+ if (!isNaN(v) && limits.indexOf(v) === -1) {
+ limits.push(v);
+ }
+ }
+ }
+ return limits;
+ };
+
+ hsi2rgb = function(h, s, i) {
+
+ /*
+ borrowed from here:
+ http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/hsi2rgb.cpp
+ */
+ var args, b, g, r;
+ args = unpack(arguments);
+ h = args[0], s = args[1], i = args[2];
+ if (isNaN(h)) {
+ h = 0;
+ }
+ h /= 360;
+ if (h < 1 / 3) {
+ b = (1 - s) / 3;
+ r = (1 + s * cos(TWOPI * h) / cos(PITHIRD - TWOPI * h)) / 3;
+ g = 1 - (b + r);
+ } else if (h < 2 / 3) {
+ h -= 1 / 3;
+ r = (1 - s) / 3;
+ g = (1 + s * cos(TWOPI * h) / cos(PITHIRD - TWOPI * h)) / 3;
+ b = 1 - (r + g);
+ } else {
+ h -= 2 / 3;
+ g = (1 - s) / 3;
+ b = (1 + s * cos(TWOPI * h) / cos(PITHIRD - TWOPI * h)) / 3;
+ r = 1 - (g + b);
+ }
+ r = limit(i * r * 3);
+ g = limit(i * g * 3);
+ b = limit(i * b * 3);
+ return [r * 255, g * 255, b * 255, args.length > 3 ? args[3] : 1];
+ };
+
+ rgb2hsi = function() {
+
+ /*
+ borrowed from here:
+ http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/rgb2hsi.cpp
+ */
+ var b, g, h, i, min, r, ref, s;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ TWOPI = Math.PI * 2;
+ r /= 255;
+ g /= 255;
+ b /= 255;
+ min = Math.min(r, g, b);
+ i = (r + g + b) / 3;
+ s = 1 - min / i;
+ if (s === 0) {
+ h = 0;
+ } else {
+ h = ((r - g) + (r - b)) / 2;
+ h /= Math.sqrt((r - g) * (r - g) + (r - b) * (g - b));
+ h = Math.acos(h);
+ if (b > g) {
+ h = TWOPI - h;
+ }
+ h /= TWOPI;
+ }
+ return [h * 360, s, i];
+ };
+
+ chroma.hsi = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['hsi']), function(){});
+ };
+
+ _input.hsi = hsi2rgb;
+
+ Color.prototype.hsi = function() {
+ return rgb2hsi(this._rgb);
+ };
+
+ interpolate_hsx = function(col1, col2, f, m) {
+ var dh, hue, hue0, hue1, lbv, lbv0, lbv1, res, sat, sat0, sat1, xyz0, xyz1;
+ if (m === 'hsl') {
+ xyz0 = col1.hsl();
+ xyz1 = col2.hsl();
+ } else if (m === 'hsv') {
+ xyz0 = col1.hsv();
+ xyz1 = col2.hsv();
+ } else if (m === 'hcg') {
+ xyz0 = col1.hcg();
+ xyz1 = col2.hcg();
+ } else if (m === 'hsi') {
+ xyz0 = col1.hsi();
+ xyz1 = col2.hsi();
+ } else if (m === 'lch' || m === 'hcl') {
+ m = 'hcl';
+ xyz0 = col1.hcl();
+ xyz1 = col2.hcl();
+ }
+ if (m.substr(0, 1) === 'h') {
+ hue0 = xyz0[0], sat0 = xyz0[1], lbv0 = xyz0[2];
+ hue1 = xyz1[0], sat1 = xyz1[1], lbv1 = xyz1[2];
+ }
+ if (!isNaN(hue0) && !isNaN(hue1)) {
+ if (hue1 > hue0 && hue1 - hue0 > 180) {
+ dh = hue1 - (hue0 + 360);
+ } else if (hue1 < hue0 && hue0 - hue1 > 180) {
+ dh = hue1 + 360 - hue0;
+ } else {
+ dh = hue1 - hue0;
+ }
+ hue = hue0 + f * dh;
+ } else if (!isNaN(hue0)) {
+ hue = hue0;
+ if ((lbv1 === 1 || lbv1 === 0) && m !== 'hsv') {
+ sat = sat0;
+ }
+ } else if (!isNaN(hue1)) {
+ hue = hue1;
+ if ((lbv0 === 1 || lbv0 === 0) && m !== 'hsv') {
+ sat = sat1;
+ }
+ } else {
+ hue = Number.NaN;
+ }
+ if (sat == null) {
+ sat = sat0 + f * (sat1 - sat0);
+ }
+ lbv = lbv0 + f * (lbv1 - lbv0);
+ return res = chroma[m](hue, sat, lbv);
+ };
+
+ _interpolators = _interpolators.concat((function() {
+ var len, o, ref, results;
+ ref = ['hsv', 'hsl', 'hsi', 'hcl', 'lch', 'hcg'];
+ results = [];
+ for (o = 0, len = ref.length; o < len; o++) {
+ m = ref[o];
+ results.push([m, interpolate_hsx]);
+ }
+ return results;
+ })());
+
+ interpolate_num = function(col1, col2, f, m) {
+ var n1, n2;
+ n1 = col1.num();
+ n2 = col2.num();
+ return chroma.num(n1 + (n2 - n1) * f, 'num');
+ };
+
+ _interpolators.push(['num', interpolate_num]);
+
+ interpolate_lab = function(col1, col2, f, m) {
+ var res, xyz0, xyz1;
+ xyz0 = col1.lab();
+ xyz1 = col2.lab();
+ return res = new Color(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), m);
+ };
+
+ _interpolators.push(['lab', interpolate_lab]);
+
+}).call(this);
+
src/node_modules/chroma-js/docs/libs/chroma.min.js
+/*
+chroma.js - JavaScript library for color conversions
+
+Copyright (c) 2011-2017, Gregor Aisch
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. The name Gregor Aisch may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca=[].slice;xa=function(){var a,b,c,d,e;for(a={},e="Boolean Number String Function Array Date RegExp Undefined Null".split(" "),d=0,b=e.length;d<b;d++)c=e[d],a["[object "+c+"]"]=c.toLowerCase();return function(b){var c;return c=Object.prototype.toString.call(b),a[c]||"object"}}(),U=function(a,b,c){return null==b&&(b=0),null==c&&(c=1),a<b&&(a=b),a>c&&(a=c),a},ya=function(a){return a.length>=3?Array.prototype.slice.call(a):a[0]},u=function(a){var b,c;for(a._clipped=!1,a._unclipped=a.slice(0),b=c=0;c<3;b=++c)b<3?((a[b]<0||a[b]>255)&&(a._clipped=!0),a[b]<0&&(a[b]=0),a[b]>255&&(a[b]=255)):3===b&&(a[b]<0&&(a[b]=0),a[b]>1&&(a[b]=1));return a._clipped||delete a._unclipped,a},d=Math.PI,sa=Math.round,w=Math.cos,B=Math.floor,ba=Math.pow,V=Math.log,ua=Math.sin,va=Math.sqrt,n=Math.atan2,Y=Math.max,m=Math.abs,g=2*d,e=d/3,b=d/180,f=180/d,t=function(){return arguments[0]instanceof a?arguments[0]:function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,arguments,function(){})},t.default=t,l=[],"undefined"!=typeof module&&null!==module&&null!=module.exports&&(module.exports=t),"function"==typeof define&&define.amd?define([],function(){return t}):(ra="undefined"!=typeof exports&&null!==exports?exports:this,ra.chroma=t),t.version="1.4.0",k={},i=[],j=!1,a=function(){function a(){var a,b,c,d,e,f,g,h,l;for(f=this,b=[],h=0,d=arguments.length;h<d;h++)null!=(a=arguments[h])&&b.push(a);if(b.length>1&&(g=b[b.length-1]),null!=k[g])f._rgb=u(k[g](ya(b.slice(0,-1))));else{for(j||(i=i.sort(function(a,b){return b.p-a.p}),j=!0),l=0,e=i.length;l<e&&(c=i[l],!(g=c.test.apply(c,b)));l++);g&&(f._rgb=u(k[g].apply(k,b)))}null==f._rgb&&console.warn("unknown format: "+b),null==f._rgb&&(f._rgb=[0,0,0]),3===f._rgb.length&&f._rgb.push(1)}return a.prototype.toString=function(){return this.hex()},a}(),t._input=k,t.brewer=r={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},function(){var a,b;b=[];for(a in r)b.push(r[a.toLowerCase()]=r[a])}(),za={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},t.colors=za,P=function(){var a,b,d,e,f,g,h,i,j;return b=ya(arguments),f=b[0],a=b[1],d=b[2],i=(f+16)/116,h=isNaN(a)?i:i+a/500,j=isNaN(d)?i:i-d/200,i=c.Yn*Q(i),h=c.Xn*Q(h),j=c.Zn*Q(j),g=Ba(3.2404542*h-1.5371385*i-.4985314*j),e=Ba(-.969266*h+1.8760108*i+.041556*j),d=Ba(.0556434*h-.2040259*i+1.0572252*j),[g,e,d,b.length>3?b[3]:1]},Ba=function(a){return 255*(a<=.00304?12.92*a:1.055*ba(a,1/2.4)-.055)},Q=function(a){return a>c.t1?a*a*a:c.t2*(a-c.t0)},c={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},ja=function(){var a,b,c,d,e,f,g,h;return d=ya(arguments),c=d[0],b=d[1],a=d[2],e=oa(c,b,a),f=e[0],g=e[1],h=e[2],[116*g-16,500*(f-g),200*(g-h)]},pa=function(a){return(a/=255)<=.04045?a/12.92:ba((a+.055)/1.055,2.4)},Aa=function(a){return a>c.t3?ba(a,1/3):a/c.t2+c.t0},oa=function(){var a,b,d,e,f,g,h;return e=ya(arguments),d=e[0],b=e[1],a=e[2],d=pa(d),b=pa(b),a=pa(a),f=Aa((.4124564*d+.3575761*b+.1804375*a)/c.Xn),g=Aa((.2126729*d+.7151522*b+.072175*a)/c.Yn),h=Aa((.0193339*d+.119192*b+.9503041*a)/c.Zn),[f,g,h]},t.lab=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["lab"]),function(){})},k.lab=P,a.prototype.lab=function(){return ja(this._rgb)},o=function(a){var b,c,d,e,f,g,h,i,j,k,l;return a=function(){var b,c,d;for(d=[],c=0,b=a.length;c<b;c++)e=a[c],d.push(t(e));return d}(),2===a.length?(j=function(){var b,c,d;for(d=[],c=0,b=a.length;c<b;c++)e=a[c],d.push(e.lab());return d}(),f=j[0],g=j[1],b=function(a){var b,c;return c=function(){var c,d;for(d=[],b=c=0;c<=2;b=++c)d.push(f[b]+a*(g[b]-f[b]));return d}(),t.lab.apply(t,c)}):3===a.length?(k=function(){var b,c,d;for(d=[],c=0,b=a.length;c<b;c++)e=a[c],d.push(e.lab());return d}(),f=k[0],g=k[1],h=k[2],b=function(a){var b,c;return c=function(){var c,d;for(d=[],b=c=0;c<=2;b=++c)d.push((1-a)*(1-a)*f[b]+2*(1-a)*a*g[b]+a*a*h[b]);return d}(),t.lab.apply(t,c)}):4===a.length?(l=function(){var b,c,d;for(d=[],c=0,b=a.length;c<b;c++)e=a[c],d.push(e.lab());return d}(),f=l[0],g=l[1],h=l[2],i=l[3],b=function(a){var b,c;return c=function(){var c,d;for(d=[],b=c=0;c<=2;b=++c)d.push((1-a)*(1-a)*(1-a)*f[b]+3*(1-a)*(1-a)*a*g[b]+3*(1-a)*a*a*h[b]+a*a*a*i[b]);return d}(),t.lab.apply(t,c)}):5===a.length&&(c=o(a.slice(0,3)),d=o(a.slice(2,5)),b=function(a){return a<.5?c(2*a):d(2*(a-.5))}),b},t.bezier=function(a){var b;return b=o(a),b.scale=function(){return t.scale(b)},b},t.cubehelix=function(a,b,c,d,e){var f,h,i;return null==a&&(a=300),null==b&&(b=-1.5),null==c&&(c=1),null==d&&(d=1),null==e&&(e=[0,1]),f=0,"array"===xa(e)?h=e[1]-e[0]:(h=0,e=[e,e]),i=function(i){var j,k,l,m,n,o,p,q,r;return j=g*((a+120)/360+b*i),p=ba(e[0]+h*i,d),o=0!==f?c[0]+i*f:c,k=o*p*(1-p)/2,m=w(j),r=ua(j),q=p+k*(-.14861*m+1.78277*r),n=p+k*(-.29227*m-.90649*r),l=p+k*(1.97294*m),t(u([255*q,255*n,255*l,1]))},i.start=function(b){return null==b?a:(a=b,i)},i.rotations=function(a){return null==a?b:(b=a,i)},i.gamma=function(a){return null==a?d:(d=a,i)},i.hue=function(a){return null==a?c:(c=a,"array"===xa(c)?0===(f=c[1]-c[0])&&(c=c[1]):f=0,i)},i.lightness=function(a){return null==a?e:("array"===xa(a)?(e=a,h=a[1]-a[0]):(e=[a,a],h=0),i)},i.scale=function(){return t.scale(i)},i.hue(c),i},t.random=function(){var b,c,d;for(c="0123456789abcdef",b="#",d=0;d<6;++d)b+=c.charAt(B(16*Math.random()));return new a(b)},l=[],I=function(a,b,c,d){var e,f,g,h;for(null==c&&(c=.5),null==d&&(d="rgb"),"object"!==xa(a)&&(a=t(a)),"object"!==xa(b)&&(b=t(b)),g=0,f=l.length;g<f;g++)if(e=l[g],d===e[0]){h=e[1](a,b,c,d);break}if(null==h)throw"color mode "+d+" is not supported";return h.alpha(a.alpha()+c*(b.alpha()-a.alpha()))},t.interpolate=I,a.prototype.interpolate=function(a,b,c){return I(this,a,b,c)},t.mix=I,a.prototype.mix=a.prototype.interpolate,k.rgb=function(){var a,b,c,d;b=ya(arguments),c=[];for(a in b)d=b[a],c.push(d);return c},t.rgb=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["rgb"]),function(){})},a.prototype.rgb=function(a){return null==a&&(a=!0),a?this._rgb.map(Math.round).slice(0,3):this._rgb.slice(0,3)},a.prototype.rgba=function(a){return null==a&&(a=!0),a?[Math.round(this._rgb[0]),Math.round(this._rgb[1]),Math.round(this._rgb[2]),this._rgb[3]]:this._rgb.slice(0)},i.push({p:3,test:function(a){var b;return b=ya(arguments),"array"===xa(b)&&3===b.length?"rgb":4===b.length&&"number"===xa(b[3])&&b[3]>=0&&b[3]<=1?"rgb":void 0}}),k.lrgb=k.rgb,L=function(b,c,d,e){var f,g;return f=b._rgb,g=c._rgb,new a(va(ba(f[0],2)*(1-d)+ba(g[0],2)*d),va(ba(f[1],2)*(1-d)+ba(g[1],2)*d),va(ba(f[2],2)*(1-d)+ba(g[2],2)*d),e)},h=function(b){var c,d,e,f,g,h;for(d=1/b.length,h=[0,0,0,0],f=0,e=b.length;f<e;f++)c=b[f],g=c._rgb,h[0]+=ba(g[0],2)*d,h[1]+=ba(g[1],2)*d,h[2]+=ba(g[2],2)*d,h[3]+=g[3]*d;return h[0]=va(h[0]),h[1]=va(h[1]),h[2]=va(h[2]),h[3]>1&&(h[3]=1),new a(u(h))},l.push(["lrgb",L]),t.average=function(a,b){var c,e,f,g,i,j,k,l,m,o,p,q,r;if(null==b&&(b="rgb"),m=a.length,a=a.map(function(a){return t(a)}),k=a.splice(0,1)[0],"lrgb"===b)return h(a);q=k.get(b),g=[],i=0,j=0;for(l in q)q[l]=q[l]||0,g.push(isNaN(q[l])?0:1),"h"!==b.charAt(l)||isNaN(q[l])||(c=q[l]/180*d,i+=w(c),j+=ua(c));for(e=k.alpha(),p=0,o=a.length;p<o;p++){f=a[p],r=f.get(b),e+=f.alpha();for(l in q)isNaN(r[l])||(g[l]+=1,"h"===b.charAt(l)?(c=r[l]/180*d,i+=w(c),j+=ua(c)):q[l]+=r[l])}for(l in q)if("h"===b.charAt(l)){for(c=n(j/g[l],i/g[l])/d*180;c<0;)c+=360;for(;c>=360;)c-=360;q[l]=c}else q[l]=q[l]/g[l];return t(q,b).alpha(e/m)},D=function(a){var b,c,d,e,f,g;if(a.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return 4!==a.length&&7!==a.length||(a=a.substr(1)),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),g=parseInt(a,16),e=g>>16,d=g>>8&255,c=255&g,[e,d,c,1];if(a.match(/^#?([A-Fa-f0-9]{8})$/))return 9===a.length&&(a=a.substr(1)),g=parseInt(a,16),e=g>>24&255,d=g>>16&255,c=g>>8&255,b=sa((255&g)/255*100)/100,[e,d,c,b];if(null!=k.css&&(f=k.css(a)))return f;throw"unknown color: "+a},fa=function(a,b){var c,d,e,f,g,h,i;return null==b&&(b="auto"),g=a[0],e=a[1],d=a[2],c=a[3],"auto"===b&&(b=c<1?"rgba":"rgb"),g=Math.round(g),e=Math.round(e),d=Math.round(d),i=g<<16|e<<8|d,h="000000"+i.toString(16),h=h.substr(h.length-6),f="0"+sa(255*c).toString(16),f=f.substr(f.length-2),"#"+function(){switch(b.toLowerCase()){case"rgba":return h+f;case"argb":return f+h;default:return h}}()},k.hex=function(a){return D(a)},t.hex=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["hex"]),function(){})},a.prototype.hex=function(a){return null==a&&(a="auto"),fa(this._rgb,a)},i.push({p:4,test:function(a){if(1===arguments.length&&"string"===xa(a))return"hex"}}),G=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;if(a=ya(arguments),e=a[0],k=a[1],g=a[2],0===k)i=d=b=255*g;else{for(n=[0,0,0],c=[0,0,0],m=g<.5?g*(1+k):g+k-g*k,l=2*g-m,e/=360,n[0]=e+1/3,n[1]=e,n[2]=e-1/3,f=h=0;h<=2;f=++h)n[f]<0&&(n[f]+=1),n[f]>1&&(n[f]-=1),6*n[f]<1?c[f]=l+6*(m-l)*n[f]:2*n[f]<1?c[f]=m:3*n[f]<2?c[f]=l+(m-l)*(2/3-n[f])*6:c[f]=l;j=[sa(255*c[0]),sa(255*c[1]),sa(255*c[2])],i=j[0],d=j[1],b=j[2]}return a.length>3?[i,d,b,a[3]]:[i,d,b]},ha=function(a,b,c){var d,e,f,g,h;return void 0!==a&&a.length>=3&&(g=a,a=g[0],b=g[1],c=g[2]),a/=255,b/=255,c/=255,f=Math.min(a,b,c),Y=Math.max(a,b,c),e=(Y+f)/2,Y===f?(h=0,d=Number.NaN):h=e<.5?(Y-f)/(Y+f):(Y-f)/(2-Y-f),a===Y?d=(b-c)/(Y-f):b===Y?d=2+(c-a)/(Y-f):c===Y&&(d=4+(a-b)/(Y-f)),d*=60,d<0&&(d+=360),[d,h,e]},t.hsl=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["hsl"]),function(){})},k.hsl=G,a.prototype.hsl=function(){return ha(this._rgb)},H=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;if(a=ya(arguments),e=a[0],p=a[1],r=a[2],r*=255,0===p)i=d=b=r;else switch(360===e&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60,f=B(e),c=e-f,g=r*(1-p),h=r*(1-p*c),q=r*(1-p*(1-c)),f){case 0:j=[r,q,g],i=j[0],d=j[1],b=j[2];break;case 1:k=[h,r,g],i=k[0],d=k[1],b=k[2];break;case 2:l=[g,r,q],i=l[0],d=l[1],b=l[2];break;case 3:m=[g,h,r],i=m[0],d=m[1],b=m[2];break;case 4:n=[q,g,r],i=n[0],d=n[1],b=n[2];break;case 5:o=[r,g,h],i=o[0],d=o[1],b=o[2]}return[i,d,b,a.length>3?a[3]:1]},ia=function(){var a,b,c,d,e,f,g,h,i;return g=ya(arguments),f=g[0],c=g[1],a=g[2],e=Math.min(f,c,a),Y=Math.max(f,c,a),b=Y-e,i=Y/255,0===Y?(d=Number.NaN,h=0):(h=b/Y,f===Y&&(d=(c-a)/b),c===Y&&(d=2+(a-f)/b),a===Y&&(d=4+(f-c)/b),(d*=60)<0&&(d+=360)),[d,h,i]},t.hsv=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["hsv"]),function(){})},k.hsv=H,a.prototype.hsv=function(){return ia(this._rgb)},_=function(a){var b,c,d;return"number"===xa(a)&&a>=0&&a<=16777215?(d=a>>16,c=a>>8&255,b=255&a,[d,c,b,1]):(console.warn("unknown num color: "+a),[0,0,0,1])},ma=function(){var a,b,c,d;return d=ya(arguments),c=d[0],b=d[1],a=d[2],(c<<16)+(b<<8)+a},t.num=function(b){return new a(b,"num")},a.prototype.num=function(a){return null==a&&(a="rgb"),ma(this._rgb,a)},k.num=_,i.push({p:1,test:function(a){if(1===arguments.length&&"number"===xa(a)&&a>=0&&a<=16777215)return"num"}}),C=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;if(c=ya(arguments),h=c[0],e=c[1],b=c[2],e/=100,g=g/100*255,a=255*e,0===e)l=g=d=b;else switch(360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360),h/=60,i=B(h),f=h-i,j=b*(1-e),k=j+a*(1-f),s=j+a*f,t=j+a,i){case 0:m=[t,s,j],l=m[0],g=m[1],d=m[2];break;case 1:n=[k,t,j],l=n[0],g=n[1],d=n[2];break;case 2:o=[j,t,s],l=o[0],g=o[1],d=o[2];break;case 3:p=[j,k,t],l=p[0],g=p[1],d=p[2];break;case 4:q=[s,j,t],l=q[0],g=q[1],d=q[2];break;case 5:r=[t,j,k],l=r[0],g=r[1],d=r[2]}return[l,g,d,c.length>3?c[3]:1]},ea=function(){var a,b,c,d,e,f,g,h,i;return i=ya(arguments),h=i[0],e=i[1],b=i[2],g=Math.min(h,e,b),Y=Math.max(h,e,b),d=Y-g,c=100*d/255,a=g/(255-d)*100,0===d?f=Number.NaN:(h===Y&&(f=(e-b)/d),e===Y&&(f=2+(b-h)/d),b===Y&&(f=4+(h-e)/d),(f*=60)<0&&(f+=360)),[f,c,a]},t.hcg=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["hcg"]),function(){})},k.hcg=C,a.prototype.hcg=function(){return ea(this._rgb)},x=function(a){var b,c,d,e,f,g,h,i;if(a=a.toLowerCase(),null!=t.colors&&t.colors[a])return D(t.colors[a]);if(f=a.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(h=f.slice(1,4),e=g=0;g<=2;e=++g)h[e]=+h[e];h[3]=1}else if(f=a.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(h=f.slice(1,5),e=i=0;i<=3;e=++i)h[e]=+h[e];else if(f=a.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(h=f.slice(1,4),e=b=0;b<=2;e=++b)h[e]=sa(2.55*h[e]);h[3]=1}else if(f=a.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(h=f.slice(1,5),e=c=0;c<=2;e=++c)h[e]=sa(2.55*h[e]);h[3]=+h[3]}else(f=a.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?(d=f.slice(1,4),d[1]*=.01,d[2]*=.01,h=G(d),h[3]=1):(f=a.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&(d=f.slice(1,4),d[1]*=.01,d[2]*=.01,h=G(d),h[3]=+f[4]);return h},da=function(a){var b;return b=a[3]<1?"rgba":"rgb","rgb"===b?b+"("+a.slice(0,3).map(sa).join(",")+")":"rgba"===b?b+"("+a.slice(0,3).map(sa).join(",")+","+a[3]+")":void 0},qa=function(a){return sa(100*a)/100},F=function(a,b){var c;return c=b<1?"hsla":"hsl",a[0]=qa(a[0]||0),a[1]=qa(100*a[1])+"%",a[2]=qa(100*a[2])+"%","hsla"===c&&(a[3]=b),c+"("+a.join(",")+")"},k.css=function(a){return x(a)},t.css=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["css"]),function(){})},a.prototype.css=function(a){return null==a&&(a="rgb"),"rgb"===a.slice(0,3)?da(this._rgb):"hsl"===a.slice(0,3)?F(this.hsl(),this.alpha()):void 0},k.named=function(a){return D(za[a])},i.push({p:5,test:function(a){if(1===arguments.length&&null!=za[a])return"named"}}),a.prototype.name=function(a){var b,c;arguments.length&&(za[a]&&(this._rgb=D(za[a])),this._rgb[3]=1),b=this.hex("rgb");for(c in za)if(b===za[c])return c;return b},R=function(){var a,c,d,e;return e=ya(arguments),d=e[0],a=e[1],c=e[2],c*=b,[d,w(c)*a,ua(c)*a]},S=function(){var a,b,c,d,e,f,g,h,i,j,k;return c=ya(arguments),h=c[0],e=c[1],g=c[2],j=R(h,e,g),a=j[0],b=j[1],d=j[2],k=P(a,b,d),i=k[0],f=k[1],d=k[2],[i,f,d,c.length>3?c[3]:1]},O=function(){var a,b,c,d,e,g;return g=ya(arguments),e=g[0],a=g[1],b=g[2],c=va(a*a+b*b),d=(n(b,a)*f+360)%360,0===sa(1e4*c)&&(d=Number.NaN),[e,c,d]},ka=function(){var a,b,c,d,e,f,g;return f=ya(arguments),e=f[0],c=f[1],b=f[2],g=ja(e,c,b),d=g[0],a=g[1],b=g[2],O(d,a,b)},t.lch=function(){var b;return b=ya(arguments),new a(b,"lch")},t.hcl=function(){var b;return b=ya(arguments),new a(b,"hcl")},k.lch=S,k.hcl=function(){var a,b,c,d;return d=ya(arguments),b=d[0],a=d[1],c=d[2],S([c,a,b])},a.prototype.lch=function(){return ka(this._rgb)},a.prototype.hcl=function(){return ka(this._rgb).reverse()},ca=function(a){var b,c,d,e,f,g,h,i,j;return null==a&&(a="rgb"),i=ya(arguments),h=i[0],e=i[1],b=i[2],h/=255,e/=255,b/=255,f=1-Math.max(h,Math.max(e,b)),d=f<1?1/(1-f):0,c=(1-h-f)*d,g=(1-e-f)*d,j=(1-b-f)*d,[c,g,j,f]},v=function(){var a,b,c,d,e,f,g,h,i;return b=ya(arguments),d=b[0],g=b[1],i=b[2],f=b[3],a=b.length>4?b[4]:1,1===f?[0,0,0,a]:(h=d>=1?0:255*(1-d)*(1-f),e=g>=1?0:255*(1-g)*(1-f),c=i>=1?0:255*(1-i)*(1-f),[h,e,c,a])},k.cmyk=function(){return v(ya(arguments))},t.cmyk=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["cmyk"]),function(){})},a.prototype.cmyk=function(){return ca(this._rgb)},k.gl=function(){var a,b,c,d,e;for(d=function(){var a,c;a=ya(arguments),c=[];for(b in a)e=a[b],c.push(e);return c}.apply(this,arguments),a=c=0;c<=2;a=++c)d[a]*=255;return d},t.gl=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["gl"]),function(){})},a.prototype.gl=function(){var a;return a=this._rgb,[a[0]/255,a[1]/255,a[2]/255,a[3]]},la=function(a,b,c){var d;return d=ya(arguments),a=d[0],b=d[1],c=d[2],a=W(a),b=W(b),c=W(c),.2126*a+.7152*b+.0722*c},W=function(a){return a/=255,a<=.03928?a/12.92:ba((a+.055)/1.055,2.4)},N=function(b,c,d,e){var f,g;return f=b._rgb,g=c._rgb,new a(f[0]+d*(g[0]-f[0]),f[1]+d*(g[1]-f[1]),f[2]+d*(g[2]-f[2]),e)},l.push(["rgb",N]),a.prototype.luminance=function(a,b){var c,d,e,f,g;return null==b&&(b="rgb"),arguments.length?(f=this._rgb,0===a?f=[0,0,0,this._rgb[3]]:1===a?f=[255,255,255,this[3]]:(c=la(this._rgb),d=1e-7,e=20,g=function(c,f){var h,i;return i=c.interpolate(f,.5,b),h=i.luminance(),Math.abs(a-h)<d||!e--?i:h>a?g(c,i):g(i,f)},f=c>a?g(t("black"),this).rgba():g(this,t("white")).rgba()),t(f).alpha(this.alpha())):la(this._rgb)},wa=function(a){var b,c,d,e;return e=a/100,e<66?(d=255,c=-155.25485562709179-.44596950469579133*(c=e-2)+104.49216199393888*V(c),b=e<20?0:.8274096064007395*(b=e-10)-254.76935184120902+115.67994401066147*V(b)):(d=351.97690566805693+.114206453784165*(d=e-55)-40.25366309332127*V(d),c=325.4494125711974+.07943456536662342*(c=e-50)-28.0852963507957*V(c),b=255),[d,c,b]},na=function(){var a,b,c,d,e,f,g,h;for(f=ya(arguments),e=f[0],f[1],a=f[2],d=1e3,c=4e4,b=.4;c-d>b;)h=.5*(c+d),g=wa(h),g[2]/g[0]>=a/e?c=h:d=h;return sa(h)},t.temperature=t.kelvin=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["temperature"]),function(){})},k.temperature=k.kelvin=k.K=wa,a.prototype.temperature=function(){return na(this._rgb)},a.prototype.kelvin=a.prototype.temperature,t.contrast=function(b,c){var d,e,f,g;return"string"!==(f=xa(b))&&"number"!==f||(b=new a(b)),"string"!==(g=xa(c))&&"number"!==g||(c=new a(c)),d=b.luminance(),e=c.luminance(),d>e?(d+.05)/(e+.05):(e+.05)/(d+.05)},t.distance=function(b,c,d){var e,f,g,h,i,j,k;null==d&&(d="lab"),"string"!==(i=xa(b))&&"number"!==i||(b=new a(b)),"string"!==(j=xa(c))&&"number"!==j||(c=new a(c)),g=b.get(d),h=c.get(d),k=0;for(f in g)e=(g[f]||0)-(h[f]||0),k+=e*e;return Math.sqrt(k)},t.deltaE=function(b,c,e,f){var g,h,i,j,k,l,o,p,q,r,s,t,u,v,x,y,z,A,B,C,D,E,F,G,H,I,J;for(null==e&&(e=1),null==f&&(f=1),"string"!==(z=xa(b))&&"number"!==z||(b=new a(b)),"string"!==(A=xa(c))&&"number"!==A||(c=new a(c)),B=b.lab(),g=B[0],i=B[1],k=B[2],C=c.lab(),h=C[0],j=C[1],l=C[2],o=va(i*i+k*k),p=va(j*j+l*l),F=g<16?.511:.040975*g/(1+.01765*g),D=.0638*o/(1+.0131*o)+.638,y=o<1e-6?0:180*n(k,i)/d;y<0;)y+=360;for(;y>=360;)y-=360;return G=y>=164&&y<=345?.56+m(.2*w(d*(y+168)/180)):.36+m(.4*w(d*(y+35)/180)),q=o*o*o*o,x=va(q/(q+1900)),E=D*(x*G+1-x),v=g-h,u=o-p,s=i-j,t=k-l,r=s*s+t*t-u*u,H=v/(e*F),I=u/(f*D),J=E,va(H*H+I*I+r/(J*J))},a.prototype.get=function(a){var b,c,d,e,f,g;return d=this,f=a.split("."),e=f[0],b=f[1],g=d[e](),b?(c=e.indexOf(b),c>-1?g[c]:console.warn("unknown channel "+b+" in mode "+e)):g},a.prototype.set=function(a,b){var c,d,e,f,g,h;if(e=this,g=a.split("."),f=g[0],c=g[1],c)if(h=e[f](),(d=f.indexOf(c))>-1)if("string"===xa(b))switch(b.charAt(0)){case"+":case"-":h[d]+=+b;break;case"*":h[d]*=+b.substr(1);break;case"/":h[d]/=+b.substr(1);break;default:h[d]=+b}else h[d]=b;else console.warn("unknown channel "+c+" in mode "+f);else h=b;return t(h,f).alpha(e.alpha())},a.prototype.clipped=function(){return this._rgb._clipped||!1},a.prototype.alpha=function(a){return arguments.length?t.rgb([this._rgb[0],this._rgb[1],this._rgb[2],a]):this._rgb[3]},a.prototype.darken=function(a){var b,d;return null==a&&(a=1),d=this,b=d.lab(),b[0]-=c.Kn*a,t.lab(b).alpha(d.alpha())},a.prototype.brighten=function(a){return null==a&&(a=1),this.darken(-a)},a.prototype.darker=a.prototype.darken,a.prototype.brighter=a.prototype.brighten,a.prototype.saturate=function(a){var b,d;return null==a&&(a=1),d=this,b=d.lch(),b[1]+=a*c.Kn,b[1]<0&&(b[1]=0),t.lch(b).alpha(d.alpha())},a.prototype.desaturate=function(a){return null==a&&(a=1),this.saturate(-a)},a.prototype.premultiply=function(){var a,b;return b=this.rgb(),a=this.alpha(),t(b[0]*a,b[1]*a,b[2]*a,a)},p=function(a,b,c){if(!p[c])throw"unknown blend mode "+c;return p[c](a,b)},q=function(a){return function(b,c){var d,e;return d=t(c).rgb(),e=t(b).rgb(),t(a(d,e),"rgb")}},A=function(a){return function(b,c){var d,e,f;for(f=[],d=e=0;e<=3;d=++e)f[d]=a(b[d],c[d]);return f}},$=function(a,b){return a},Z=function(a,b){return a*b/255},y=function(a,b){return a>b?b:a},T=function(a,b){return a>b?a:b},ta=function(a,b){return 255*(1-(1-a/255)*(1-b/255))},aa=function(a,b){return b<128?2*a*b/255:255*(1-2*(1-a/255)*(1-b/255))},s=function(a,b){return 255*(1-(1-b/255)/(a/255))},z=function(a,b){return 255===a?255:(a=b/255*255/(1-a/255),a>255?255:a)},p.normal=q(A($)),p.multiply=q(A(Z)),p.screen=q(A(ta)),p.overlay=q(A(aa)),p.darken=q(A(y)),p.lighten=q(A(T)),p.dodge=q(A(z)),p.burn=q(A(s)),t.blend=p,t.analyze=function(a){var b,c,d,e;for(d={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},c=0,b=a.length;c<b;c++)null==(e=a[c])||isNaN(e)||(d.values.push(e),d.sum+=e,e<d.min&&(d.min=e),e>d.max&&(d.max=e),d.count+=1);return d.domain=[d.min,d.max],d.limits=function(a,b){return t.limits(d,a,b)},d},t.scale=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,u,v,w,x;return k="rgb",l=t("#ccc"),p=0,!1,g=[0,1],o=[],n=[0,0],c=!1,e=[],m=!1,j=0,i=1,f=!1,d={},q=!0,h=1,w=function(a){var b,c,d,f,g,h;if(null==a&&(a=["#fff","#000"]),null!=a&&"string"===xa(a)&&null!=t.brewer&&(a=t.brewer[a]||t.brewer[a.toLowerCase()]||a),"array"===xa(a)){for(1===a.length&&(a=[a[0],a[0]]),a=a.slice(0),b=d=0,f=a.length-1;0<=f?d<=f:d>=f;b=0<=f?++d:--d)c=a[b],"string"===xa(c)&&(a[b]=t(c));for(o.length=0,b=h=0,g=a.length-1;0<=g?h<=g:h>=g;b=0<=g?++h:--h)o.push(b/(a.length-1))}return v(),e=a},s=function(a){var b,d;if(null!=c){for(d=c.length-1,b=0;b<d&&a>=c[b];)b++;return b-1}return 0},x=function(a){return a},function(a){var b,d,e,f,g;return g=a,c.length>2&&(f=c.length-1,b=s(a),e=c[0]+(c[1]-c[0])*(0+.5*p),d=c[f-1]+(c[f]-c[f-1])*(1-.5*p),g=j+(c[b]+.5*(c[b+1]-c[b])-e)/(d-e)*(i-j)),g},u=function(a,b){var f,g,m,p,r,u,v,w;if(null==b&&(b=!1),isNaN(a))return l;if(b?w=a:c&&c.length>2?(f=s(a),w=f/(c.length-2)):w=i!==j?(a-j)/(i-j):1,b||(w=x(w)),1!==h&&(w=ba(w,h)),w=n[0]+w*(1-n[0]-n[1]),w=Math.min(1,Math.max(0,w)),p=Math.floor(1e4*w),q&&d[p])g=d[p];else{if("array"===xa(e))for(m=r=0,v=o.length-1;0<=v?r<=v:r>=v;m=0<=v?++r:--r){if(u=o[m],w<=u){g=e[m];break}if(w>=u&&m===o.length-1){g=e[m];break}if(w>u&&w<o[m+1]){w=(w-u)/(o[m+1]-u),g=t.interpolate(e[m],e[m+1],w,k);break}}else"function"===xa(e)&&(g=e(w));q&&(d[p]=g)}return g},v=function(){return d={}},w(a),r=function(a){var b;return b=t(u(a)),m&&b[m]?b[m]():b},r.classes=function(a){var b;return null!=a?("array"===xa(a)?(c=a,g=[a[0],a[a.length-1]]):(b=t.analyze(g),c=0===a?[b.min,b.max]:t.limits(b,"e",a)),r):c},r.domain=function(a){var b,c,d,f,h,k,l;if(!arguments.length)return g;if(j=a[0],i=a[a.length-1],o=[],d=e.length,a.length===d&&j!==i)for(h=0,f=a.length;h<f;h++)c=a[h],o.push((c-j)/(i-j));else for(b=l=0,k=d-1;0<=k?l<=k:l>=k;b=0<=k?++l:--l)o.push(b/(d-1));return g=[j,i],r},r.mode=function(a){return arguments.length?(k=a,v(),r):k},r.range=function(a,b){return w(a,b),r},r.out=function(a){return m=a,r},r.spread=function(a){return arguments.length?(p=a,r):p},r.correctLightness=function(a){return null==a&&(a=!0),f=a,v(),x=f?function(a){var b,c,d,e,f,g,h,i,j;for(b=u(0,!0).lab()[0],c=u(1,!0).lab()[0],h=b>c,d=u(a,!0).lab()[0],f=b+(c-b)*a,e=d-f,i=0,j=1,g=20;Math.abs(e)>.01&&g-- >0;)!function(){h&&(e*=-1),e<0?(i=a,a+=.5*(j-a)):(j=a,a+=.5*(i-a)),d=u(a,!0).lab()[0],e=d-f}();return a}:function(a){return a},r},r.padding=function(a){return null!=a?("number"===xa(a)&&(a=[a,a]),n=a,r):n},r.colors=function(b,d){var f,h,i,j,k,l,m,n;if(arguments.length<2&&(d="hex"),k=[],0===arguments.length)k=e.slice(0);else if(1===b)k=[r(.5)];else if(b>1)h=g[0],f=g[1]-h,k=function(){l=[];for(var a=0;0<=b?a<b:a>b;0<=b?a++:a--)l.push(a);return l}.apply(this).map(function(a){return r(h+a/(b-1)*f)});else{if(a=[],m=[],c&&c.length>2)for(i=n=1,j=c.length;1<=j?n<j:n>j;i=1<=j?++n:--n)m.push(.5*(c[i-1]+c[i]));else m=g;k=m.map(function(a){return r(a)})}return t[d]&&(k=k.map(function(a){return a[d]()})),k},r.cache=function(a){return null!=a?(q=a,r):q},r.gamma=function(a){return null!=a?(h=a,r):h},r},null==t.scales&&(t.scales={}),t.scales.cool=function(){return t.scale([t.hsl(180,1,.9),t.hsl(250,.7,.4)])},t.scales.hot=function(){return t.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},t.analyze=function(a,b,c){var d,e,f,g,h,i,j;if(h={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==c&&(c=function(){return!0}),d=function(a){null==a||isNaN(a)||(h.values.push(a),h.sum+=a,a<h.min&&(h.min=a),a>h.max&&(h.max=a),h.count+=1)},j=function(a,e){if(c(a,e))return d(null!=b&&"function"===xa(b)?b(a):null!=b&&"string"===xa(b)||"number"===xa(b)?a[b]:a)},
+"array"===xa(a))for(g=0,f=a.length;g<f;g++)i=a[g],j(i);else for(e in a)i=a[e],j(i,e);return h.domain=[h.min,h.max],h.limits=function(a,b){return t.limits(h,a,b)},h},t.limits=function(a,b,c){var d,e,f,g,h,i,j,k,l,n,o,p,q,r,s,u,v,w,x,y,z,A,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,W,X,Z,$,_,aa,ca,da,ea,fa,ga,ha,ia,ja;if(null==b&&(b="equal"),null==c&&(c=7),"array"===xa(a)&&(a=t.analyze(a)),E=a.min,Y=a.max,a.sum,ia=a.values.sort(function(a,b){return a-b}),1===c)return[E,Y];if(C=[],"c"===b.substr(0,1)&&(C.push(E),C.push(Y)),"e"===b.substr(0,1)){for(C.push(E),y=K=1,O=c-1;1<=O?K<=O:K>=O;y=1<=O?++K:--K)C.push(E+y/c*(Y-E));C.push(Y)}else if("l"===b.substr(0,1)){if(E<=0)throw"Logarithmic scales are only possible for values > 0";for(F=Math.LOG10E*V(E),D=Math.LOG10E*V(Y),C.push(E),y=ja=1,P=c-1;1<=P?ja<=P:ja>=P;y=1<=P?++ja:--ja)C.push(ba(10,F+y/c*(D-F)));C.push(Y)}else if("q"===b.substr(0,1)){for(C.push(E),y=d=1,W=c-1;1<=W?d<=W:d>=W;y=1<=W?++d:--d)L=(ia.length-1)*y/c,M=B(L),M===L?C.push(ia[M]):(N=L-M,C.push(ia[M]*(1-N)+ia[M+1]*N));C.push(Y)}else if("k"===b.substr(0,1)){for(H=ia.length,r=new Array(H),w=new Array(c),ea=!0,I=0,u=null,u=[],u.push(E),y=e=1,X=c-1;1<=X?e<=X:e>=X;y=1<=X?++e:--e)u.push(E+y/c*(Y-E));for(u.push(Y);ea;){for(z=f=0,Z=c-1;0<=Z?f<=Z:f>=Z;z=0<=Z?++f:--f)w[z]=0;for(y=g=0,$=H-1;0<=$?g<=$:g>=$;y=0<=$?++g:--g){for(ha=ia[y],G=Number.MAX_VALUE,z=h=0,_=c-1;0<=_?h<=_:h>=_;z=0<=_?++h:--h)(x=m(u[z]-ha))<G&&(G=x,s=z);w[s]++,r[y]=s}for(J=new Array(c),z=i=0,aa=c-1;0<=aa?i<=aa:i>=aa;z=0<=aa?++i:--i)J[z]=null;for(y=j=0,ca=H-1;0<=ca?j<=ca:j>=ca;y=0<=ca?++j:--j)v=r[y],null===J[v]?J[v]=ia[y]:J[v]+=ia[y];for(z=k=0,da=c-1;0<=da?k<=da:k>=da;z=0<=da?++k:--k)J[z]*=1/w[z];for(ea=!1,z=l=0,Q=c-1;0<=Q?l<=Q:l>=Q;z=0<=Q?++l:--l)if(J[z]!==u[y]){ea=!0;break}u=J,I++,I>200&&(ea=!1)}for(A={},z=n=0,R=c-1;0<=R?n<=R:n>=R;z=0<=R?++n:--n)A[z]=[];for(y=o=0,S=H-1;0<=S?o<=S:o>=S;y=0<=S?++o:--o)v=r[y],A[v].push(ia[y]);for(fa=[],z=p=0,T=c-1;0<=T?p<=T:p>=T;z=0<=T?++p:--p)fa.push(A[z][0]),fa.push(A[z][A[z].length-1]);for(fa=fa.sort(function(a,b){return a-b}),C.push(fa[0]),y=q=1,U=fa.length-1;q<=U;y=q+=2)ga=fa[y],isNaN(ga)||-1!==C.indexOf(ga)||C.push(ga)}return C},E=function(a,b,c){var d,f,h,i;return d=ya(arguments),a=d[0],b=d[1],c=d[2],isNaN(a)&&(a=0),a/=360,a<1/3?(f=(1-b)/3,i=(1+b*w(g*a)/w(e-g*a))/3,h=1-(f+i)):a<2/3?(a-=1/3,i=(1-b)/3,h=(1+b*w(g*a)/w(e-g*a))/3,f=1-(i+h)):(a-=2/3,h=(1-b)/3,f=(1+b*w(g*a)/w(e-g*a))/3,i=1-(h+f)),i=U(c*i*3),h=U(c*h*3),f=U(c*f*3),[255*i,255*h,255*f,d.length>3?d[3]:1]},ga=function(){var a,b,c,d,e,f,h,i;return h=ya(arguments),f=h[0],b=h[1],a=h[2],g=2*Math.PI,f/=255,b/=255,a/=255,e=Math.min(f,b,a),d=(f+b+a)/3,i=1-e/d,0===i?c=0:(c=(f-b+(f-a))/2,c/=Math.sqrt((f-b)*(f-b)+(f-a)*(b-a)),c=Math.acos(c),a>b&&(c=g-c),c/=g),[360*c,i,d]},t.hsi=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ca.call(arguments).concat(["hsi"]),function(){})},k.hsi=E,a.prototype.hsi=function(){return ga(this._rgb)},J=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p;return"hsl"===d?(o=a.hsl(),p=b.hsl()):"hsv"===d?(o=a.hsv(),p=b.hsv()):"hcg"===d?(o=a.hcg(),p=b.hcg()):"hsi"===d?(o=a.hsi(),p=b.hsi()):"lch"!==d&&"hcl"!==d||(d="hcl",o=a.hcl(),p=b.hcl()),"h"===d.substr(0,1)&&(g=o[0],m=o[1],j=o[2],h=p[0],n=p[1],k=p[2]),isNaN(g)||isNaN(h)?isNaN(g)?isNaN(h)?f=Number.NaN:(f=h,1!==j&&0!==j||"hsv"===d||(l=n)):(f=g,1!==k&&0!==k||"hsv"===d||(l=m)):(e=h>g&&h-g>180?h-(g+360):h<g&&g-h>180?h+360-g:h-g,f=g+c*e),null==l&&(l=m+c*(n-m)),i=j+c*(k-j),t[d](f,l,i)},l=l.concat(function(){var a,b,c,d;for(c=["hsv","hsl","hsi","hcl","lch","hcg"],d=[],b=0,a=c.length;b<a;b++)X=c[b],d.push([X,J]);return d}()),M=function(a,b,c,d){var e,f;return e=a.num(),f=b.num(),t.num(e+(f-e)*c,"num")},l.push(["num",M]),K=function(b,c,d,e){var f,g;return f=b.lab(),g=c.lab(),new a(f[0]+d*(g[0]-f[0]),f[1]+d*(g[1]-f[1]),f[2]+d*(g[2]-f[2]),e)},l.push(["lab",K])}).call(this);
src/node_modules/chroma-js/docs/libs/codemirror/lib/codemirror.css
+/* BASICS */
+
+.CodeMirror {
+ /* Set height, width, borders, and global font properties here */
+ font-family: monospace;
+ height: 300px;
+ color: black;
+}
+
+/* PADDING */
+
+.CodeMirror-lines {
+ padding: 4px 0; /* Vertical padding around content */
+}
+.CodeMirror pre {
+ padding: 0 4px; /* Horizontal padding of content */
+}
+
+.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+ background-color: white; /* The little square between H and V scrollbars */
+}
+
+/* GUTTER */
+
+.CodeMirror-gutters {
+ border-right: 1px solid #ddd;
+ background-color: #f7f7f7;
+ white-space: nowrap;
+}
+.CodeMirror-linenumbers {}
+.CodeMirror-linenumber {
+ padding: 0 3px 0 5px;
+ min-width: 20px;
+ text-align: right;
+ color: #999;
+ white-space: nowrap;
+}
+
+.CodeMirror-guttermarker { color: black; }
+.CodeMirror-guttermarker-subtle { color: #999; }
+
+/* CURSOR */
+
+.CodeMirror div.CodeMirror-cursor {
+ border-left: 1px solid black;
+}
+/* Shown when moving in bi-directional text */
+.CodeMirror div.CodeMirror-secondarycursor {
+ border-left: 1px solid silver;
+}
+.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
+ width: auto;
+ border: 0;
+ background: #7e7;
+}
+.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
+ z-index: 1;
+}
+
+.cm-animate-fat-cursor {
+ width: auto;
+ border: 0;
+ -webkit-animation: blink 1.06s steps(1) infinite;
+ -moz-animation: blink 1.06s steps(1) infinite;
+ animation: blink 1.06s steps(1) infinite;
+}
+@-moz-keyframes blink {
+ 0% { background: #7e7; }
+ 50% { background: none; }
+ 100% { background: #7e7; }
+}
+@-webkit-keyframes blink {
+ 0% { background: #7e7; }
+ 50% { background: none; }
+ 100% { background: #7e7; }
+}
+@keyframes blink {
+ 0% { background: #7e7; }
+ 50% { background: none; }
+ 100% { background: #7e7; }
+}
+
+/* Can style cursor different in overwrite (non-insert) mode */
+div.CodeMirror-overwrite div.CodeMirror-cursor {}
+
+.cm-tab { display: inline-block; text-decoration: inherit; }
+
+.CodeMirror-ruler {
+ border-left: 1px solid #ccc;
+ position: absolute;
+}
+
+/* DEFAULT THEME */
+
+.cm-s-default .cm-header {color: blue;}
+.cm-s-default .cm-quote {color: #090;}
+.cm-negative {color: #d44;}
+.cm-positive {color: #292;}
+.cm-header, .cm-strong {font-weight: bold;}
+.cm-em {font-style: italic;}
+.cm-link {text-decoration: underline;}
+.cm-strikethrough {text-decoration: line-through;}
+
+.cm-s-default .cm-keyword {color: #708;}
+.cm-s-default .cm-atom {color: #219;}
+.cm-s-default .cm-number {color: #164;}
+.cm-s-default .cm-def {color: #00f;}
+.cm-s-default .cm-variable,
+.cm-s-default .cm-punctuation,
+.cm-s-default .cm-property,
+.cm-s-default .cm-operator {}
+.cm-s-default .cm-variable-2 {color: #05a;}
+.cm-s-default .cm-variable-3 {color: #085;}
+.cm-s-default .cm-comment {color: #a50;}
+.cm-s-default .cm-string {color: #a11;}
+.cm-s-default .cm-string-2 {color: #f50;}
+.cm-s-default .cm-meta {color: #555;}
+.cm-s-default .cm-qualifier {color: #555;}
+.cm-s-default .cm-builtin {color: #30a;}
+.cm-s-default .cm-bracket {color: #997;}
+.cm-s-default .cm-tag {color: #170;}
+.cm-s-default .cm-attribute {color: #00c;}
+.cm-s-default .cm-hr {color: #999;}
+.cm-s-default .cm-link {color: #00c;}
+
+.cm-s-default .cm-error {color: #f00;}
+.cm-invalidchar {color: #f00;}
+
+.CodeMirror-composing { border-bottom: 2px solid; }
+
+/* Default styles for common addons */
+
+div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
+div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
+.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
+.CodeMirror-activeline-background {background: #e8f2ff;}
+
+/* STOP */
+
+/* The rest of this file contains styles related to the mechanics of
+ the editor. You probably shouldn't touch them. */
+
+.CodeMirror {
+ position: relative;
+ overflow: hidden;
+ background: white;
+}
+
+.CodeMirror-scroll {
+ overflow: scroll !important; /* Things will break if this is overridden */
+ /* 30px is the magic margin used to hide the element's real scrollbars */
+ /* See overflow: hidden in .CodeMirror */
+ margin-bottom: -30px; margin-right: -30px;
+ padding-bottom: 30px;
+ height: 100%;
+ outline: none; /* Prevent dragging from highlighting the element */
+ position: relative;
+}
+.CodeMirror-sizer {
+ position: relative;
+ border-right: 30px solid transparent;
+}
+
+/* The fake, visible scrollbars. Used to force redraw during scrolling
+ before actuall scrolling happens, thus preventing shaking and
+ flickering artifacts. */
+.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+ position: absolute;
+ z-index: 6;
+ display: none;
+}
+.CodeMirror-vscrollbar {
+ right: 0; top: 0;
+ overflow-x: hidden;
+ overflow-y: scroll;
+}
+.CodeMirror-hscrollbar {
+ bottom: 0; left: 0;
+ overflow-y: hidden;
+ overflow-x: scroll;
+}
+.CodeMirror-scrollbar-filler {
+ right: 0; bottom: 0;
+}
+.CodeMirror-gutter-filler {
+ left: 0; bottom: 0;
+}
+
+.CodeMirror-gutters {
+ position: absolute; left: 0; top: 0;
+ z-index: 3;
+}
+.CodeMirror-gutter {
+ white-space: normal;
+ height: 100%;
+ display: inline-block;
+ margin-bottom: -30px;
+ /* Hack to make IE7 behave */
+ *zoom:1;
+ *display:inline;
+}
+.CodeMirror-gutter-wrapper {
+ position: absolute;
+ z-index: 4;
+ height: 100%;
+}
+.CodeMirror-gutter-elt {
+ position: absolute;
+ cursor: default;
+ z-index: 4;
+}
+.CodeMirror-gutter-wrapper {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ user-select: none;
+}
+
+.CodeMirror-lines {
+ cursor: text;
+ min-height: 1px; /* prevents collapsing before first draw */
+}
+.CodeMirror pre {
+ /* Reset some styles that the rest of the page might have set */
+ -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
+ border-width: 0;
+ background: transparent;
+ font-family: inherit;
+ font-size: inherit;
+ margin: 0;
+ white-space: pre;
+ word-wrap: normal;
+ line-height: inherit;
+ color: inherit;
+ z-index: 2;
+ position: relative;
+ overflow: visible;
+ -webkit-tap-highlight-color: transparent;
+}
+.CodeMirror-wrap pre {
+ word-wrap: break-word;
+ white-space: pre-wrap;
+ word-break: normal;
+}
+
+.CodeMirror-linebackground {
+ position: absolute;
+ left: 0; right: 0; top: 0; bottom: 0;
+ z-index: 0;
+}
+
+.CodeMirror-linewidget {
+ position: relative;
+ z-index: 2;
+ overflow: auto;
+}
+
+.CodeMirror-widget {}
+
+.CodeMirror-code {
+ outline: none;
+}
+
+/* Force content-box sizing for the elements where we expect it */
+.CodeMirror-scroll,
+.CodeMirror-sizer,
+.CodeMirror-gutter,
+.CodeMirror-gutters,
+.CodeMirror-linenumber {
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+}
+
+.CodeMirror-measure {
+ position: absolute;
+ width: 100%;
+ height: 0;
+ overflow: hidden;
+ visibility: hidden;
+}
+.CodeMirror-measure pre { position: static; }
+
+.CodeMirror div.CodeMirror-cursor {
+ position: absolute;
+ border-right: none;
+ width: 0;
+}
+
+div.CodeMirror-cursors {
+ visibility: hidden;
+ position: relative;
+ z-index: 3;
+}
+.CodeMirror-focused div.CodeMirror-cursors {
+ visibility: visible;
+}
+
+.CodeMirror-selected { background: #d9d9d9; }
+.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
+.CodeMirror-crosshair { cursor: crosshair; }
+.CodeMirror ::selection { background: #d7d4f0; }
+.CodeMirror ::-moz-selection { background: #d7d4f0; }
+
+.cm-searching {
+ background: #ffa;
+ background: rgba(255, 255, 0, .4);
+}
+
+/* IE7 hack to prevent it from returning funny offsetTops on the spans */
+.CodeMirror span { *vertical-align: text-bottom; }
+
+/* Used to force a border model for a node */
+.cm-force-border { padding-right: .1px; }
+
+@media print {
+ /* Hide the cursor when printing */
+ .CodeMirror div.CodeMirror-cursors {
+ visibility: hidden;
+ }
+}
+
+/* See issue #2901 */
+.cm-tab-wrap-hack:after { content: ''; }
+
+/* Help users use markselection to safely style text background */
+span.CodeMirror-selectedtext { background: none; }
src/node_modules/chroma-js/docs/libs/codemirror/lib/codemirror.js
Binary files differ
src/node_modules/chroma-js/docs/libs/codemirror/mode/javascript/index.html
+<!doctype html>
+
+<title>CodeMirror: JavaScript mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src="../../addon/comment/continuecomment.js"></script>
+<script src="../../addon/comment/comment.js"></script>
+<script src="javascript.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">JavaScript</a>
+ </ul>
+</div>
+
+<article>
+<h2>JavaScript mode</h2>
+
+
+<div><textarea id="code" name="code">
+// Demo code (the actual new parser character stream implementation)
+
+function StringStream(string) {
+ this.pos = 0;
+ this.string = string;
+}
+
+StringStream.prototype = {
+ done: function() {return this.pos >= this.string.length;},
+ peek: function() {return this.string.charAt(this.pos);},
+ next: function() {
+ if (this.pos &lt; this.string.length)
+ return this.string.charAt(this.pos++);
+ },
+ eat: function(match) {
+ var ch = this.string.charAt(this.pos);
+ if (typeof match == "string") var ok = ch == match;
+ else var ok = ch &amp;&amp; match.test ? match.test(ch) : match(ch);
+ if (ok) {this.pos++; return ch;}
+ },
+ eatWhile: function(match) {
+ var start = this.pos;
+ while (this.eat(match));
+ if (this.pos > start) return this.string.slice(start, this.pos);
+ },
+ backUp: function(n) {this.pos -= n;},
+ column: function() {return this.pos;},
+ eatSpace: function() {
+ var start = this.pos;
+ while (/\s/.test(this.string.charAt(this.pos))) this.pos++;
+ return this.pos - start;
+ },
+ match: function(pattern, consume, caseInsensitive) {
+ if (typeof pattern == "string") {
+ function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
+ if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
+ if (consume !== false) this.pos += str.length;
+ return true;
+ }
+ }
+ else {
+ var match = this.string.slice(this.pos).match(pattern);
+ if (match &amp;&amp; consume !== false) this.pos += match[0].length;
+ return match;
+ }
+ }
+};
+</textarea></div>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ continueComments: "Enter",
+ extraKeys: {"Ctrl-Q": "toggleComment"}
+ });
+ </script>
+
+ <p>
+ JavaScript mode supports several configuration options:
+ <ul>
+ <li><code>json</code> which will set the mode to expect JSON
+ data rather than a JavaScript program.</li>
+ <li><code>jsonld</code> which will set the mode to expect
+ <a href="http://json-ld.org">JSON-LD</a> linked data rather
+ than a JavaScript program (<a href="json-ld.html">demo</a>).</li>
+ <li><code>typescript</code> which will activate additional
+ syntax highlighting and some other things for TypeScript code
+ (<a href="typescript.html">demo</a>).</li>
+ <li><code>statementIndent</code> which (given a number) will
+ determine the amount of indentation to use for statements
+ continued on a new line.</li>
+ <li><code>wordCharacters</code>, a regexp that indicates which
+ characters should be considered part of an identifier.
+ Defaults to <code>/[\w$]/</code>, which does not handle
+ non-ASCII identifiers. Can be set to something more elaborate
+ to improve Unicode support.</li>
+ </ul>
+ </p>
+
+ <p><strong>MIME types defined:</strong> <code>text/javascript</code>, <code>application/json</code>, <code>application/ld+json</code>, <code>text/typescript</code>, <code>application/typescript</code>.</p>
+ </article>
src/node_modules/chroma-js/docs/libs/codemirror/mode/javascript/javascript.js
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// TODO actually recognize syntax of TypeScript constructs
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+"use strict";
+
+CodeMirror.defineMode("javascript", function(config, parserConfig) {
+ var indentUnit = config.indentUnit;
+ var statementIndent = parserConfig.statementIndent;
+ var jsonldMode = parserConfig.jsonld;
+ var jsonMode = parserConfig.json || jsonldMode;
+ var isTS = parserConfig.typescript;
+ var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
+
+ // Tokenizer
+
+ var keywords = function(){
+ function kw(type) {return {type: type, style: "keyword"};}
+ var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
+ var operator = kw("operator"), atom = {type: "atom", style: "atom"};
+
+ var jsKeywords = {
+ "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
+ "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C,
+ "var": kw("var"), "const": kw("var"), "let": kw("var"),
+ "function": kw("function"), "catch": kw("catch"),
+ "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
+ "in": operator, "typeof": operator, "instanceof": operator,
+ "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
+ "this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"),
+ "yield": C, "export": kw("export"), "import": kw("import"), "extends": C
+ };
+
+ // Extend the 'normal' keywords with the TypeScript language extensions
+ if (isTS) {
+ var type = {type: "variable", style: "variable-3"};
+ var tsKeywords = {
+ // object-like things
+ "interface": kw("interface"),
+ "extends": kw("extends"),
+ "constructor": kw("constructor"),
+
+ // scope modifiers
+ "public": kw("public"),
+ "private": kw("private"),
+ "protected": kw("protected"),
+ "static": kw("static"),
+
+ // types
+ "string": type, "number": type, "bool": type, "any": type
+ };
+
+ for (var attr in tsKeywords) {
+ jsKeywords[attr] = tsKeywords[attr];
+ }
+ }
+
+ return jsKeywords;
+ }();
+
+ var isOperatorChar = /[+\-*&%=<>!?|~^]/;
+ var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
+
+ function readRegexp(stream) {
+ var escaped = false, next, inSet = false;
+ while ((next = stream.next()) != null) {
+ if (!escaped) {
+ if (next == "/" && !inSet) return;
+ if (next == "[") inSet = true;
+ else if (inSet && next == "]") inSet = false;
+ }
+ escaped = !escaped && next == "\\";
+ }
+ }
+
+ // Used as scratch variables to communicate multiple values without
+ // consing up tons of objects.
+ var type, content;
+ function ret(tp, style, cont) {
+ type = tp; content = cont;
+ return style;
+ }
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+ if (ch == '"' || ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) {
+ return ret("number", "number");
+ } else if (ch == "." && stream.match("..")) {
+ return ret("spread", "meta");
+ } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
+ return ret(ch);
+ } else if (ch == "=" && stream.eat(">")) {
+ return ret("=>", "operator");
+ } else if (ch == "0" && stream.eat(/x/i)) {
+ stream.eatWhile(/[\da-f]/i);
+ return ret("number", "number");
+ } else if (/\d/.test(ch)) {
+ stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
+ return ret("number", "number");
+ } else if (ch == "/") {
+ if (stream.eat("*")) {
+ state.tokenize = tokenComment;
+ return tokenComment(stream, state);
+ } else if (stream.eat("/")) {
+ stream.skipToEnd();
+ return ret("comment", "comment");
+ } else if (state.lastType == "operator" || state.lastType == "keyword c" ||
+ state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) {
+ readRegexp(stream);
+ stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
+ return ret("regexp", "string-2");
+ } else {
+ stream.eatWhile(isOperatorChar);
+ return ret("operator", "operator", stream.current());
+ }
+ } else if (ch == "`") {
+ state.tokenize = tokenQuasi;
+ return tokenQuasi(stream, state);
+ } else if (ch == "#") {
+ stream.skipToEnd();
+ return ret("error", "error");
+ } else if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return ret("operator", "operator", stream.current());
+ } else if (wordRE.test(ch)) {
+ stream.eatWhile(wordRE);
+ var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
+ return (known && state.lastType != ".") ? ret(known.type, known.style, word) :
+ ret("variable", "variable", word);
+ }
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, next;
+ if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){
+ state.tokenize = tokenBase;
+ return ret("jsonld-keyword", "meta");
+ }
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped) break;
+ escaped = !escaped && next == "\\";
+ }
+ if (!escaped) state.tokenize = tokenBase;
+ return ret("string", "string");
+ };
+ }
+
+ function tokenComment(stream, state) {
+ var maybeEnd = false, ch;
+ while (ch = stream.next()) {
+ if (ch == "/" && maybeEnd) {
+ state.tokenize = tokenBase;
+ break;
+ }
+ maybeEnd = (ch == "*");
+ }
+ return ret("comment", "comment");
+ }
+
+ function tokenQuasi(stream, state) {
+ var escaped = false, next;
+ while ((next = stream.next()) != null) {
+ if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
+ state.tokenize = tokenBase;
+ break;
+ }
+ escaped = !escaped && next == "\\";
+ }
+ return ret("quasi", "string-2", stream.current());
+ }
+
+ var brackets = "([{}])";
+ // This is a crude lookahead trick to try and notice that we're
+ // parsing the argument patterns for a fat-arrow function before we
+ // actually hit the arrow token. It only works if the arrow is on
+ // the same line as the arguments and there's no strange noise
+ // (comments) in between. Fallback is to only notice when we hit the
+ // arrow, and not declare the arguments as locals for the arrow
+ // body.
+ function findFatArrow(stream, state) {
+ if (state.fatArrowAt) state.fatArrowAt = null;
+ var arrow = stream.string.indexOf("=>", stream.start);
+ if (arrow < 0) return;
+
+ var depth = 0, sawSomething = false;
+ for (var pos = arrow - 1; pos >= 0; --pos) {
+ var ch = stream.string.charAt(pos);
+ var bracket = brackets.indexOf(ch);
+ if (bracket >= 0 && bracket < 3) {
+ if (!depth) { ++pos; break; }
+ if (--depth == 0) break;
+ } else if (bracket >= 3 && bracket < 6) {
+ ++depth;
+ } else if (wordRE.test(ch)) {
+ sawSomething = true;
+ } else if (/["'\/]/.test(ch)) {
+ return;
+ } else if (sawSomething && !depth) {
+ ++pos;
+ break;
+ }
+ }
+ if (sawSomething && !depth) state.fatArrowAt = pos;
+ }
+
+ // Parser
+
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};
+
+ function JSLexical(indented, column, type, align, prev, info) {
+ this.indented = indented;
+ this.column = column;
+ this.type = type;
+ this.prev = prev;
+ this.info = info;
+ if (align != null) this.align = align;
+ }
+
+ function inScope(state, varname) {
+ for (var v = state.localVars; v; v = v.next)
+ if (v.name == varname) return true;
+ for (var cx = state.context; cx; cx = cx.prev) {
+ for (var v = cx.vars; v; v = v.next)
+ if (v.name == varname) return true;
+ }
+ }
+
+ function parseJS(state, style, type, content, stream) {
+ var cc = state.cc;
+ // Communicate our context to the combinators.
+ // (Less wasteful than consing up a hundred closures on every call.)
+ cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;
+
+ if (!state.lexical.hasOwnProperty("align"))
+ state.lexical.align = true;
+
+ while(true) {
+ var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
+ if (combinator(type, content)) {
+ while(cc.length && cc[cc.length - 1].lex)
+ cc.pop()();
+ if (cx.marked) return cx.marked;
+ if (type == "variable" && inScope(state, content)) return "variable-2";
+ return style;
+ }
+ }
+ }
+
+ // Combinator utils
+
+ var cx = {state: null, column: null, marked: null, cc: null};
+ function pass() {
+ for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
+ }
+ function cont() {
+ pass.apply(null, arguments);
+ return true;
+ }
+ function register(varname) {
+ function inList(list) {
+ for (var v = list; v; v = v.next)
+ if (v.name == varname) return true;
+ return false;
+ }
+ var state = cx.state;
+ if (state.context) {
+ cx.marked = "def";
+ if (inList(state.localVars)) return;
+ state.localVars = {name: varname, next: state.localVars};
+ } else {
+ if (inList(state.globalVars)) return;
+ if (parserConfig.globalVars)
+ state.globalVars = {name: varname, next: state.globalVars};
+ }
+ }
+
+ // Combinators
+
+ var defaultVars = {name: "this", next: {name: "arguments"}};
+ function pushcontext() {
+ cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
+ cx.state.localVars = defaultVars;
+ }
+ function popcontext() {
+ cx.state.localVars = cx.state.context.vars;
+ cx.state.context = cx.state.context.prev;
+ }
+ function pushlex(type, info) {
+ var result = function() {
+ var state = cx.state, indent = state.indented;
+ if (state.lexical.type == "stat") indent = state.lexical.indented;
+ else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
+ indent = outer.indented;
+ state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);
+ };
+ result.lex = true;
+ return result;
+ }
+ function poplex() {
+ var state = cx.state;
+ if (state.lexical.prev) {
+ if (state.lexical.type == ")")
+ state.indented = state.lexical.indented;
+ state.lexical = state.lexical.prev;
+ }
+ }
+ poplex.lex = true;
+
+ function expect(wanted) {
+ function exp(type) {
+ if (type == wanted) return cont();
+ else if (wanted == ";") return pass();
+ else return cont(exp);
+ };
+ return exp;
+ }
+
+ function statement(type, value) {
+ if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex);
+ if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
+ if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
+ if (type == "{") return cont(pushlex("}"), block, poplex);
+ if (type == ";") return cont();
+ if (type == "if") {
+ if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
+ cx.state.cc.pop()();
+ return cont(pushlex("form"), expression, statement, poplex, maybeelse);
+ }
+ if (type == "function") return cont(functiondef);
+ if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
+ if (type == "variable") return cont(pushlex("stat"), maybelabel);
+ if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
+ block, poplex, poplex);
+ if (type == "case") return cont(expression, expect(":"));
+ if (type == "default") return cont(expect(":"));
+ if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
+ statement, poplex, popcontext);
+ if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex);
+ if (type == "class") return cont(pushlex("form"), className, poplex);
+ if (type == "export") return cont(pushlex("form"), afterExport, poplex);
+ if (type == "import") return cont(pushlex("form"), afterImport, poplex);
+ return pass(pushlex("stat"), expression, expect(";"), poplex);
+ }
+ function expression(type) {
+ return expressionInner(type, false);
+ }
+ function expressionNoComma(type) {
+ return expressionInner(type, true);
+ }
+ function expressionInner(type, noComma) {
+ if (cx.state.fatArrowAt == cx.stream.start) {
+ var body = noComma ? arrowBodyNoComma : arrowBody;
+ if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext);
+ else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
+ }
+
+ var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
+ if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
+ if (type == "function") return cont(functiondef, maybeop);
+ if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression);
+ if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop);
+ if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
+ if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
+ if (type == "{") return contCommasep(objprop, "}", null, maybeop);
+ if (type == "quasi") { return pass(quasi, maybeop); }
+ return cont();
+ }
+ function maybeexpression(type) {
+ if (type.match(/[;\}\)\],]/)) return pass();
+ return pass(expression);
+ }
+ function maybeexpressionNoComma(type) {
+ if (type.match(/[;\}\)\],]/)) return pass();
+ return pass(expressionNoComma);
+ }
+
+ function maybeoperatorComma(type, value) {
+ if (type == ",") return cont(expression);
+ return maybeoperatorNoComma(type, value, false);
+ }
+ function maybeoperatorNoComma(type, value, noComma) {
+ var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
+ var expr = noComma == false ? expression : expressionNoComma;
+ if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
+ if (type == "operator") {
+ if (/\+\+|--/.test(value)) return cont(me);
+ if (value == "?") return cont(expression, expect(":"), expr);
+ return cont(expr);
+ }
+ if (type == "quasi") { return pass(quasi, me); }
+ if (type == ";") return;
+ if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
+ if (type == ".") return cont(property, me);
+ if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
+ }
+ function quasi(type, value) {
+ if (type != "quasi") return pass();
+ if (value.slice(value.length - 2) != "${") return cont(quasi);
+ return cont(expression, continueQuasi);
+ }
+ function continueQuasi(type) {
+ if (type == "}") {
+ cx.marked = "string-2";
+ cx.state.tokenize = tokenQuasi;
+ return cont(quasi);
+ }
+ }
+ function arrowBody(type) {
+ findFatArrow(cx.stream, cx.state);
+ return pass(type == "{" ? statement : expression);
+ }
+ function arrowBodyNoComma(type) {
+ findFatArrow(cx.stream, cx.state);
+ return pass(type == "{" ? statement : expressionNoComma);
+ }
+ function maybelabel(type) {
+ if (type == ":") return cont(poplex, statement);
+ return pass(maybeoperatorComma, expect(";"), poplex);
+ }
+ function property(type) {
+ if (type == "variable") {cx.marked = "property"; return cont();}
+ }
+ function objprop(type, value) {
+ if (type == "variable" || cx.style == "keyword") {
+ cx.marked = "property";
+ if (value == "get" || value == "set") return cont(getterSetter);
+ return cont(afterprop);
+ } else if (type == "number" || type == "string") {
+ cx.marked = jsonldMode ? "property" : (cx.style + " property");
+ return cont(afterprop);
+ } else if (type == "jsonld-keyword") {
+ return cont(afterprop);
+ } else if (type == "[") {
+ return cont(expression, expect("]"), afterprop);
+ }
+ }
+ function getterSetter(type) {
+ if (type != "variable") return pass(afterprop);
+ cx.marked = "property";
+ return cont(functiondef);
+ }
+ function afterprop(type) {
+ if (type == ":") return cont(expressionNoComma);
+ if (type == "(") return pass(functiondef);
+ }
+ function commasep(what, end) {
+ function proceed(type) {
+ if (type == ",") {
+ var lex = cx.state.lexical;
+ if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
+ return cont(what, proceed);
+ }
+ if (type == end) return cont();
+ return cont(expect(end));
+ }
+ return function(type) {
+ if (type == end) return cont();
+ return pass(what, proceed);
+ };
+ }
+ function contCommasep(what, end, info) {
+ for (var i = 3; i < arguments.length; i++)
+ cx.cc.push(arguments[i]);
+ return cont(pushlex(end, info), commasep(what, end), poplex);
+ }
+ function block(type) {
+ if (type == "}") return cont();
+ return pass(statement, block);
+ }
+ function maybetype(type) {
+ if (isTS && type == ":") return cont(typedef);
+ }
+ function maybedefault(_, value) {
+ if (value == "=") return cont(expressionNoComma);
+ }
+ function typedef(type) {
+ if (type == "variable") {cx.marked = "variable-3"; return cont();}
+ }
+ function vardef() {
+ return pass(pattern, maybetype, maybeAssign, vardefCont);
+ }
+ function pattern(type, value) {
+ if (type == "variable") { register(value); return cont(); }
+ if (type == "[") return contCommasep(pattern, "]");
+ if (type == "{") return contCommasep(proppattern, "}");
+ }
+ function proppattern(type, value) {
+ if (type == "variable" && !cx.stream.match(/^\s*:/, false)) {
+ register(value);
+ return cont(maybeAssign);
+ }
+ if (type == "variable") cx.marked = "property";
+ return cont(expect(":"), pattern, maybeAssign);
+ }
+ function maybeAssign(_type, value) {
+ if (value == "=") return cont(expressionNoComma);
+ }
+ function vardefCont(type) {
+ if (type == ",") return cont(vardef);
+ }
+ function maybeelse(type, value) {
+ if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
+ }
+ function forspec(type) {
+ if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
+ }
+ function forspec1(type) {
+ if (type == "var") return cont(vardef, expect(";"), forspec2);
+ if (type == ";") return cont(forspec2);
+ if (type == "variable") return cont(formaybeinof);
+ return pass(expression, expect(";"), forspec2);
+ }
+ function formaybeinof(_type, value) {
+ if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
+ return cont(maybeoperatorComma, forspec2);
+ }
+ function forspec2(type, value) {
+ if (type == ";") return cont(forspec3);
+ if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
+ return pass(expression, expect(";"), forspec3);
+ }
+ function forspec3(type) {
+ if (type != ")") cont(expression);
+ }
+ function functiondef(type, value) {
+ if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
+ if (type == "variable") {register(value); return cont(functiondef);}
+ if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, statement, popcontext);
+ }
+ function funarg(type) {
+ if (type == "spread") return cont(funarg);
+ return pass(pattern, maybetype, maybedefault);
+ }
+ function className(type, value) {
+ if (type == "variable") {register(value); return cont(classNameAfter);}
+ }
+ function classNameAfter(type, value) {
+ if (value == "extends") return cont(expression, classNameAfter);
+ if (type == "{") return cont(pushlex("}"), classBody, poplex);
+ }
+ function classBody(type, value) {
+ if (type == "variable" || cx.style == "keyword") {
+ if (value == "static") {
+ cx.marked = "keyword";
+ return cont(classBody);
+ }
+ cx.marked = "property";
+ if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody);
+ return cont(functiondef, classBody);
+ }
+ if (value == "*") {
+ cx.marked = "keyword";
+ return cont(classBody);
+ }
+ if (type == ";") return cont(classBody);
+ if (type == "}") return cont();
+ }
+ function classGetterSetter(type) {
+ if (type != "variable") return pass();
+ cx.marked = "property";
+ return cont();
+ }
+ function afterModule(type, value) {
+ if (type == "string") return cont(statement);
+ if (type == "variable") { register(value); return cont(maybeFrom); }
+ }
+ function afterExport(_type, value) {
+ if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
+ if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
+ return pass(statement);
+ }
+ function afterImport(type) {
+ if (type == "string") return cont();
+ return pass(importSpec, maybeFrom);
+ }
+ function importSpec(type, value) {
+ if (type == "{") return contCommasep(importSpec, "}");
+ if (type == "variable") register(value);
+ if (value == "*") cx.marked = "keyword";
+ return cont(maybeAs);
+ }
+ function maybeAs(_type, value) {
+ if (value == "as") { cx.marked = "keyword"; return cont(importSpec); }
+ }
+ function maybeFrom(_type, value) {
+ if (value == "from") { cx.marked = "keyword"; return cont(expression); }
+ }
+ function arrayLiteral(type) {
+ if (type == "]") return cont();
+ return pass(expressionNoComma, maybeArrayComprehension);
+ }
+ function maybeArrayComprehension(type) {
+ if (type == "for") return pass(comprehension, expect("]"));
+ if (type == ",") return cont(commasep(maybeexpressionNoComma, "]"));
+ return pass(commasep(expressionNoComma, "]"));
+ }
+ function comprehension(type) {
+ if (type == "for") return cont(forspec, comprehension);
+ if (type == "if") return cont(expression, comprehension);
+ }
+
+ function isContinuedStatement(state, textAfter) {
+ return state.lastType == "operator" || state.lastType == "," ||
+ isOperatorChar.test(textAfter.charAt(0)) ||
+ /[,.]/.test(textAfter.charAt(0));
+ }
+
+ // Interface
+
+ return {
+ startState: function(basecolumn) {
+ var state = {
+ tokenize: tokenBase,
+ lastType: "sof",
+ cc: [],
+ lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
+ localVars: parserConfig.localVars,
+ context: parserConfig.localVars && {vars: parserConfig.localVars},
+ indented: 0
+ };
+ if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
+ state.globalVars = parserConfig.globalVars;
+ return state;
+ },
+
+ token: function(stream, state) {
+ if (stream.sol()) {
+ if (!state.lexical.hasOwnProperty("align"))
+ state.lexical.align = false;
+ state.indented = stream.indentation();
+ findFatArrow(stream, state);
+ }
+ if (state.tokenize != tokenComment && stream.eatSpace()) return null;
+ var style = state.tokenize(stream, state);
+ if (type == "comment") return style;
+ state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
+ return parseJS(state, style, type, content, stream);
+ },
+
+ indent: function(state, textAfter) {
+ if (state.tokenize == tokenComment) return CodeMirror.Pass;
+ if (state.tokenize != tokenBase) return 0;
+ var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;
+ // Kludge to prevent 'maybelse' from blocking lexical scope pops
+ if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
+ var c = state.cc[i];
+ if (c == poplex) lexical = lexical.prev;
+ else if (c != maybeelse) break;
+ }
+ if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;
+ if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
+ lexical = lexical.prev;
+ var type = lexical.type, closing = firstChar == type;
+
+ if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0);
+ else if (type == "form" && firstChar == "{") return lexical.indented;
+ else if (type == "form") return lexical.indented + indentUnit;
+ else if (type == "stat")
+ return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);
+ else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
+ return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
+ else if (lexical.align) return lexical.column + (closing ? 0 : 1);
+ else return lexical.indented + (closing ? 0 : indentUnit);
+ },
+
+ electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
+ blockCommentStart: jsonMode ? null : "/*",
+ blockCommentEnd: jsonMode ? null : "*/",
+ lineComment: jsonMode ? null : "//",
+ fold: "brace",
+ closeBrackets: "()[]{}''\"\"``",
+
+ helperType: jsonMode ? "json" : "javascript",
+ jsonldMode: jsonldMode,
+ jsonMode: jsonMode
+ };
+});
+
+CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);
+
+CodeMirror.defineMIME("text/javascript", "javascript");
+CodeMirror.defineMIME("text/ecmascript", "javascript");
+CodeMirror.defineMIME("application/javascript", "javascript");
+CodeMirror.defineMIME("application/x-javascript", "javascript");
+CodeMirror.defineMIME("application/ecmascript", "javascript");
+CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
+CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});
+CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});
+CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
+CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
+
+});
src/node_modules/chroma-js/docs/libs/codemirror/mode/javascript/json-ld.html
+<!doctype html>
+
+<title>CodeMirror: JSON-LD mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src="../../addon/comment/continuecomment.js"></script>
+<script src="../../addon/comment/comment.js"></script>
+<script src="javascript.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id="nav">
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"/></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">JSON-LD</a>
+ </ul>
+</div>
+
+<article>
+<h2>JSON-LD mode</h2>
+
+
+<div><textarea id="code" name="code">
+{
+ "@context": {
+ "name": "http://schema.org/name",
+ "description": "http://schema.org/description",
+ "image": {
+ "@id": "http://schema.org/image",
+ "@type": "@id"
+ },
+ "geo": "http://schema.org/geo",
+ "latitude": {
+ "@id": "http://schema.org/latitude",
+ "@type": "xsd:float"
+ },
+ "longitude": {
+ "@id": "http://schema.org/longitude",
+ "@type": "xsd:float"
+ },
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
+ },
+ "name": "The Empire State Building",
+ "description": "The Empire State Building is a 102-story landmark in New York City.",
+ "image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",
+ "geo": {
+ "latitude": "40.75",
+ "longitude": "73.98"
+ }
+}
+</textarea></div>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ matchBrackets: true,
+ autoCloseBrackets: true,
+ mode: "application/ld+json",
+ lineWrapping: true
+ });
+ </script>
+
+ <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
+ </article>
src/node_modules/chroma-js/docs/libs/codemirror/mode/javascript/test.js
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "javascript");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
+
+ MT("locals",
+ "[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }");
+
+ MT("comma-and-binop",
+ "[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }");
+
+ MT("destructuring",
+ "([keyword function]([def a], [[[def b], [def c] ]]) {",
+ " [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);",
+ " [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];",
+ "})();");
+
+ MT("class_body",
+ "[keyword class] [variable Foo] {",
+ " [property constructor]() {}",
+ " [property sayName]() {",
+ " [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];",
+ " }",
+ "}");
+
+ MT("class",
+ "[keyword class] [variable Point] [keyword extends] [variable SuperThing] {",
+ " [property get] [property prop]() { [keyword return] [number 24]; }",
+ " [property constructor]([def x], [def y]) {",
+ " [keyword super]([string 'something']);",
+ " [keyword this].[property x] [operator =] [variable-2 x];",
+ " }",
+ "}");
+
+ MT("module",
+ "[keyword module] [string 'foo'] {",
+ " [keyword export] [keyword let] [def x] [operator =] [number 42];",
+ " [keyword export] [keyword *] [keyword from] [string 'somewhere'];",
+ "}");
+
+ MT("import",
+ "[keyword function] [variable foo]() {",
+ " [keyword import] [def $] [keyword from] [string 'jquery'];",
+ " [keyword module] [def crypto] [keyword from] [string 'crypto'];",
+ " [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];",
+ "}");
+
+ MT("const",
+ "[keyword function] [variable f]() {",
+ " [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];",
+ "}");
+
+ MT("for/of",
+ "[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}");
+
+ MT("generator",
+ "[keyword function*] [variable repeat]([def n]) {",
+ " [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])",
+ " [keyword yield] [variable-2 i];",
+ "}");
+
+ MT("quotedStringAddition",
+ "[keyword let] [variable f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];");
+
+ MT("quotedFatArrow",
+ "[keyword let] [variable f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];");
+
+ MT("fatArrow",
+ "[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);",
+ "[variable a];", // No longer in scope
+ "[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];",
+ "[variable c];");
+
+ MT("spread",
+ "[keyword function] [variable f]([def a], [meta ...][def b]) {",
+ " [variable something]([variable-2 a], [meta ...][variable-2 b]);",
+ "}");
+
+ MT("comprehension",
+ "[keyword function] [variable f]() {",
+ " [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];",
+ " ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));",
+ "}");
+
+ MT("quasi",
+ "[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]");
+
+ MT("quasi_no_function",
+ "[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]");
+
+ MT("indent_statement",
+ "[keyword var] [variable x] [operator =] [number 10]",
+ "[variable x] [operator +=] [variable y] [operator +]",
+ " [atom Infinity]",
+ "[keyword debugger];");
+
+ MT("indent_if",
+ "[keyword if] ([number 1])",
+ " [keyword break];",
+ "[keyword else] [keyword if] ([number 2])",
+ " [keyword continue];",
+ "[keyword else]",
+ " [number 10];",
+ "[keyword if] ([number 1]) {",
+ " [keyword break];",
+ "} [keyword else] [keyword if] ([number 2]) {",
+ " [keyword continue];",
+ "} [keyword else] {",
+ " [number 10];",
+ "}");
+
+ MT("indent_for",
+ "[keyword for] ([keyword var] [variable i] [operator =] [number 0];",
+ " [variable i] [operator <] [number 100];",
+ " [variable i][operator ++])",
+ " [variable doSomething]([variable i]);",
+ "[keyword debugger];");
+
+ MT("indent_c_style",
+ "[keyword function] [variable foo]()",
+ "{",
+ " [keyword debugger];",
+ "}");
+
+ MT("indent_else",
+ "[keyword for] (;;)",
+ " [keyword if] ([variable foo])",
+ " [keyword if] ([variable bar])",
+ " [number 1];",
+ " [keyword else]",
+ " [number 2];",
+ " [keyword else]",
+ " [number 3];");
+
+ MT("indent_funarg",
+ "[variable foo]([number 10000],",
+ " [keyword function]([def a]) {",
+ " [keyword debugger];",
+ "};");
+
+ MT("indent_below_if",
+ "[keyword for] (;;)",
+ " [keyword if] ([variable foo])",
+ " [number 1];",
+ "[number 2];");
+
+ MT("multilinestring",
+ "[keyword var] [variable x] [operator =] [string 'foo\\]",
+ "[string bar'];");
+
+ MT("scary_regexp",
+ "[string-2 /foo[[/]]bar/];");
+
+ MT("indent_strange_array",
+ "[keyword var] [variable x] [operator =] [[",
+ " [number 1],,",
+ " [number 2],",
+ "]];",
+ "[number 10];");
+
+ MT("param_default",
+ "[keyword function] [variable foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
+ " [keyword return] [variable-2 x];",
+ "}");
+
+ var jsonld_mode = CodeMirror.getMode(
+ {indentUnit: 2},
+ {name: "javascript", jsonld: true}
+ );
+ function LD(name) {
+ test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1));
+ }
+
+ LD("json_ld_keywords",
+ '{',
+ ' [meta "@context"]: {',
+ ' [meta "@base"]: [string "http://example.com"],',
+ ' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],',
+ ' [property "likesFlavor"]: {',
+ ' [meta "@container"]: [meta "@list"]',
+ ' [meta "@reverse"]: [string "@beFavoriteOf"]',
+ ' },',
+ ' [property "nick"]: { [meta "@container"]: [meta "@set"] },',
+ ' [property "nick"]: { [meta "@container"]: [meta "@index"] }',
+ ' },',
+ ' [meta "@graph"]: [[ {',
+ ' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],',
+ ' [property "name"]: [string "John Lennon"],',
+ ' [property "modified"]: {',
+ ' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],',
+ ' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]',
+ ' }',
+ ' } ]]',
+ '}');
+
+ LD("json_ld_fake",
+ '{',
+ ' [property "@fake"]: [string "@fake"],',
+ ' [property "@contextual"]: [string "@identifier"],',
+ ' [property "user@domain.com"]: [string "@graphical"],',
+ ' [property "@ID"]: [string "@@ID"]',
+ '}');
+})();
src/node_modules/chroma-js/docs/libs/codemirror/mode/javascript/typescript.html
+<!doctype html>
+
+<title>CodeMirror: TypeScript mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="javascript.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">TypeScript</a>
+ </ul>
+</div>
+
+<article>
+<h2>TypeScript mode</h2>
+
+
+<div><textarea id="code" name="code">
+class Greeter {
+ greeting: string;
+ constructor (message: string) {
+ this.greeting = message;
+ }
+ greet() {
+ return "Hello, " + this.greeting;
+ }
+}
+
+var greeter = new Greeter("world");
+
+var button = document.createElement('button')
+button.innerText = "Say Hello"
+button.onclick = function() {
+ alert(greeter.greet())
+}
+
+document.body.appendChild(button)
+
+</textarea></div>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/typescript"
+ });
+ </script>
+
+ <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
+ </article>
src/node_modules/chroma-js/docs/libs/jquery/jquery-1.11.1.min.js
+/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;
+if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")
+},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
src/node_modules/chroma-js/docs/license.coffee
+###*
+ * @license
+ *
+ * chroma.js - JavaScript library for color conversions
+ *
+ * Copyright (c) 2011-2015, Gregor Aisch
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name Gregor Aisch may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+###
src/node_modules/chroma-js/docs/src/footer.inc.html
+<link rel="stylesheet" type="text/css" href="libs/codemirror/lib/codemirror.css">
+<script type="text/javascript" src="libs/jquery/jquery-1.11.1.min.js"></script>
+<script type="text/javascript" src="libs/chroma.min.js"></script>
+<script type="text/javascript" src="libs/codemirror/lib/codemirror.js"></script>
+<script type="text/javascript" src="libs/codemirror/mode/javascript/javascript.js"></script>
+
+<script type="text/javascript">
+
+(function($) {
+ $('code.lang-js').each(function() {
+
+ var code = this;
+
+ var cm = CodeMirror(function(elt) {
+ code.parentNode.replaceChild(elt, code);
+ }, {
+ value: code.innerHTML.trim(),
+ indentUnit: 4,
+ mode: 'javascript'
+ });
+
+ cm.on('update', function(_cm, change) {
+ showColors(_cm);
+ });
+
+ var resDisplay = $('<div class="result-display" />')
+ .appendTo(cm.display.wrapper.parentNode);
+
+ showColors(cm);
+
+ function showColors(cm) {
+ $('.cm-string', cm.display.wrapper).each(styleSpan);
+ $('.cm-number', cm.display.wrapper).each(enableSlider);
+
+ // evaluate script
+ var src = cm.getDoc().getValue();
+ //resDisplay.html('');
+ try {
+
+ var s = src.split(';').map(eval);
+ resDisplay.html('<ol><li>'+s.map(resRec)
+ .filter(function(d) { return d !== undefined; })
+ .join('</li><li>')+'</li></ol>');
+
+ $('.cm-string', resDisplay).each(styleSpan);
+
+ } catch (e) {
+ // console.warn(e);
+ }
+
+ function resRec(d) {
+ if ($.isArray(d)) {
+ return '['+d.map(d.length > 2 ? resShort : resLong).join(',')+']';
+ }
+ return resLong(d);
+
+ function resLong(d) {
+ if (typeof d == 'boolean') {
+ return '<span class="cm-number">'+(d ? 'true' : 'false')+'</span>';
+
+ } else if (typeof d == 'string') {
+ // string color, e.g. hex value
+ return '<span class="cm-string">"'+d+'"</span>';
+ } else if (typeof d == 'object' && d._rgb) {
+ // chroma.js object
+ return '<span class="cm-string cm-color" data-color="'+d.css()+'">'+d.hex()+'</span>';
+ } else if ($.isNumeric(d)) {
+ return '<span class="cm-number">'+round(d,3)+'</span>';
+ } else if ($.isFunction(d)) {
+ var s = '';
+ var dom = d.domain ? d.domain() : [0,1],
+ dmin = Math.min(dom[0], dom[dom.length-1]),
+ dmax = Math.max(dom[dom.length-1], dom[0]);
+ for (var i=0;i<=100;i++) {
+ s += '<span class="grad-step" style="background-color:'+d(dmin + i/100 * (dmax - dmin))+'"></span>';
+ }
+ s += '<span class="domain-min">'+dmin+'</span>';
+ s += '<span class="domain-med">'+((dmin + dmax)*0.5)+'</span>';
+ s += '<span class="domain-max">'+dmax+'</span>';
+ return '<div class="gradient">'+s+'</div>';
+ }
+ }
+
+ function resShort(d) {
+ if (typeof d == 'string') {
+ // string color, e.g. hex value
+ return '<span class="cm-string cm-color cm-small" data-color="'+d+'"><span class="cm-hidden-text">\''+chroma(d).hex()+'\'</span></span>';
+ } else if (typeof d == 'object' && d._rgb) {
+ // chroma.js object
+ return '<span class="cm-string cm-color cm-small" data-color="'+d.css()+'"><span class="cm-hidden-text">\''+d.hex()+'\'</span></span>';
+ } else if ($.isNumeric(d)) {
+ return '<span class="cm-number">'+round(d,2)+'</span>';
+ } else if (isNaN(d)) {
+ return '<span class="cm-number cm-nan">NaN</span>';
+ }
+ }
+
+ function round(d, p) {
+ var n = Math.pow(10, p);
+ return Math.round(d*n) / n;
+ }
+ }
+ }
+
+ function styleSpan() {
+ var span = $(this);
+ //setTimeout(function() {
+ val = span.data('color') || span.html().replace(/['"]/g, '').trim();
+ if (chroma[val]) {
+ span.attr('style', '');
+ return;
+ }
+
+ try {
+ var col = chroma(val),
+ l = col.luminance();
+ span.attr('style', [
+ 'background-color:'+col.hex(),
+ 'color:'+(l <0.5 ? 'white' : 'black'),
+ 'opacity:'+col.alpha()
+ ].join(';'));
+ } catch (e) {
+ //console.log(e);
+ span.attr('style', '');
+ // not a color, so ignore
+ }
+ //}, 50);
+ }
+
+ function enableSlider() {
+ return;
+ var span = $(this),
+ slider = $('<div></div>').addClass('slider'),
+ input = $('<input type="range" />').appendTo(slider);
+
+ span.off('mouseenter').on('mouseenter', function() {
+ var v = +span.text(),
+ d = Math.pow(10, Math.max(1, Math.log10(v))),
+ min = v - d,
+ max = v + d;
+ input.attr({ min: min, max: max })
+ .prop('value', v);
+ console.log('span', v);
+
+ span.append(slider);
+ });
+ span.off('mouseleave').on('mouseleave', function() {
+ //slider.remove();
+ });
+ }
+
+ });
+
+ var toc = $('<ul />')
+ .addClass('toc')
+ .appendTo(
+ $('<div>')
+ .addClass('toc-container')
+ .appendTo('.wrap')
+ );
+
+ var hue = Math.random() * 360;
+ $('h2,h3').each(function() {
+ var h = $(this),
+ l = h.attr('id'),
+ t = h.is('h2');
+ toc.append('<li class="'+('level-'+(t ? '1' : '2'))+'"><a style="color:'+chroma.lch(50,80,hue)+'" href="#'+l+'">' + h.text() +'</a></li>');
+ hue = (hue + 20) % 360;
+ var a = $('<a />')
+ .attr('href', '#'+l)
+ .html(h.html());
+ h.html('').append(a);
+ });
+
+ $('h3+h4').each(function(i,el) { el.previousElementSibling.appendChild(el); });
+
+})(jQuery);
+</script>
+<a href="https://github.com/gka/chroma.js" class="github-corner"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#64CEAA; color:#fff; position: absolute; top: 0; border: 0; right: 0;"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>
+<style>
+ .github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}
+ @keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}
+</style>
src/node_modules/chroma-js/docs/src/index.css
+@import 'https://fonts.googleapis.com/css?family=Roboto:100,300,400,700';
+
+body {
+ font-family: -apple-system, BlinkMacSystemFont, 'Roboto', "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
+}
+
+.wrap {
+ max-width: 1000px;
+ margin: 0 auto;
+}
+
+.wrap > h1, .wrap > h2, .wrap > h3, .wrap > h4, .wrap > p, .wrap > pre, .wrap > ul {
+ position: relative;
+ /*left: -80px;*/
+ padding-left: 300px;
+}
+
+.wrap > h2,
+.wrap > h3 {
+ padding-top: 10px;
+}
+
+.wrap > h2 a,
+.wrap > h3 a {
+ color: #000;
+ text-decoration: none;
+}
+
+.wrap > h2 a:hover:before,
+.wrap > h3 a:hover:before {
+ content: '#';
+ color: #ddd;
+ position: absolute;
+ left: 280px;
+}
+
+.wrap > ul {
+ margin-left: 30px;
+}
+
+.wrap > p {
+ margin-right: 200px;
+}
+
+
+ul.toc {
+ position: absolute;
+ top: 90px;
+ width: 200px;
+ list-style: none;
+}
+
+
+.toc li a {
+ text-decoration: none;
+ margin-bottom: 5px;
+ font-size: 13px;
+ border-bottom: 1px dotted white;
+ padding-bottom: 5px;
+ display: block;
+ position: relative;
+}
+
+.toc li.level-1 a {
+ margin-top: 15px;
+ font-weight: bold;
+ font-size: 17px;
+}
+
+.toc li.level-2 a {
+ padding-left: 20px;
+ font-size: 15px;
+}
+
+
+.toc li.level-2 a:before {
+ position: absolute;
+ left: 5px;
+ top: -2px;
+ font-size: 18px;
+ opacity: 0.3;
+ content: '•';
+}
+
+
+.wrap > h1 {
+ font-weight: 100;
+ font-size: 48px;
+ letter-spacing: -2px;
+}
+
+.wrap > h2 {
+ padding-top: 30px;
+ margin-top: 20px;
+}
+
+.wrap > h3 h4 {
+ font-weight: 400;
+ display: inline-block;
+ color: #999;
+ margin: 0 0 0 3px;
+}
+
+.wrap p code, .wrap li code {
+ font-size: 15px;
+ margin-left: 2px;
+ margin-right: 2px;
+ color: #069;
+}
+
+html .cm-s-default .cm-comment {
+ color: #B3A9A9;
+ font-style: italic;
+}
+
+pre {
+ position: relative;
+ margin-top: 30px;
+ margin-bottom: 30px;
+}
+
+pre .CodeMirror {
+ height: auto;
+ font-size: 16px;
+ line-height: 22px;
+ background: #f9f9f9;
+ box-shadow: inset 2px 2px 6px rgba(0,0,0,.1);
+ border-radius: 10px;
+ margin: -5px;
+ padding: 5px;
+ margin-right: 200px;
+ margin-bottom: 20px;
+}
+
+
+pre .CodeMirror:hover, pre .CodeMirror:focus {
+ background: #f6f6f0;
+}
+
+.result-display {
+ position: absolute;
+ right: 0px;
+ top: 4px;
+ width: 180px;
+ white-space: normal;
+ line-height: 22px;
+}
+
+.result-display .cm-string {
+ padding: 0px 4px;
+ display: inline-block;
+ min-width: 13px;
+ min-height: 13px;
+ border-radius: 3px;
+ box-sizing: border-box;
+ position: relative;
+ vertical-align: middle;
+ margin-left: 2px;
+ margin-bottom: 2px;
+ position: relative;
+ top: 1px;
+}
+
+.result-display .cm-string:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ background-image: url(../assets/bg.png);
+ opacity: 0.99;
+ z-index: -10;
+}
+.result-display li {
+ line-height: 24px;
+}
+.result-display .cm-number {
+ color: #164;
+}
+
+.CodeMirror, .CodeMirror .CodeMirror-scroll {
+ overflow: visible!important;
+}
+
+.CodeMirror .cm-number {
+ position: relative;
+}
+
+.CodeMirror .cm-number .slider {
+ position: absolute;
+ left: 50%;
+ top: -15px;
+}
+.CodeMirror .cm-number .slider input[type="range"] {
+ position: absolute;
+ left: -50px;
+ top: 0px;
+ width: 100px;
+}
+
+
+.result-display .cm-nan {
+ color: #614;
+}
+
+.result-display ol {
+ padding: 0;
+ margin: 0;
+ counter-reset: commands;
+}
+
+
+.result-display ol li {
+ list-style-position: inside;
+ list-style: none;
+ position: relative;
+}
+
+.result-display ol li:before {
+ content: '';
+ counter-increment: commands;
+ padding-right: 0px;
+ position: absolute;
+ left: -10px;
+ top: 2px;
+ color: #bbb;
+}
+
+.result-display:before {
+ content: "RESULT";
+ position: absolute;
+ left: 0;
+ top: -25px;
+ font-size: 11px;
+ color: #ccc;
+}
+
+.gradient {
+ width: 85%;
+ white-space: nowrap;
+ position: relative;
+ display: inline-block;
+ top: 4px;
+ padding-bottom: 15px;
+}
+
+
+.gradient .domain-min {
+ position: absolute;
+ left: 0;
+ font-size: 11px;
+ bottom: 3px;
+}
+.gradient .domain-med {
+ position: absolute;
+ right: 25%;
+ left: 25%;
+ text-align: center;
+ font-size: 11px;
+ bottom: 3px;
+}
+.gradient .domain-max {
+ position: absolute;
+ right: 0;
+ font-size: 11px;
+ bottom: 3px;
+}
+
+
+.grad-step {
+ display: inline-block;
+ height: 20px;
+ width: 1%;
+}
+
+.cm-small {
+ height: 15px;
+ width: 15px;
+}
+
+.cm-hidden-text {
+ display:inline-block;
+ width:1px;
+ // height:0px;
+ opacity: 0;
+ overflow:hidden;
+}
src/node_modules/chroma-js/docs/src/index.md
+# chroma.js
+
+**chroma.js** is a tiny JavaScript library (14kB) for dealing with colors!
+
+[![Build Status](https://travis-ci.org/gka/chroma.js.svg?branch=master)](https://travis-ci.org/gka/chroma.js)
+
+## Quick-start
+
+Here are a couple of things chroma.js can do for you:
+
+* read colors from a wide range of formats
+* analyze and manipulate colors
+* convert colors into wide range of formats
+* linear and bezier interpolation in different color spaces
+
+Here's an example for a simple read / manipulate / output chain:
+
+```js
+chroma('pink').darken().saturate(2).hex()
+```
+
+Aside from that, chroma.js can also help you **generate nice colors** using various methods, for instance to be [used](https://www.vis4.net/blog/posts/avoid-equidistant-hsv-colors/) in color palette for maps or data visualization.
+
+```js
+chroma.scale(['#fafa6e','#2A4858'])
+ .mode('lch').colors(6)
+```
+
+chroma.js has a lot more to offer, but that's the gist of it.
+
+## API
+
+### chroma
+#### (*color*)
+
+The first step is to get your color into chroma.js. That's what the generic constructor ``chroma()`` does. The function is trying to guess the color format for you. For instances, it will recognized any named color from the W3CX11 specification:
+
+```js
+chroma('hotpink')
+```
+
+If there's no matching named color chroma.js checks for a **hexadecimal string**. It ignores case, the `#` sign is optional, and the shorter three letter format is recognized as well. So any of these are valid hexadecimal representations: `#ff3399`, `FF3399`, `#f39`, etc.
+
+```js
+chroma('#ff3399');
+chroma('F39');
+```
+
+In addition to hex strings, **hexadecimal numbers** (in fact, just any number between `0` and `16777215`), will be recognized, too.
+
+```js
+chroma(0xff3399)
+```
+
+If you pass the RGB channels individually, too. Each parameter must be within `0..255`. You can pass the numbers as individual arguments or as array.
+
+```js
+chroma(0xff, 0x33, 0x99);
+chroma(255, 51, 153);
+chroma([255, 51, 153]);
+```
+
+You can construct colors from different color spaces by passing the name of color space as the last argument. Here we define the same color in HSL by passing the h*ue angle (0-360) and percentages for *s*aturation and *l*ightness:
+
+```js
+chroma(330, 1, 0.6, 'hsl')
+```
+
+### chroma.hsl
+#### (hue, saturation, lightness)
+
+Alternatively, every color space has its own constructor function under the `chroma` namespace. For a list of all supported color spaces, check the [appendix](#supported-color-spaces-and-output-formats).
+
+```js
+chroma.hsl(330, 1, 0.6)
+```
+
+### chroma.hsv
+#### (hue, saturation, value)
+
+### chroma.lab
+#### (Lightness, a, b)
+
+### chroma.lch
+#### (Lightness, chroma, hue)
+
+The range for `lightness` and `chroma` depend on the hue, but go roughly from 0..100-150. The range for `hue` is 0..360.
+
+```js
+chroma.lch(80, 40, 130);
+chroma(80, 40, 130, 'lch');
+```
+
+### chroma.hcl
+#### (hue, chroma, lightness)
+
+You can use **hcl** instead of Lch. Lightness and hue channels are switched to be more consistent with HSL.
+
+```js
+chroma.hcl(130, 40, 80);
+chroma(130, 40, 80, 'hcl');
+```
+
+### chroma.cmyk
+#### (cyan, magenta, yellow, black)
+
+Each between 0 and 1.
+
+```js
+chroma.cmyk(0.2, 0.8, 0, 0);
+chroma(0.2, 0.8, 0, 0, 'cmyk');
+```
+
+### chroma.gl
+#### (red, green, blue, [alpha])
+
+**GL** is a variant of RGB(A), with the only difference that the components are normalized to the range of `0..1`.
+
+```js
+chroma.gl(0.6, 0, 0.8);
+chroma.gl(0.6, 0, 0.8, 0.5);
+chroma(0.6, 0, 0.8, 'gl');
+```
+
+### chroma.temperature
+#### (K)
+
+Returns a color from the [color temperature](http://www.zombieprototypes.com/?p=210) scale. Based on [Neil Bartlett's implementation](https://github.com/neilbartlett/color-temperature).
+
+```js
+chroma.temperature(2000); // candle light
+chroma.temperature(3500); // sunset
+chroma.temperature(6500); // daylight
+```
+
+The effective temperature range goes from `0` to about `30000` Kelvin,
+
+```js
+f = function(i) {
+ return chroma.temperature(i * 30000)
+}
+```
+
+### chroma.mix
+#### (color1, color2, ratio=0.5, mode='rgb')
+
+Mixes two colors. The mix *ratio* is a value between 0 and 1.
+
+```js
+chroma.mix('red', 'blue');
+chroma.mix('red', 'blue', 0.25);
+chroma.mix('red', 'blue', 0.75);
+```
+
+The color mixing produces different results based the color space used for interpolation.
+
+```js
+chroma.mix('red', 'blue', 0.5, 'rgb');
+chroma.mix('red', 'blue', 0.5, 'hsl');
+chroma.mix('red', 'blue', 0.5, 'lab');
+chroma.mix('red', 'blue', 0.5, 'lch');
+chroma.mix('red', 'blue', 0.5, 'lrgb');
+```
+
+
+### chroma.average
+#### (colors, mode='rgb')
+
+Similar to `chroma.mix`, but accepts more than two colors. Simple averaging of R,G,B components and the alpha channel.
+
+```js
+colors = ['#ddd', 'yellow', 'red', 'teal'];
+chroma.average(colors); // rgb
+chroma.average(colors, 'lab');
+chroma.average(colors, 'lch');
+chroma.average(colors, 'lrgb');
+```
+
+Also works with alpha channels.
+
+```js
+chroma.average(['red', 'rgba(0,0,0,0.5)']).css();
+```
+
+
+### chroma.blend
+#### (color1, color2, mode)
+
+Blends two colors using RGB channel-wise blend functions. Valid blend modes are `multiply`, `darken`, `lighten`, `screen`, `overlay`, `burn`, and `dodge`.
+
+```js
+chroma.blend('4CBBFC', 'EEEE22', 'multiply');
+chroma.blend('4CBBFC', 'EEEE22', 'darken');
+chroma.blend('4CBBFC', 'EEEE22', 'lighten');
+```
+
+### chroma.random
+#### ()
+
+Creates a random color by generating a [random hexadecimal string](https://github.com/gka/chroma.js/blob/master/src/generator/random.coffee#L3-L7).
+
+```js
+chroma.random();
+chroma.random();
+chroma.random();
+```
+
+### chroma.contrast
+#### (color1, color2)
+
+Computes the WCAG contrast ratio between two colors. A minimum contrast of 4.5:1 [is recommended](http://www.w3.org/TR/WCAG20-TECHS/G18.html) to ensure that text is still readable against a background color.
+
+```js
+// contrast smaller than 4.5 = too low
+chroma.contrast('pink', 'hotpink');
+// contrast greater than 4.5 = high enough
+chroma.contrast('pink', 'purple');
+```
+
+### chroma.distance
+#### (color1, color2, mode='lab')
+
+Computes the [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance#Three_dimensions) between two colors in a given color space (default is `Lab`).
+
+```js
+chroma.distance('#fff', '#ff0', 'rgb');
+chroma.distance('#fff', '#f0f', 'rgb');
+chroma.distance('#fff', '#ff0');
+chroma.distance('#fff', '#f0f');
+```
+
+### chroma.deltaE
+#### (reference, sample, L=1, C=1)
+
+Computes [color difference](https://en.wikipedia.org/wiki/Color_difference#CMC_l:c_.281984.29) as developed by the Colour Measurement Committee of the Society of Dyers and Colourists (CMC) in 1984. The implementation is adapted from [Bruce Lindbloom](https://web.archive.org/web/20160306044036/http://www.brucelindbloom.com/javascript/ColorDiff.js). The parameters L and C are weighting factors for lightness and chromaticity.
+
+```js
+chroma.deltaE('#ededee', '#edeeed');
+chroma.deltaE('#ececee', '#eceeec');
+chroma.deltaE('#e9e9ee', '#e9eee9');
+chroma.deltaE('#e4e4ee', '#e4eee4');
+chroma.deltaE('#e0e0ee', '#e0eee0');
+
+```
+
+### chroma.brewer
+
+chroma.brewer is an map of ColorBrewer scales that are included in chroma.js for convenience. chroma.scale uses the colors to construct.
+
+```js
+chroma.brewer.OrRd
+```
+
+### chroma.limits
+#### (data, mode, n)
+
+A helper function that computes class breaks for you, based on data. It supports the modes _equidistant_ (e), _quantile_ (q), _logarithmic_ (l), and _k-means_ (k). Let's take a few numbers as sample data.
+
+```js
+var data = [2.0,3.5,3.6,3.8,3.8,4.1,4.3,4.4,
+ 4.6,4.9,5.2,5.3,5.4,5.7,5.8,5.9,
+ 6.2,6.5,6.8,7.2,8];
+```
+
+**equidistant** breaks are computed by dividing the total range of the data into _n_ groups of equal size.
+
+```js
+chroma.limits(data, 'e', 4);
+```
+
+In the **quantile** mode, the input domain is divided by quantile ranges.
+
+```js
+chroma.limits(data, 'q', 4);
+```
+
+**logarithmic** breaks are equidistant breaks but on a logarithmic scale.
+
+```js
+chroma.limits(data, 'l', 4);
+```
+
+**k-means** break is using the 1-dimensional [k-means clustering](https://en.wikipedia.org/wiki/K-means_clustering) algorithm to find (roughly) _n_ groups of "similar" values. Note that this k-means implementation does not guarantee to find exactly _n_ groups.
+
+```js
+chroma.limits(data, 'k', 4);
+```
+
+## color
+
+### color.alpha
+#### (a)
+
+Get and set the color opacity using ``color.alpha``.
+
+```js
+chroma('red').alpha(0.5);
+chroma('rgba(255,0,0,0.35)').alpha();
+```
+
+### color.darken
+#### (value=1)
+
+Once loaded, chroma.js can change colors. One way we already saw above, you can change the lightness.
+
+```js
+chroma('hotpink').darken();
+chroma('hotpink').darken(2);
+chroma('hotpink').darken(2.6);
+```
+
+### color.brighten
+#### (value=1)
+
+Similar to `darken`, but the opposite direction
+
+```js
+chroma('hotpink').brighten();
+chroma('hotpink').brighten(2);
+chroma('hotpink').brighten(3);
+```
+
+### color.saturate
+#### (value=1)
+
+Changes the saturation of a color by manipulating the Lch chromaticity.
+
+```js
+chroma('slategray').saturate();
+chroma('slategray').saturate(2);
+chroma('slategray').saturate(3);
+```
+
+### color.desaturate
+#### (value=1)
+
+Similar to `saturate`, but the opposite direction.
+
+```js
+chroma('hotpink').desaturate();
+chroma('hotpink').desaturate(2);
+chroma('hotpink').desaturate(3);
+```
+
+
+### color.set
+#### (channel, value)
+
+Changes a single channel and returns the result a new `chroma` object.
+
+```js
+// change hue to 0 deg (=red)
+chroma('skyblue').set('hsl.h', 0);
+// set chromaticity to 30
+chroma('hotpink').set('lch.c', 30);
+```
+
+Relative changes work, too:
+
+```js
+// half Lab lightness
+chroma('orangered').set('lab.l', '*0.5');
+// double Lch saturation
+chroma('darkseagreen').set('lch.c', '*2');
+```
+
+### color.get
+#### (channel)
+
+Returns a single channel value.
+
+```js
+chroma('orangered').get('lab.l');
+chroma('orangered').get('hsl.l');
+chroma('orangered').get('rgb.g');
+```
+
+### color.luminance
+#### ([lum, mode='rgb'])
+
+If called without arguments color.luminance returns the relative brightness, according to the [WCAG definition](http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef). Normalized to `0` for darkest black and `1` for lightest white.
+
+```js
+chroma('white').luminance();
+chroma('aquamarine').luminance();
+chroma('hotpink').luminance();
+chroma('darkslateblue').luminance();
+chroma('black').luminance();
+```
+
+chroma.js also allows you to **adjust the luminance** of a color. The source color will be interpolated with black or white until the correct luminance is found.
+
+```js
+// set lumincance to 50% for all colors
+chroma('white').luminance(0.5);
+chroma('aquamarine').luminance(0.5);
+chroma('hotpink').luminance(0.5);
+chroma('darkslateblue').luminance(0.5);
+```
+
+By default, this interpolation is done in RGB, but you can interpolate in different color spaces by passing them as second argument:
+
+```js
+chroma('aquamarine').luminance(0.5); // rgb
+chroma('aquamarine').luminance(0.5, 'lab');
+chroma('aquamarine').luminance(0.5, 'hsl');
+```
+
+### color.hex
+#### (mode='auto|rgb|rgba')
+
+Finally, chroma.js allows you to output colors in various color spaces and formats. Most often you will want to output the color as hexadecimal string.
+
+```js
+chroma('orange').hex()
+```
+
+**Note** that as of version 1.4.0 the default mode is "auto" which means that the hex string will include the alpha channel if it's less than 1. If you don't want the alpha channel to be included you must explicitly set the mode to "rgb" now:
+
+```js
+chroma('orange').hex();
+chroma('orange').alpha(0.5).hex();
+chroma('orange').alpha(0.5).hex('rgb');
+```
+
+### color.name
+
+Returns the named color. Falls back to hexadecimal RGB string, if the color isn't present.
+
+```js
+chroma('#ffa500').name();
+chroma('#ffa505').name();
+```
+
+### color.css
+
+Returns a `RGB()` or `HSL()` string representation that can be used as CSS-color definition.
+
+```js
+chroma('teal').css();
+chroma('teal').alpha(0.5).css();
+chroma('teal').css('hsl');
+```
+
+### color.rgb
+#### (round=true)
+
+Returns an array with the `red`, `green`, and `blue` component, each as number within the range `0..255`. Chroma internally stores RGB channels as floats but rounds the numbers before returning them. You can pass `false` to prevent the rounding.
+
+```js
+chroma('orange').rgb();
+chroma('orange').darken().rgb();
+chroma('orange').darken().rgb(false);
+```
+
+### color.rgba
+#### (round=true)
+
+Just like `color.rgb` but adds the alpha channel to the returned array.
+
+```js
+chroma('orange').rgba();
+chroma('hsla(20, 100%, 40%, 0.5)').rgba();
+```
+
+### color.hsl
+
+Returns an array with the `hue`, `saturation`, and `lightness` component. Hue is the color angle in degree (`0..360`), saturation and lightness are within `0..1`. Note that for hue-less colors (black, white, and grays), the hue component will be NaN.
+
+```js
+chroma('orange').hsl();
+chroma('white').hsl();
+```
+
+### color.hsv
+
+Returns an array with the `hue`, `saturation`, and `value` components. Hue is the color angle in degree (`0..360`), saturation and value are within `0..1`. Note that for hue-less colors (black, white, and grays), the hue component will be NaN.
+
+```js
+chroma('orange').hsv();
+chroma('white').hsv();
+```
+
+### color.hsi
+
+Returns an array with the `hue`, `saturation`, and `intensity` components, each as number between 0 and 255. Note that for hue-less colors (black, white, and grays), the hue component will be NaN.
+
+```js
+chroma('orange').hsi();
+chroma('white').hsi();
+```
+
+### color.lab
+
+Returns an array with the **L**, **a**, and **b** components.
+
+```js
+chroma('orange').lab()
+```
+
+
+### color.lch
+
+Returns an array with the **Lightness**, **chroma**, and **hue** components.
+
+```js
+chroma('skyblue').lch()
+```
+
+### color.hcl
+
+Alias of [lch](#color-lch), but with the components in reverse order.
+
+```js
+chroma('skyblue').hcl()
+```
+
+### color.num
+
+Returns the numeric representation of the hexadecimal RGB color.
+
+```js
+chroma('#000000').num();
+chroma('#0000ff').num();
+chroma('#00ff00').num();
+chroma('#ff0000').num();
+```
+
+### color.temperature
+
+Estimate the temperature in Kelvin of any given color, though this makes the only sense for colors from the [temperature gradient](#chroma-temperature) above.
+
+```js
+chroma('#ff3300').temperature();
+chroma('#ff8a13').temperature();
+chroma('#ffe3cd').temperature();
+chroma('#cbdbff').temperature();
+chroma('#b3ccff').temperature();
+```
+
+
+### color.gl
+
+Like RGB, but in the channel range of `[0..1]` instead of `[0..255]`
+
+```js
+chroma('33cc00').gl();
+```
+
+### color.clipped
+
+When converting colors from CIELab color spaces to RGB the color channels get clipped to the range of `[0..255]`. Colors outside that range may exist in nature but are not displayable on RGB monitors (such as ultraviolet). you can use color.clipped to test if a color has been clipped or not.
+
+```js
+[c = chroma.hcl(50, 40, 20), c.clipped()];
+[c = chroma.hcl(50, 40, 40), c.clipped()];
+[c = chroma.hcl(50, 40, 60), c.clipped()];
+[c = chroma.hcl(50, 40, 80), c.clipped()];
+[c = chroma.hcl(50, 40, 100), c.clipped()];
+```
+
+As a bonus feature you can access the unclipped RGB components using `color._rgb._unclipped`.
+
+```js
+chroma.hcl(50, 40, 100).rgb();
+chroma.hcl(50, 40, 100)._rgb._unclipped;
+```
+
+## color scales
+
+### chroma.scale
+#### (colors=['white','black'])
+
+A color scale, created with `chroma.scale`, is a function that maps numeric values to a color palette. The default scale has the domain `0..1` and goes from white to black.
+
+```js
+f = chroma.scale();
+f(0.25);
+f(0.5);
+f(0.75);
+```
+
+You can pass an array of colors to `chroma.scale`. Any color that can be read by `chroma()` will work here, too. If you pass more than two colors, they will be evenly distributed along the gradient.
+
+
+```js
+chroma.scale(['yellow', '008ae5']);
+chroma.scale(['yellow', 'red', 'black']);
+```
+
+### scale.domain
+#### (domain)
+
+You can change the input domain to match your specific use case.
+
+```js
+// default domain is [0,1]
+chroma.scale(['yellow', '008ae5']);
+// set domain to [0,100]
+chroma.scale(['yellow', '008ae5']).domain([0,100]);
+```
+
+You can use the domain to set the exact positions of each color.
+
+```js
+// default domain is [0,1]
+chroma.scale(['yellow', 'lightgreen', '008ae5'])
+ .domain([0,0.25,1]);
+```
+
+
+### scale.mode
+#### (mode)
+
+As with `chroma.mix`, the result of the color interpolation will depend on the color mode in which the channels are interpolated. The default mode is `RGB`:
+
+```js
+chroma.scale(['yellow', '008ae5']);
+```
+
+This is often fine, but sometimes, two-color `RGB` gradients goes through kind of grayish colors, and `Lab` interpolation produces better results:
+
+```js
+chroma.scale(['yellow', 'navy']);
+chroma.scale(['yellow', 'navy']).mode('lab');
+```
+
+Also note how the RGB interpolation can get very dark around the center. You can achieve better results using [linear RGB interpolation](https://www.youtube.com/watch?v=LKnqECcg6Gw):
+
+```js
+chroma.scale(['#f00', '#0f0']);
+chroma.scale(['#f00', '#0f0']).mode('lrgb');
+```
+
+Other useful interpolation modes could be `HSL` or `Lch`, though both tend to produce too saturated / glowing gradients.
+
+```js
+chroma.scale(['yellow', 'navy']).mode('lab');
+chroma.scale(['yellow', 'navy']).mode('hsl');
+chroma.scale(['yellow', 'navy']).mode('lch');
+```
+
+### scale.gamma
+
+Gamma-correction can be used to "shift" a scale's center more the the beginning (gamma < 1) or end (gamma > 1), typically used to "even" the lightness gradient. Default is 1.
+
+```js
+chroma.scale('YlGn').gamma(0.5);
+chroma.scale('YlGn').gamma(1);
+chroma.scale('YlGn').gamma(2);
+```
+
+### scale.correctLightness
+
+This makes sure the lightness range is spread evenly across a color scale. Especially useful when working with [multi-hue color scales](https://www.vis4.net/blog/2013/09/mastering-multi-hued-color-scales/), where simple gamma correction can't help you very much.
+
+```js
+chroma.scale(['black','red','yellow','white']);
+
+chroma.scale(['black','red','yellow','white'])
+ .correctLightness();
+```
+
+### scale.cache
+#### (true|false)
+
+By default `chroma.scale` instances will cache each computed value => color pair. You can turn off the cache by setting
+
+```js
+chroma.scale(['yellow', '008ae5']).cache(false);
+```
+
+### scale.padding
+#### (pad)
+
+Reduces the color range by cutting of a fraction of the gradient on both sides. If you pass a single number, the same padding will be applied to both ends.
+
+```js
+chroma.scale('RdYlBu');
+chroma.scale('RdYlBu').padding(0.15);
+chroma.scale('RdYlBu').padding(0.3);
+chroma.scale('RdYlBu').padding(-0.15);
+```
+
+Alternatively you can specify the padding for each sides individually by passing an array of two numbers.
+
+```js
+chroma.scale('OrRd');
+chroma.scale('OrRd').padding([0.2, 0]);
+```
+
+
+### scale.colors
+#### (num, format='hex')
+
+You can call `scale.colors(n)` to quickly grab `n` equi-distant colors from a color scale. If called with no arguments, `scale.colors` returns the original array of colors used to create the scale.
+
+```js
+chroma.scale('OrRd').colors(5);
+chroma.scale(['white', 'black']).colors(12);
+```
+
+If you want to return `chroma` instances just pass *null* as `format`.
+
+### scale.classes
+#### (numOrArray)
+
+If you want the scale function to return a distinct set of colors instead of a continuous gradient, you can use `scale.classes`. If you pass a number the scale will broken into equi-distant classes:
+
+```js
+// continuous
+chroma.scale('OrRd');
+// class breaks
+chroma.scale('OrRd').classes(5);
+chroma.scale('OrRd').classes(8);
+```
+
+You can also define custom class breaks by passing them as array:
+
+```js
+chroma.scale('OrRd').classes([0,0.3,0.55,0.85,1]);
+```
+
+
+### chroma.brewer
+
+chroma.js includes the definitions from [ColorBrewer2.org](http://colorbrewer2.org/). Read more about these colors [in the corresponding paper](http://www.albany.edu/faculty/fboscoe/papers/harrower2003.pdf) by Mark Harrower and Cynthia A. Brewer.
+
+```js
+chroma.scale('YlGnBu');
+chroma.scale('Spectral');
+```
+
+To reverse the colors you could simply reverse the domain:
+
+```js
+chroma.scale('Spectral').domain([1,0]);
+```
+
+You can access the colors directly using `chroma.brewer`.
+
+```js
+chroma.brewer.OrRd
+```
+
+### chroma.bezier
+#### (colors)
+
+`chroma.bezier` returns a function that [bezier-interpolates between colors](https://www.vis4.net/blog/posts/mastering-multi-hued-color-scales/) in `Lab` space. The input range of the function is `[0..1]`.
+
+```js
+// linear interpolation
+chroma.scale(['yellow', 'red', 'black']);
+// bezier interpolation
+chroma.bezier(['yellow', 'red', 'black']);
+```
+
+You can convert an bezier interpolator into a chroma.scale instance
+
+```js
+chroma.bezier(['yellow', 'red', 'black'])
+ .scale()
+ .colors(5);
+```
+
+## cubehelix
+### chroma.cubehelix
+#### (start=300, rotations=-1.5, hue=1, gamma=1, lightness=[0,1])
+
+Dave Green's [cubehelix color scheme](http://www.mrao.cam.ac.uk/~dag/CUBEHELIX/)!!
+
+
+```js
+// use the default helix...
+chroma.cubehelix();
+// or customize it
+chroma.cubehelix()
+ .start(200)
+ .rotations(-0.5)
+ .gamma(0.8)
+ .lightness([0.3, 0.8]);
+```
+
+### cubehelix.start
+#### (hue)
+
+**start** color for [hue rotation](http://en.wikipedia.org/wiki/Hue#/media/File:HueScale.svg), default=`300`
+
+```js
+chroma.cubehelix().start(300);
+chroma.cubehelix().start(200);
+```
+
+### cubehelix.rotations
+#### (num)
+
+number (and direction) of hue rotations (e.g. 1=`360°`, 1.5=`540°``), default=-1.5
+
+```js
+chroma.cubehelix().rotations(-1.5);
+chroma.cubehelix().rotations(0.5);
+chroma.cubehelix().rotations(3);
+```
+
+### cubehelix.hue
+#### (numOrRange)
+
+hue controls how saturated the colour of all hues are. either single value or range, default=1
+
+```js
+chroma.cubehelix();
+chroma.cubehelix().hue(0.5);
+chroma.cubehelix().hue([1,0]);
+```
+
+### cubehelix.gamma
+#### (factor)
+
+gamma factor can be used to emphasise low or high intensity values, default=1
+
+```js
+chroma.cubehelix().gamma(1);
+chroma.cubehelix().gamma(0.5);
+```
+
+### cubehelix.lightness
+#### (range)
+
+lightness range: default: [0,1] (black -> white)
+
+```js
+chroma.cubehelix().lightness([0,1]);
+chroma.cubehelix().lightness([1,0]);
+chroma.cubehelix().lightness([0.3,0.7]);
+```
+
+
+### cubehelix.scale
+
+You can call `cubehelix.scale()` to use the cube-helix through the `chroma.scale` interface.
+
+```js
+chroma.cubehelix()
+ .start(200)
+ .rotations(-0.35)
+ .gamma(0.7)
+ .lightness([0.3, 0.8])
+ .scale() // convert to chroma.scale
+ .correctLightness()
+ .colors(5);
+```
+
+
+
src/node_modules/chroma-js/license.coffee
+###*
+ * @license
+ *
+ * chroma.js - JavaScript library for color conversions
+ *
+ * Copyright (c) 2011-2017, Gregor Aisch
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name Gregor Aisch may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+###
src/node_modules/chroma-js/package.json
+{
+ "_from": "chroma-js",
+ "_id": "chroma-js@1.4.0",
+ "_inBundle": false,
+ "_integrity": "sha512-5vBYGJkhSnK2SRZ0XkxwTL+TSRyP7PHIxjeg+1uce5qpNDRLLwAXcF12kIztas/BYakWPQhchzV4TKkiwKNd8Q==",
+ "_location": "/chroma-js",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "tag",
+ "registry": true,
+ "raw": "chroma-js",
+ "name": "chroma-js",
+ "escapedName": "chroma-js",
+ "rawSpec": "",
+ "saveSpec": null,
+ "fetchSpec": "latest"
+ },
+ "_requiredBy": [
+ "#USER",
+ "/"
+ ],
+ "_resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-1.4.0.tgz",
+ "_shasum": "695c52e7c97617e5f687db31913503d410481ae4",
+ "_spec": "chroma-js",
+ "_where": "/home/jarvisd/play/clothing/palette/src",
+ "author": {
+ "name": "Gregor Aisch"
+ },
+ "bugs": {
+ "url": "https://github.com/gka/chroma.js/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "JavaScript library for color conversions",
+ "devDependencies": {
+ "catty": "github:gka/catty#coffeescript",
+ "coffee-script": "1.9.2",
+ "es6-shim": "^0.18.0",
+ "grunt": "^0.4.5",
+ "grunt-contrib-clean": "^0.6.0",
+ "grunt-contrib-coffee": "^0.13.0",
+ "grunt-contrib-copy": "^1.0.0",
+ "grunt-contrib-uglify": "^0.9.1",
+ "grunt-replace": "^0.9.2",
+ "minimatch": "^3.0.2",
+ "uglify-js": "2.x",
+ "vows": "0.8.x"
+ },
+ "homepage": "https://github.com/gka/chroma.js",
+ "keywords": [
+ "color"
+ ],
+ "main": "chroma.js",
+ "maintainers": [
+ {
+ "name": "Klemen Slavič",
+ "email": "klemen@celtra.com",
+ "url": "http://about.me/klemen.slavic"
+ },
+ {
+ "name": "Gregor Aisch",
+ "email": "mail@driven-by-data.net",
+ "url": "http://driven-by-data.net"
+ }
+ ],
+ "name": "chroma-js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/gka/chroma.js.git"
+ },
+ "scripts": {
+ "build": "grunt",
+ "test": "./node_modules/vows/bin/vows --dot-matrix"
+ },
+ "spm": {
+ "main": "chroma.js",
+ "ignore": [
+ "src",
+ "doc",
+ "test"
+ ]
+ },
+ "version": "1.4.0"
+}
src/node_modules/chroma-js/readme.md
+# Chroma.js
+
+[Chroma.js](https://gka.github.io/chroma.js/) is a tiny JavaScript library (14kB) for all kinds of color conversions and color scales.
+
+[![Build Status](https://travis-ci.org/gka/chroma.js.svg?branch=master)](https://travis-ci.org/gka/chroma.js)
+
+### Usage
+
+
+Initiate and manipulate colors:
+
+```javascript
+chroma('#D4F880').darken().hex(); // #9BC04B
+```
+
+Working with color scales is easy, too:
+
+```javascript
+scale = chroma.scale(['white', 'red']);
+scale(0.5).hex(); // #FF7F7F
+```
+
+Lab/Lch interpolation looks better than RGB
+
+```javascript
+chroma.scale(['white', 'red']).mode('lab');
+```
+
+Custom domains! Quantiles! Color Brewer!!
+
+```javascript
+chroma.scale('RdYlBu').domain(myValues, 7, 'quantiles');
+```
+
+And why not use logarithmic color scales once in your life?
+
+```javascript
+chroma.scale(['lightyellow', 'navy']).domain([1, 100000], 7, 'log');
+```
+
+### Like it?
+
+Why not dive into the [interactive documentation](http://gka.github.io/chroma.js/) (there's a [static version](https://github.com/gka/chroma.js/blob/master/docs/src/index.md), too). You can download [chroma.min.js](https://raw.github.com/gka/chroma.js/master/chroma.min.js) or use the [hosted version on cdnjs.com](https://cdnjs.com/libraries/chroma-js).
+
+You can use it in node.js, too!
+
+ npm install chroma-js
+
+Or you can use it in SASS using [chromatic-sass](https://github.com/bugsnag/chromatic-sass)!
+
+### Build instructions
+
+To compile the coffee-script source files you have to run (might have to `npm install` first)
+
+ grunt
+
+To run the tests simply run
+
+ npm test
+
+And to update the documentation (thanks!), just do
+
+ npm install --global markdown-to-html http-server
+ cd docs/
+ make && make preview
+
+### Similar Libraries / Prior Art
+
+* [Chromatist](https://github.com/jrus/chromatist)
+* [GrapeFruit](https://github.com/xav/Grapefruit) (Python)
+* [colors.py](https://github.com/mattrobenolt/colors.py) (Python)
+* [d3.js](https://github.com/mbostock/d3)
+
+
+### Author
+
+Chroma.js is written by [Gregor Aisch](http://driven-by-data.net).
+
+### License
+
+Released under [BSD license](http://opensource.org/licenses/BSD-3-Clause).
+Versions prior to 0.4 were released under [GPL](http://www.gnu.org/licenses/gpl-3.0).
+
+### Further reading
+
+* [How To Avoid Equidistant HSV Colors](https://vis4.net/blog/posts/avoid-equidistant-hsv-colors/)
+* [Mastering Multi-hued Color Scales with Chroma.js](https://vis4.net/blog/posts/mastering-multi-hued-color-scales/)
+
+### FAQ
+
+**There have been no commits in X weeks. Is chroma.js dead?**
+
+No! It's just that the author of this library has other things to do than devoting every week of his life to making cosmetic changes to a piece of software that is working just fine as it is, just so that people like you don't feel like it's abandoned and left alone in this world to die. Bugs will be fixed. Some new things will come at some point. Patience.
src/node_modules/chroma-js/src/analyze.coffee
+
+chroma.analyze = (data) ->
+ r =
+ min: Number.MAX_VALUE
+ max: Number.MAX_VALUE*-1
+ sum: 0
+ values: []
+ count: 0
+
+ for val in data
+ if val? and not isNaN val
+ r.values.push val
+ r.sum += val
+ r.min = val if val < r.min
+ r.max = val if val > r.max
+ r.count += 1
+
+ r.domain = [r.min, r.max]
+
+ r.limits = (mode, num) ->
+ chroma.limits r, mode, num
+
+ r
+
src/node_modules/chroma-js/src/api.coffee
+chroma = () ->
+ return arguments[0] if arguments[0] instanceof Color
+ new Color arguments...
+chroma.default = chroma
+
+_interpolators = []
+
+# CommonJS module is defined
+module.exports = chroma if module? and module.exports?
+
+if typeof define == 'function' and define.amd
+ define [], () -> chroma
+else
+ root = (exports ? this)
+ root.chroma = chroma
+
+
+chroma.version = '@@version'
+
+# exposing raw classes for testing purposes
+
src/node_modules/chroma-js/src/color.coffee
+# @require utils api
+
+_input = {}
+_guess_formats = []
+_guess_formats_sorted = false
+
+class Color
+
+ constructor: () ->
+ me = @
+
+ args = []
+ for arg in arguments
+ args.push arg if arg?
+
+ # last argument could be the mode
+ mode = args[args.length-1] if args.length > 1
+
+ if _input[mode]?
+ me._rgb = clip_rgb _input[mode] unpack args[...-1]
+ else
+ # sort input type guess by desc priotity
+ if not _guess_formats_sorted
+ _guess_formats = _guess_formats.sort (a,b) ->
+ b.p - a.p
+ _guess_formats_sorted = true
+ # guess format
+ for chk in _guess_formats
+ mode = chk.test args...
+ break if mode
+ if mode
+ me._rgb = clip_rgb _input[mode] args...
+
+ # by now we should have a color
+ console.warn 'unknown format: '+args if not me._rgb?
+ me._rgb = [0,0,0] if not me._rgb?
+
+ # add alpha
+ me._rgb.push 1 if me._rgb.length == 3
+
+ toString: ->
+ @hex()
+
+
+chroma._input = _input
src/node_modules/chroma-js/src/colors/colorbrewer.coffee
+###*
+ ColorBrewer colors for chroma.js
+
+ Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The
+ Pennsylvania State University.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software distributed
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations under the License.
+
+ @preserve
+###
+
+
+chroma.brewer = brewer =
+ # sequential
+ OrRd: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000']
+ PuBu: ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#045a8d', '#023858']
+ BuPu: ['#f7fcfd', '#e0ecf4', '#bfd3e6', '#9ebcda', '#8c96c6', '#8c6bb1', '#88419d', '#810f7c', '#4d004b']
+ Oranges: ['#fff5eb', '#fee6ce', '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801', '#a63603', '#7f2704']
+ BuGn: ['#f7fcfd', '#e5f5f9', '#ccece6', '#99d8c9', '#66c2a4', '#41ae76', '#238b45', '#006d2c', '#00441b']
+ YlOrBr: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506']
+ YlGn: ['#ffffe5', '#f7fcb9', '#d9f0a3', '#addd8e', '#78c679', '#41ab5d', '#238443', '#006837', '#004529']
+ Reds: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d']
+ RdPu: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a']
+ Greens: ['#f7fcf5', '#e5f5e0', '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#006d2c', '#00441b']
+ YlGnBu: ['#ffffd9', '#edf8b1', '#c7e9b4', '#7fcdbb', '#41b6c4', '#1d91c0', '#225ea8', '#253494', '#081d58']
+ Purples: ['#fcfbfd', '#efedf5', '#dadaeb', '#bcbddc', '#9e9ac8', '#807dba', '#6a51a3', '#54278f', '#3f007d']
+ GnBu: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']
+ Greys: ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525', '#000000']
+ YlOrRd: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026']
+ PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f']
+ Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b']
+ PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636']
+ Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825']
+
+ # diverging
+
+ Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2']
+ RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837']
+ RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061']
+ PiYG: ['#8e0152', '#c51b7d', '#de77ae', '#f1b6da', '#fde0ef', '#f7f7f7', '#e6f5d0', '#b8e186', '#7fbc41', '#4d9221', '#276419']
+ PRGn: ['#40004b', '#762a83', '#9970ab', '#c2a5cf', '#e7d4e8', '#f7f7f7', '#d9f0d3', '#a6dba0', '#5aae61', '#1b7837', '#00441b']
+ RdYlBu: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee090', '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', '#4575b4', '#313695']
+ BrBG: ['#543005', '#8c510a', '#bf812d', '#dfc27d', '#f6e8c3', '#f5f5f5', '#c7eae5', '#80cdc1', '#35978f', '#01665e', '#003c30']
+ RdGy: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#ffffff', '#e0e0e0', '#bababa', '#878787', '#4d4d4d', '#1a1a1a']
+ PuOr: ['#7f3b08', '#b35806', '#e08214', '#fdb863', '#fee0b6', '#f7f7f7', '#d8daeb', '#b2abd2', '#8073ac', '#542788', '#2d004b']
+
+ # qualitative
+
+ Set2: ['#66c2a5', '#fc8d62', '#8da0cb', '#e78ac3', '#a6d854', '#ffd92f', '#e5c494', '#b3b3b3']
+ Accent: ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f', '#bf5b17', '#666666']
+ Set1: ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33', '#a65628', '#f781bf', '#999999']
+ Set3: ['#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f']
+ Dark2: ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02', '#a6761d', '#666666']
+ Paired: ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928']
+ Pastel2: ['#b3e2cd', '#fdcdac', '#cbd5e8', '#f4cae4', '#e6f5c9', '#fff2ae', '#f1e2cc', '#cccccc']
+ Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2']
+
+# add lowercase aliases for case-insensitive matches
+do -> brewer[key.toLowerCase()] = brewer[key] for key of brewer
src/node_modules/chroma-js/src/colors/w3cx11.coffee
+###*
+ X11 color names
+
+ http://www.w3.org/TR/css3-color/#svg-color
+###
+
+w3cx11 =
+ aliceblue: '#f0f8ff'
+ antiquewhite: '#faebd7'
+ aqua: '#00ffff'
+ aquamarine: '#7fffd4'
+ azure: '#f0ffff'
+ beige: '#f5f5dc'
+ bisque: '#ffe4c4'
+ black: '#000000'
+ blanchedalmond: '#ffebcd'
+ blue: '#0000ff'
+ blueviolet: '#8a2be2'
+ brown: '#a52a2a'
+ burlywood: '#deb887'
+ cadetblue: '#5f9ea0'
+ chartreuse: '#7fff00'
+ chocolate: '#d2691e'
+ coral: '#ff7f50'
+ cornflower: '#6495ed'
+ cornflowerblue: '#6495ed'
+ cornsilk: '#fff8dc'
+ crimson: '#dc143c'
+ cyan: '#00ffff'
+ darkblue: '#00008b'
+ darkcyan: '#008b8b'
+ darkgoldenrod: '#b8860b'
+ darkgray: '#a9a9a9'
+ darkgreen: '#006400'
+ darkgrey: '#a9a9a9'
+ darkkhaki: '#bdb76b'
+ darkmagenta: '#8b008b'
+ darkolivegreen: '#556b2f'
+ darkorange: '#ff8c00'
+ darkorchid: '#9932cc'
+ darkred: '#8b0000'
+ darksalmon: '#e9967a'
+ darkseagreen: '#8fbc8f'
+ darkslateblue: '#483d8b'
+ darkslategray: '#2f4f4f'
+ darkslategrey: '#2f4f4f'
+ darkturquoise: '#00ced1'
+ darkviolet: '#9400d3'
+ deeppink: '#ff1493'
+ deepskyblue: '#00bfff'
+ dimgray: '#696969'
+ dimgrey: '#696969'
+ dodgerblue: '#1e90ff'
+ firebrick: '#b22222'
+ floralwhite: '#fffaf0'
+ forestgreen: '#228b22'
+ fuchsia: '#ff00ff'
+ gainsboro: '#dcdcdc'
+ ghostwhite: '#f8f8ff'
+ gold: '#ffd700'
+ goldenrod: '#daa520'
+ gray: '#808080'
+ green: '#008000'
+ greenyellow: '#adff2f'
+ grey: '#808080'
+ honeydew: '#f0fff0'
+ hotpink: '#ff69b4'
+ indianred: '#cd5c5c'
+ indigo: '#4b0082'
+ ivory: '#fffff0'
+ khaki: '#f0e68c'
+ laserlemon: '#ffff54'
+ lavender: '#e6e6fa'
+ lavenderblush: '#fff0f5'
+ lawngreen: '#7cfc00'
+ lemonchiffon: '#fffacd'
+ lightblue: '#add8e6'
+ lightcoral: '#f08080'
+ lightcyan: '#e0ffff'
+ lightgoldenrod: '#fafad2'
+ lightgoldenrodyellow: '#fafad2'
+ lightgray: '#d3d3d3'
+ lightgreen: '#90ee90'
+ lightgrey: '#d3d3d3'
+ lightpink: '#ffb6c1'
+ lightsalmon: '#ffa07a'
+ lightseagreen: '#20b2aa'
+ lightskyblue: '#87cefa'
+ lightslategray: '#778899'
+ lightslategrey: '#778899'
+ lightsteelblue: '#b0c4de'
+ lightyellow: '#ffffe0'
+ lime: '#00ff00'
+ limegreen: '#32cd32'
+ linen: '#faf0e6'
+ magenta: '#ff00ff'
+ maroon: '#800000'
+ maroon2: '#7f0000'
+ maroon3: '#b03060'
+ mediumaquamarine: '#66cdaa'
+ mediumblue: '#0000cd'
+ mediumorchid: '#ba55d3'
+ mediumpurple: '#9370db'
+ mediumseagreen: '#3cb371'
+ mediumslateblue: '#7b68ee'
+ mediumspringgreen: '#00fa9a'
+ mediumturquoise: '#48d1cc'
+ mediumvioletred: '#c71585'
+ midnightblue: '#191970'
+ mintcream: '#f5fffa'
+ mistyrose: '#ffe4e1'
+ moccasin: '#ffe4b5'
+ navajowhite: '#ffdead'
+ navy: '#000080'
+ oldlace: '#fdf5e6'
+ olive: '#808000'
+ olivedrab: '#6b8e23'
+ orange: '#ffa500'
+ orangered: '#ff4500'
+ orchid: '#da70d6'
+ palegoldenrod: '#eee8aa'
+ palegreen: '#98fb98'
+ paleturquoise: '#afeeee'
+ palevioletred: '#db7093'
+ papayawhip: '#ffefd5'
+ peachpuff: '#ffdab9'
+ peru: '#cd853f'
+ pink: '#ffc0cb'
+ plum: '#dda0dd'
+ powderblue: '#b0e0e6'
+ purple: '#800080'
+ purple2: '#7f007f'
+ purple3: '#a020f0'
+ rebeccapurple: '#663399'
+ red: '#ff0000'
+ rosybrown: '#bc8f8f'
+ royalblue: '#4169e1'
+ saddlebrown: '#8b4513'
+ salmon: '#fa8072'
+ sandybrown: '#f4a460'
+ seagreen: '#2e8b57'
+ seashell: '#fff5ee'
+ sienna: '#a0522d'
+ silver: '#c0c0c0'
+ skyblue: '#87ceeb'
+ slateblue: '#6a5acd'
+ slategray: '#708090'
+ slategrey: '#708090'
+ snow: '#fffafa'
+ springgreen: '#00ff7f'
+ steelblue: '#4682b4'
+ tan: '#d2b48c'
+ teal: '#008080'
+ thistle: '#d8bfd8'
+ tomato: '#ff6347'
+ turquoise: '#40e0d0'
+ violet: '#ee82ee'
+ wheat: '#f5deb3'
+ white: '#ffffff'
+ whitesmoke: '#f5f5f5'
+ yellow: '#ffff00'
+ yellowgreen: '#9acd32'
+
+chroma.colors = colors = w3cx11
src/node_modules/chroma-js/src/converter/in/cmyk2rgb.coffee
+cmyk2rgb = () ->
+ args = unpack arguments
+ [c,m,y,k] = args
+ alpha = if args.length > 4 then args[4] else 1
+ return [0,0,0,alpha] if k == 1
+ r = if c >= 1 then 0 else 255 * (1-c) * (1-k)
+ g = if m >= 1 then 0 else 255 * (1-m) * (1-k)
+ b = if y >= 1 then 0 else 255 * (1-y) * (1-k)
+ [r,g,b,alpha]
src/node_modules/chroma-js/src/converter/in/css2rgb.coffee
+# @requires utils hex2rgb hsl2rgb
+
+css2rgb = (css) ->
+ css = css.toLowerCase()
+ # named X11 colors
+ if chroma.colors? and chroma.colors[css]
+ return hex2rgb chroma.colors[css]
+ # rgb(250,20,0)
+ if m = css.match /rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/
+ rgb = m.slice 1,4
+ for i in [0..2]
+ rgb[i] = +rgb[i]
+ rgb[3] = 1 # default alpha
+ # rgba(250,20,0,0.4)
+ else if m = css.match /rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/
+ rgb = m.slice 1,5
+ for i in [0..3]
+ rgb[i] = +rgb[i]
+ # rgb(100%,0%,0%)
+ else if m = css.match /rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/
+ rgb = m.slice 1,4
+ for i in [0..2]
+ rgb[i] = round rgb[i] * 2.55
+ rgb[3] = 1 # default alpha
+ # rgba(100%,0%,0%,0.4)
+ else if m = css.match /rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/
+ rgb = m.slice 1,5
+ for i in [0..2]
+ rgb[i] = round rgb[i] * 2.55
+ rgb[3] = +rgb[3]
+ # hsl(0,100%,50%)
+ else if m = css.match /hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/
+ hsl = m.slice 1,4
+ hsl[1] *= 0.01
+ hsl[2] *= 0.01
+ rgb = hsl2rgb hsl
+ rgb[3] = 1
+ # hsla(0,100%,50%,0.5)
+ else if m = css.match /hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/
+ hsl = m.slice 1,4
+ hsl[1] *= 0.01
+ hsl[2] *= 0.01
+ rgb = hsl2rgb hsl
+ rgb[3] = +m[4] # default alpha = 1
+ rgb
src/node_modules/chroma-js/src/converter/in/hcg2rgb.coffee
+hcg2rgb = () ->
+ args = unpack arguments
+ [h,c,_g] = args
+ c = c / 100
+ g = g / 100 * 255
+ _c = c * 255
+ if c is 0
+ r = g = b = _g
+ else
+ h = 0 if h is 360
+ h -= 360 if h > 360
+ h += 360 if h < 0
+ h /= 60
+ i = floor h
+ f = h - i
+ p = _g * (1 - c)
+ q = p + _c * (1 - f)
+ t = p + _c * f
+ v = p + _c
+ switch i
+ when 0 then [r,g,b] = [v, t, p]
+ when 1 then [r,g,b] = [q, v, p]
+ when 2 then [r,g,b] = [p, v, t]
+ when 3 then [r,g,b] = [p, q, v]
+ when 4 then [r,g,b] = [t, p, v]
+ when 5 then [r,g,b] = [v, p, q]
+ [r, g, b, if args.length > 3 then args[3] else 1]
src/node_modules/chroma-js/src/converter/in/hex2rgb.coffee
+hex2rgb = (hex) ->
+ if hex.match /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/
+ if hex.length == 4 or hex.length == 7
+ hex = hex.substr(1)
+ if hex.length == 3
+ hex = hex.split("")
+ hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2]
+ u = parseInt(hex, 16)
+ r = u >> 16
+ g = u >> 8 & 0xFF
+ b = u & 0xFF
+ return [r,g,b,1]
+
+ # match rgba hex format, eg #FF000077
+ if hex.match /^#?([A-Fa-f0-9]{8})$/
+ if hex.length == 9
+ hex = hex.substr(1)
+ u = parseInt(hex, 16)
+ r = u >> 24 & 0xFF
+ g = u >> 16 & 0xFF
+ b = u >> 8 & 0xFF
+ a = round((u & 0xFF) / 0xFF * 100) / 100
+ return [r,g,b,a]
+
+ # check for css colors, too
+ if _input.css? and rgb = _input.css hex
+ return rgb
+
+ throw "unknown color: "+hex
src/node_modules/chroma-js/src/converter/in/hsi2rgb.coffee
+# @requires utils
+
+hsi2rgb = (h,s,i) ->
+ ###
+ borrowed from here:
+ http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/hsi2rgb.cpp
+ ###
+ args = unpack arguments
+ [h,s,i] = args
+
+ # normalize hue
+ #h += 360 if h < 0
+ #h -= 360 if h > 360
+ h = 0 if isNaN h
+ h /= 360
+ if h < 1/3
+ b = (1-s)/3
+ r = (1+s*cos(TWOPI*h)/cos(PITHIRD-TWOPI*h))/3
+ g = 1 - (b+r)
+ else if h < 2/3
+ h -= 1/3
+ r = (1-s)/3
+ g = (1+s*cos(TWOPI*h)/cos(PITHIRD-TWOPI*h))/3
+ b = 1 - (r+g)
+ else
+ h -= 2/3
+ g = (1-s)/3
+ b = (1+s*cos(TWOPI*h)/cos(PITHIRD-TWOPI*h))/3
+ r = 1 - (g+b)
+ r = limit i*r*3
+ g = limit i*g*3
+ b = limit i*b*3
+ [r*255, g*255, b*255, if args.length > 3 then args[3] else 1]
src/node_modules/chroma-js/src/converter/in/hsl2rgb.coffee
+# @requires utils
+
+hsl2rgb = () ->
+ args = unpack arguments
+ [h,s,l] = args
+ if s == 0
+ r = g = b = l*255
+ else
+ t3 = [0,0,0]
+ c = [0,0,0]
+ t2 = if l < 0.5 then l * (1+s) else l+s-l*s
+ t1 = 2 * l - t2
+ h /= 360
+ t3[0] = h + 1/3
+ t3[1] = h
+ t3[2] = h - 1/3
+ for i in [0..2]
+ t3[i] += 1 if t3[i] < 0
+ t3[i] -= 1 if t3[i] > 1
+ if 6 * t3[i] < 1
+ c[i] = t1 + (t2 - t1) * 6 * t3[i]
+ else if 2 * t3[i] < 1
+ c[i] = t2
+ else if 3 * t3[i] < 2
+ c[i] = t1 + (t2 - t1) * ((2 / 3) - t3[i]) * 6
+ else
+ c[i] = t1
+ [r,g,b] = [round(c[0]*255),round(c[1]*255),round(c[2]*255)]
+ if args.length > 3 then [r,g,b,args[3]] else [r,g,b]
src/node_modules/chroma-js/src/converter/in/hsv2rgb.coffee
+hsv2rgb = () ->
+ args = unpack arguments
+ [h,s,v] = args
+ v *= 255
+ if s is 0
+ r = g = b = v
+ else
+ h = 0 if h is 360
+ h -= 360 if h > 360
+ h += 360 if h < 0
+ h /= 60
+ i = floor h
+ f = h - i
+ p = v * (1 - s)
+ q = v * (1 - s * f)
+ t = v * (1 - s * (1 - f))
+ switch i
+ when 0 then [r,g,b] = [v, t, p]
+ when 1 then [r,g,b] = [q, v, p]
+ when 2 then [r,g,b] = [p, v, t]
+ when 3 then [r,g,b] = [p, q, v]
+ when 4 then [r,g,b] = [t, p, v]
+ when 5 then [r,g,b] = [v, p, q]
+ [r, g, b, if args.length > 3 then args[3] else 1]
src/node_modules/chroma-js/src/converter/in/lab2rgb.coffee
+# requires lab-constants
+
+lab2rgb = () ->
+ args = unpack arguments
+ [l,a,b] = args
+
+ y = (l + 16) / 116
+ x = if isNaN(a) then y else y + a / 500
+ z = if isNaN(b) then y else y - b / 200
+
+ y = LAB_CONSTANTS.Yn * lab_xyz y
+ x = LAB_CONSTANTS.Xn * lab_xyz x
+ z = LAB_CONSTANTS.Zn * lab_xyz z
+
+ r = xyz_rgb 3.2404542 * x - 1.5371385 * y - 0.4985314 * z # D65 -> sRGB
+ g = xyz_rgb -0.9692660 * x + 1.8760108 * y + 0.0415560 * z
+ b = xyz_rgb 0.0556434 * x - 0.2040259 * y + 1.0572252 * z
+
+ [r,g,b,if args.length > 3 then args[3] else 1]
+
+
+xyz_rgb = (r) ->
+ 255 * (if r <= 0.00304 then 12.92 * r else 1.055 * pow(r, 1 / 2.4) - 0.055)
+
+lab_xyz = (t) ->
+ if t > LAB_CONSTANTS.t1 then t * t * t else LAB_CONSTANTS.t2 * (t - LAB_CONSTANTS.t0)
+
src/node_modules/chroma-js/src/converter/in/lch2rgb.coffee
+# @requires utils lch2lab
+
+lch2rgb = () ->
+ args = unpack arguments
+ [l,c,h] = args
+ [L,a,b] = lch2lab l,c,h
+ [r,g,b] = lab2rgb L,a,b
+ [r, g, b, if args.length > 3 then args[3] else 1]
src/node_modules/chroma-js/src/converter/in/num2rgb.coffee
+# @requires utils
+num2rgb = (num) ->
+ if type(num) == "number" && num >= 0 && num <= 0xFFFFFF
+ r = num >> 16
+ g = (num >> 8) & 0xFF
+ b = num & 0xFF
+ return [r,g,b,1]
+ console.warn "unknown num color: "+num
+ [0,0,0,1]
src/node_modules/chroma-js/src/converter/in/temperature2rgb.coffee
+#
+# Based on implementation by Neil Bartlett
+# https://github.com/neilbartlett/color-temperature
+#
+
+# @requires utils
+
+temperature2rgb = (kelvin) ->
+ temp = kelvin / 100
+ if temp < 66
+ r = 255
+ g = -155.25485562709179 - 0.44596950469579133 * (g = temp-2) + 104.49216199393888 * log(g)
+ b = if temp < 20 then 0 else -254.76935184120902 + 0.8274096064007395 * (b = temp-10) + 115.67994401066147 * log(b)
+ else
+ r = 351.97690566805693 + 0.114206453784165 * (r = temp-55) - 40.25366309332127 * log(r)
+ g = 325.4494125711974 + 0.07943456536662342 * (g = temp-50) - 28.0852963507957 * log(g)
+ b = 255
+ [r,g,b]
src/node_modules/chroma-js/src/converter/misc/lab-constants.coffee
+
+
+LAB_CONSTANTS =
+ # Corresponds roughly to RGB brighter/darker
+ Kn: 18
+
+ # D65 standard referent
+ Xn: 0.950470
+ Yn: 1
+ Zn: 1.088830
+
+ t0: 0.137931034 # 4 / 29
+ t1: 0.206896552 # 6 / 29
+ t2: 0.12841855 # 3 * t1 * t1
+ t3: 0.008856452 # t1 * t1 * t1
+
src/node_modules/chroma-js/src/converter/misc/lab2lch.coffee
+# @requires utils
+
+lab2lch = () ->
+ [l, a, b] = unpack arguments
+ c = sqrt(a * a + b * b)
+ h = (atan2(b, a) * RAD2DEG + 360) % 360
+ h = Number.NaN if round(c*10000) == 0
+ [l, c, h]
src/node_modules/chroma-js/src/converter/misc/lch2lab.coffee
+# @requires utils
+
+lch2lab = () ->
+ ###
+ Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.
+ These formulas were invented by David Dalrymple to obtain maximum contrast without going
+ out of gamut if the parameters are in the range 0-1.
+
+ A saturation multiplier was added by Gregor Aisch
+ ###
+ [l,c,h] = unpack arguments
+ h = h * DEG2RAD
+ [l, cos(h) * c, sin(h) * c]
src/node_modules/chroma-js/src/converter/out/hsl2css.coffee
+# @requires utils
+
+rnd = (a) -> round(a*100)/100
+hsl2css = (hsl, alpha) ->
+ mode = if alpha < 1 then 'hsla' else 'hsl'
+ hsl[0] = rnd(hsl[0] || 0)
+ hsl[1] = rnd(hsl[1]*100) + '%'
+ hsl[2] = rnd(hsl[2]*100) + '%'
+ hsl[3] = alpha if mode == 'hsla'
+ mode + '(' + hsl.join(',') + ')'
src/node_modules/chroma-js/src/converter/out/rgb2cmyk.coffee
+rgb2cmyk = (mode='rgb') ->
+ [r,g,b] = unpack arguments
+ r = r / 255
+ g = g / 255
+ b = b / 255
+ k = 1 - Math.max(r,Math.max(g,b))
+ f = if k < 1 then 1 / (1-k) else 0
+ c = (1-r-k) * f
+ m = (1-g-k) * f
+ y = (1-b-k) * f
+ [c,m,y,k]
+
src/node_modules/chroma-js/src/converter/out/rgb2css.coffee
+# @requires utils
+
+rgb2css = (rgba) ->
+ mode = if rgba[3] < 1 then 'rgba' else 'rgb'
+ if mode == 'rgb'
+ mode+'('+rgba.slice(0,3).map(round).join(',')+')'
+ else if mode == 'rgba'
+ mode+'('+rgba.slice(0,3).map(round).join(',')+','+rgba[3]+')'
+ else
+
src/node_modules/chroma-js/src/converter/out/rgb2hcg.coffee
+rgb2hcg = () ->
+ [r,g,b] = unpack arguments
+ min = Math.min(r, g, b)
+ max = Math.max(r, g, b)
+ delta = max - min
+ c = delta * 100 / 255
+ _g = min / (255 - delta) * 100
+ if delta == 0
+ h = Number.NaN
+ else
+ if r is max then h = (g - b) / delta
+ if g is max then h = 2+(b - r) / delta
+ if b is max then h = 4+(r - g) / delta
+ h *= 60
+ if h < 0 then h += 360
+ [h, c, _g]
+
src/node_modules/chroma-js/src/converter/out/rgb2hex.coffee
+rgb2hex = (channels, mode='auto') ->
+ [r,g,b,a] = channels
+ if mode == 'auto'
+ mode = if a < 1 then 'rgba' else 'rgb'
+ r = Math.round r
+ g = Math.round g
+ b = Math.round b
+ u = r << 16 | g << 8 | b
+ str = "000000" + u.toString(16) #.toUpperCase()
+ str = str.substr(str.length - 6)
+ hxa = '0' + round(a * 255).toString(16)
+ hxa = hxa.substr(hxa.length - 2)
+ "#" + switch mode.toLowerCase()
+ when 'rgba' then str + hxa
+ when 'argb' then hxa + str
+ else str
+
src/node_modules/chroma-js/src/converter/out/rgb2hsi.coffee
+# @requires utils
+
+rgb2hsi = () ->
+ ###
+ borrowed from here:
+ http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/rgb2hsi.cpp
+ ###
+ [r,g,b] = unpack arguments
+ TWOPI = Math.PI*2
+ r /= 255
+ g /= 255
+ b /= 255
+ min = Math.min(r,g,b)
+ i = (r+g+b) / 3
+ s = 1 - min/i
+ if s == 0
+ h = 0
+ else
+ h = ((r-g)+(r-b)) / 2
+ h /= Math.sqrt((r-g)*(r-g) + (r-b)*(g-b))
+ h = Math.acos(h)
+ if b > g
+ h = TWOPI - h
+ h /= TWOPI
+ [h*360,s,i]
+
src/node_modules/chroma-js/src/converter/out/rgb2hsl.coffee
+rgb2hsl = (r,g,b) ->
+ if r != undefined and r.length >= 3
+ [r,g,b] = r
+ r /= 255
+ g /= 255
+ b /= 255
+
+ min = Math.min(r, g, b)
+ max = Math.max(r, g, b)
+
+ l = (max + min) / 2
+
+ if max == min
+ s = 0
+ h = Number.NaN
+ else
+ s = if l < 0.5 then (max - min) / (max + min) else (max - min) / (2 - max - min)
+
+ if r == max then h = (g - b) / (max - min)
+ else if (g == max) then h = 2 + (b - r) / (max - min)
+ else if (b == max) then h = 4 + (r - g) / (max - min)
+
+ h *= 60;
+ h += 360 if h < 0
+ [h,s,l]
+
src/node_modules/chroma-js/src/converter/out/rgb2hsv.coffee
+rgb2hsv = () ->
+ [r,g,b] = unpack arguments
+ min = Math.min(r, g, b)
+ max = Math.max(r, g, b)
+ delta = max - min
+ v = max / 255.0
+ if max == 0
+ h = Number.NaN
+ s = 0
+ else
+ s = delta / max
+ if r is max then h = (g - b) / delta
+ if g is max then h = 2+(b - r) / delta
+ if b is max then h = 4+(r - g) / delta
+ h *= 60;
+ if h < 0 then h += 360
+ [h, s, v]
+
src/node_modules/chroma-js/src/converter/out/rgb2lab.coffee
+# @requires utils lab-constants
+
+rgb2lab = () ->
+ [r,g,b] = unpack arguments
+ [x,y,z] = rgb2xyz r,g,b
+ [116 * y - 16, 500 * (x - y), 200 * (y - z)]
+
+rgb_xyz = (r) ->
+ if (r /= 255) <= 0.04045 then r / 12.92 else pow((r + 0.055) / 1.055, 2.4)
+
+xyz_lab = (t) ->
+ if t > LAB_CONSTANTS.t3 then pow(t, 1 / 3) else t / LAB_CONSTANTS.t2 + LAB_CONSTANTS.t0
+
+rgb2xyz = () ->
+ [r,g,b] = unpack arguments
+ r = rgb_xyz r
+ g = rgb_xyz g
+ b = rgb_xyz b
+ x = xyz_lab (0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / LAB_CONSTANTS.Xn
+ y = xyz_lab (0.2126729 * r + 0.7151522 * g + 0.0721750 * b) / LAB_CONSTANTS.Yn
+ z = xyz_lab (0.0193339 * r + 0.1191920 * g + 0.9503041 * b) / LAB_CONSTANTS.Zn
+ [x,y,z]
src/node_modules/chroma-js/src/converter/out/rgb2lch.coffee
+# @requires rgb2lab lab2lch
+
+rgb2lch = () ->
+ [r,g,b] = unpack arguments
+ [l,a,b] = rgb2lab r,g,b
+ lab2lch l,a,b
src/node_modules/chroma-js/src/converter/out/rgb2luminance.coffee
+# @requires utils
+
+rgb2luminance = (r,g,b) ->
+ # relative luminance
+ # see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
+ [r,g,b] = unpack arguments
+ r = luminance_x r
+ g = luminance_x g
+ b = luminance_x b
+ 0.2126 * r + 0.7152 * g + 0.0722 * b
+
+
+luminance_x = (x) ->
+ x /= 255
+ if x <= 0.03928 then x/12.92 else pow((x+0.055)/1.055, 2.4)
+
src/node_modules/chroma-js/src/converter/out/rgb2num.coffee
+rgb2num = () ->
+ [r,g,b] = unpack arguments
+ (r << 16) + (g << 8) + b
+
src/node_modules/chroma-js/src/converter/out/rgb2temperature.coffee
+#
+# Based on implementation by Neil Bartlett
+# https://github.com/neilbartlett/color-temperature
+#
+
+# @requires utils temperature2rgb
+
+rgb2temperature = () ->
+ [r,g,b] = unpack arguments
+ minTemp = 1000
+ maxTemp = 40000
+ eps = 0.4
+ while maxTemp - minTemp > eps
+ temp = (maxTemp + minTemp) * 0.5
+ rgb = temperature2rgb temp
+ if (rgb[2] / rgb[0]) >= (b / r)
+ maxTemp = temp
+ else
+ minTemp = temp
+ round temp
src/node_modules/chroma-js/src/generator/average.coffee
+# @require interpolate-lrgb
+
+chroma.average = (colors, mode='rgb') ->
+ l = colors.length
+ colors = colors.map (c) -> chroma(c)
+ first = colors.splice(0,1)[0]
+ if mode == 'lrgb'
+ return _average_lrgb colors
+ xyz = first.get(mode)
+ cnt = []
+ dx = 0
+ dy = 0
+ for i of xyz
+ xyz[i] = xyz[i] or 0
+ cnt.push if isNaN(xyz[i]) then 0 else 1
+ if mode.charAt(i) == 'h' and not isNaN(xyz[i])
+ A = xyz[i] / 180 * PI
+ dx += cos(A)
+ dy += sin(A)
+
+ alpha = first.alpha()
+ for c in colors
+ xyz2 = c.get(mode)
+ alpha += c.alpha()
+ for i of xyz
+ if not isNaN xyz2[i]
+ cnt[i] += 1
+ if mode.charAt(i) == 'h'
+ A = xyz2[i] / 180 * PI
+ dx += cos(A)
+ dy += sin(A)
+ else
+ xyz[i] += xyz2[i]
+ for i of xyz
+ if mode.charAt(i) == 'h'
+ A = atan2(dy / cnt[i], dx / cnt[i]) / PI * 180
+ A += 360 while A < 0
+ A -= 360 while A >= 360
+ xyz[i] = A
+ else
+ xyz[i] = xyz[i]/cnt[i]
+
+ chroma(xyz, mode).alpha(alpha/l)
src/node_modules/chroma-js/src/generator/bezier.coffee
+#
+# interpolates between a set of colors uzing a bezier spline
+#
+
+# @requires utils lab
+
+bezier = (colors) ->
+ colors = (chroma(c) for c in colors)
+ if colors.length == 2
+ # linear interpolation
+ [lab0, lab1] = (c.lab() for c in colors)
+ I = (t) ->
+ lab = (lab0[i] + t * (lab1[i] - lab0[i]) for i in [0..2])
+ chroma.lab lab...
+ else if colors.length == 3
+ # quadratic bezier interpolation
+ [lab0, lab1, lab2] = (c.lab() for c in colors)
+ I = (t) ->
+ lab = ((1-t)*(1-t) * lab0[i] + 2 * (1-t) * t * lab1[i] + t * t * lab2[i] for i in [0..2])
+ chroma.lab lab...
+ else if colors.length == 4
+ # cubic bezier interpolation
+ [lab0, lab1, lab2, lab3] = (c.lab() for c in colors)
+ I = (t) ->
+ lab = ((1-t)*(1-t)*(1-t) * lab0[i] + 3 * (1-t) * (1-t) * t * lab1[i] + 3 * (1-t) * t * t * lab2[i] + t*t*t * lab3[i] for i in [0..2])
+ chroma.lab lab...
+ else if colors.length == 5
+ I0 = bezier colors[0..2]
+ I1 = bezier colors[2..4]
+ I = (t) ->
+ if t < 0.5
+ I0 t*2
+ else
+ I1 (t-0.5)*2
+ I
+chroma.bezier = (colors) ->
+ f = bezier colors
+
+ f.scale = () ->
+ chroma.scale f
+
+ f
src/node_modules/chroma-js/src/generator/cubehelix.coffee
+# cubehelix interpolation
+# based on D.A. Green "A colour scheme for the display of astronomical intensity images"
+# http://astron-soc.in/bulletin/11June/289392011.pdf
+
+chroma.cubehelix = (start=300, rotations=-1.5, hue=1, gamma=1, lightness=[0,1]) ->
+ dh = 0
+ if type(lightness) == 'array'
+ dl = lightness[1] - lightness[0]
+ else
+ dl = 0
+ lightness = [lightness, lightness]
+
+ f = (fract) ->
+ a = TWOPI * ((start+120)/360 + rotations * fract)
+ l = pow(lightness[0] + dl * fract, gamma)
+ h = if dh != 0 then hue[0] + fract * dh else hue
+ amp = h * l * (1-l) / 2
+ cos_a = cos a
+ sin_a = sin a
+ r = l + amp * (-0.14861 * cos_a + 1.78277* sin_a)
+ g = l + amp * (-0.29227 * cos_a - 0.90649* sin_a)
+ b = l + amp * (+1.97294 * cos_a)
+ chroma clip_rgb [r*255,g*255,b*255,1]
+
+ f.start = (s) ->
+ if not s? then return start
+ start = s
+ f
+
+ f.rotations = (r) ->
+ if not r? then return rotations
+ rotations = r
+ f
+
+ f.gamma = (g) ->
+ if not g? then return gamma
+ gamma = g
+ f
+
+ f.hue = (h) ->
+ if not h? then return hue
+ hue = h
+ if type(hue) == 'array'
+ dh = hue[1] - hue[0]
+ hue = hue[1] if dh == 0
+ else
+ dh = 0
+ f
+
+ f.lightness = (h) ->
+ if not h? then return lightness
+ if type(h) == 'array'
+ lightness = h
+ dl = h[1] - h[0]
+ else
+ lightness = [h,h]
+ dl = 0
+ f
+
+ f.scale = () ->
+ chroma.scale f
+
+ f.hue hue
+
+ f
src/node_modules/chroma-js/src/generator/random.coffee
+
+chroma.random = ->
+ digits = '0123456789abcdef'
+ code = '#'
+ code += digits.charAt(floor(Math.random() * 16)) for i in [0...6]
+ new Color code
src/node_modules/chroma-js/src/index.coffee
+###
+@requires
+
+ color
+
+ colorbrewer
+ w3cx11
+
+ bezier
+ cubehelix
+ random
+ average
+
+ rgb hex hsl hsv num hcg
+ css named
+ lch lab
+ cmyk
+ gl
+ luminance
+ temperature
+ contrast
+ distance
+ delta-e
+
+ get set
+ clipped
+
+ alpha darken saturate premultiply blend
+
+ scale
+ limits
+
+ interpolate-hsx
+ interpolate-rgb
+ interpolate-num
+ interpolate-lab
+ interpolate-lrgb
+###
+
src/node_modules/chroma-js/src/interpolator/interpolate-hsx.coffee
+# @requires interpolate hsl hsv hsi lch hcg
+
+interpolate_hsx = (col1, col2, f, m) ->
+ if m == 'hsl'
+ xyz0 = col1.hsl()
+ xyz1 = col2.hsl()
+ else if m == 'hsv'
+ xyz0 = col1.hsv()
+ xyz1 = col2.hsv()
+ else if m == 'hcg'
+ xyz0 = col1.hcg()
+ xyz1 = col2.hcg()
+ else if m == 'hsi'
+ xyz0 = col1.hsi()
+ xyz1 = col2.hsi()
+ else if m == 'lch' or m == 'hcl'
+ m = 'hcl'
+ xyz0 = col1.hcl()
+ xyz1 = col2.hcl()
+
+ if m.substr(0, 1) == 'h'
+ [hue0, sat0, lbv0] = xyz0
+ [hue1, sat1, lbv1] = xyz1
+
+ if not isNaN(hue0) and not isNaN(hue1)
+ if hue1 > hue0 and hue1 - hue0 > 180
+ dh = hue1-(hue0+360)
+ else if hue1 < hue0 and hue0 - hue1 > 180
+ dh = hue1+360-hue0
+ else
+ dh = hue1 - hue0
+ hue = hue0+f*dh
+ else if not isNaN(hue0)
+ hue = hue0
+ sat = sat0 if (lbv1 == 1 or lbv1 == 0) and m != 'hsv'
+ else if not isNaN(hue1)
+ hue = hue1
+ sat = sat1 if (lbv0 == 1 or lbv0 == 0) and m != 'hsv'
+ else
+ hue = Number.NaN
+
+ sat ?= sat0 + f*(sat1 - sat0)
+ lbv = lbv0 + f*(lbv1-lbv0)
+ res = chroma[m](hue, sat, lbv)
+
+
+_interpolators = _interpolators.concat ([m, interpolate_hsx] for m in ['hsv','hsl','hsi','hcl','lch','hcg'])
src/node_modules/chroma-js/src/interpolator/interpolate-lab.coffee
+# @requires interpolate lab
+
+interpolate_lab = (col1, col2, f, m) ->
+ xyz0 = col1.lab()
+ xyz1 = col2.lab()
+ res = new Color(
+ xyz0[0] + f * (xyz1[0]-xyz0[0]),
+ xyz0[1] + f * (xyz1[1]-xyz0[1]),
+ xyz0[2] + f * (xyz1[2]-xyz0[2]),
+ m
+ )
+
+_interpolators.push ['lab', interpolate_lab]
src/node_modules/chroma-js/src/interpolator/interpolate-lrgb.coffee
+# @requires interpolate rgb utils
+
+interpolate_lrgb = (col1, col2, f, m) ->
+ xyz0 = col1._rgb
+ xyz1 = col2._rgb
+ new Color(
+ sqrt(pow(xyz0[0],2) * (1-f) + pow(xyz1[0],2) * f),
+ sqrt(pow(xyz0[1],2) * (1-f) + pow(xyz1[1],2) * f),
+ sqrt(pow(xyz0[2],2) * (1-f) + pow(xyz1[2],2) * f),
+ m
+ )
+
+_average_lrgb = (colors) ->
+ f = 1/colors.length
+ xyz = [0,0,0,0]
+ for col in colors
+ rgb = col._rgb
+ xyz[0] += pow(rgb[0],2) * f
+ xyz[1] += pow(rgb[1],2) * f
+ xyz[2] += pow(rgb[2],2) * f
+ xyz[3] += rgb[3] * f
+ xyz[0] = sqrt(xyz[0])
+ xyz[1] = sqrt(xyz[1])
+ xyz[2] = sqrt(xyz[2])
+ xyz[3] = 1 if xyz[3] > 1
+ new Color clip_rgb xyz
+
+
+_interpolators.push ['lrgb', interpolate_lrgb]
+
src/node_modules/chroma-js/src/interpolator/interpolate-num.coffee
+# @requires interpolate num
+
+interpolate_num = (col1, col2, f, m) ->
+ n1 = col1.num()
+ n2 = col2.num()
+ chroma.num n1 + (n2-n1) * f, 'num'
+
+_interpolators.push ['num', interpolate_num]
src/node_modules/chroma-js/src/interpolator/interpolate-rgb.coffee
+# @requires interpolate rgb
+
+interpolate_rgb = (col1, col2, f, m) ->
+ xyz0 = col1._rgb
+ xyz1 = col2._rgb
+ new Color(
+ xyz0[0] + f * (xyz1[0]-xyz0[0]),
+ xyz0[1] + f * (xyz1[1]-xyz0[1]),
+ xyz0[2] + f * (xyz1[2]-xyz0[2]),
+ m
+ )
+
+_interpolators.push ['rgb', interpolate_rgb]
src/node_modules/chroma-js/src/interpolator/interpolate.coffee
+###
+@requires
+ color
+ utils
+###
+
+_interpolators = []
+
+interpolate = (col1, col2, f=0.5, m='rgb') ->
+ ###
+ interpolates between colors
+ f = 0 --> me
+ f = 1 --> col
+ ###
+ col1 = chroma col1 if type(col1) != 'object'
+ col2 = chroma col2 if type(col2) != 'object'
+
+ for interpol in _interpolators
+ if m == interpol[0]
+ res = interpol[1] col1, col2, f, m
+ break
+
+ throw "color mode "+m+" is not supported" if not res?
+
+ # interpolate alpha at last
+ return res.alpha col1.alpha() + f * (col2.alpha() - col1.alpha())
+
+chroma.interpolate = interpolate
+
+Color::interpolate = (col2, f, m) ->
+ interpolate @, col2, f, m
+
+chroma.mix = interpolate
+Color::mix = Color::interpolate
src/node_modules/chroma-js/src/io/cmyk.coffee
+# @require utils rgb2cmyk cmyk2rgb
+
+_input.cmyk = () ->
+ cmyk2rgb unpack arguments
+
+
+chroma.cmyk = () ->
+ new Color arguments..., 'cmyk'
+Color::cmyk = () ->
+ rgb2cmyk @_rgb
src/node_modules/chroma-js/src/io/contrast.coffee
+chroma.contrast = (a, b) ->
+ # WCAG contrast ratio
+ # see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef
+ a = new Color a if type(a) in ['string', 'number']
+ b = new Color b if type(b) in ['string', 'number']
+ l1 = a.luminance()
+ l2 = b.luminance()
+ if l1 > l2 then (l1 + 0.05) / (l2 + 0.05) else (l2 + 0.05) / (l1 + 0.05)
+
src/node_modules/chroma-js/src/io/css.coffee
+# @requires utils css2rgb rgb2css hsl2css
+
+_input.css = (h) ->
+ css2rgb h
+
+chroma.css = () ->
+ new Color arguments..., 'css'
+
+Color::css = (mode='rgb') ->
+ if mode[0..2] == 'rgb'
+ rgb2css @_rgb
+ else if mode[0..2] == 'hsl'
+ hsl2css @hsl(), @alpha()
src/node_modules/chroma-js/src/io/delta-e.coffee
+chroma.deltaE = (a, b, L=1, C=1) ->
+ # Delta E (CMC)
+ # see http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CMC.html
+ a = new Color a if type(a) in ['string', 'number']
+ b = new Color b if type(b) in ['string', 'number']
+ [L1,a1,b1] = a.lab()
+ [L2,a2,b2] = b.lab()
+ c1 = sqrt(a1 * a1 + b1 * b1)
+ c2 = sqrt(a2 * a2 + b2 * b2)
+ sl = if L1 < 16.0 then 0.511 else (0.040975 * L1) / (1.0 + 0.01765 * L1)
+ sc = (0.0638 * c1) / (1.0 + 0.0131 * c1) + 0.638
+ h1 = if c1 < 0.000001 then 0.0 else (atan2(b1, a1) * 180.0) / PI
+ h1 += 360 while h1 < 0
+ h1 -= 360 while h1 >= 360
+ t = if (h1 >= 164.0) && (h1 <= 345.0) then (0.56 + abs(0.2 * cos((PI * (h1 + 168.0)) / 180.0))) else (0.36 + abs(0.4 * cos((PI * (h1 + 35.0)) / 180.0)))
+ c4 = c1 * c1 * c1 * c1
+ f = sqrt(c4 / (c4 + 1900.0))
+ sh = sc * (f * t + 1.0 - f)
+ delL = L1 - L2
+ delC = c1 - c2
+ delA = a1 - a2
+ delB = b1 - b2
+ dH2 = delA * delA + delB * delB - delC * delC
+ v1 = delL / (L * sl)
+ v2 = delC / (C * sc)
+ v3 = sh
+ sqrt(v1 * v1 + v2 * v2 + (dH2 / (v3 * v3)))
+
+
src/node_modules/chroma-js/src/io/distance.coffee
+# simple Euclidean distance
+chroma.distance = (a, b, mode='lab') ->
+ # Delta E (CIE 1976)
+ # see http://www.brucelindbloom.com/index.html?Equations.html
+ a = new Color a if type(a) in ['string', 'number']
+ b = new Color b if type(b) in ['string', 'number']
+ l1 = a.get mode
+ l2 = b.get mode
+ sum_sq = 0
+ for i of l1
+ d = (l1[i] || 0) - (l2[i] || 0)
+ sum_sq += d*d
+ Math.sqrt sum_sq
src/node_modules/chroma-js/src/io/gl.coffee
+# @require utils
+
+_input.gl = () ->
+ rgb = (v for k,v of unpack arguments)
+ for i in [0..2]
+ rgb[i] *= 255
+ rgb
+
+chroma.gl = () ->
+ new Color arguments..., 'gl'
+
+Color::gl = () ->
+ rgb = @_rgb
+ [rgb[0]/255, rgb[1]/255, rgb[2]/255, rgb[3]]
src/node_modules/chroma-js/src/io/hcg.coffee
+# @require utils hcg2rgb rgb2hcg
+
+chroma.hcg = () ->
+ new Color arguments..., 'hcg'
+
+_input.hcg = hcg2rgb
+Color::hcg = () ->
+ rgb2hcg @_rgb
src/node_modules/chroma-js/src/io/hex.coffee
+# @require hex2rgb rgb2hex
+
+_input.hex = (h) ->
+ hex2rgb h
+
+chroma.hex = () ->
+ new Color arguments..., 'hex'
+
+Color::hex = (mode='auto') ->
+ rgb2hex @_rgb, mode
+
+_guess_formats.push
+ p: 4,
+ test: (n) ->
+ 'hex' if arguments.length == 1 and type(n) == "string"
src/node_modules/chroma-js/src/io/hsi.coffee
+# @require utils hsi2rgb rgb2hsi
+
+chroma.hsi = () ->
+ new Color arguments..., 'hsi'
+
+_input.hsi = hsi2rgb
+
+Color::hsi = () ->
+ rgb2hsi @_rgb
+
+
src/node_modules/chroma-js/src/io/hsl.coffee
+# @require utils hsl2rgb rgb2hsl
+
+chroma.hsl = () ->
+ new Color arguments..., 'hsl'
+
+_input.hsl = hsl2rgb
+
+Color::hsl = () ->
+ rgb2hsl @_rgb
+
+
src/node_modules/chroma-js/src/io/hsv.coffee
+# @require utils hsv2rgb rgb2hsv
+
+chroma.hsv = () ->
+ new Color arguments..., 'hsv'
+
+_input.hsv = hsv2rgb
+Color::hsv = () ->
+ rgb2hsv @_rgb
src/node_modules/chroma-js/src/io/lab.coffee
+# @require utils lab2rgb rgb2lab
+
+chroma.lab = () ->
+ new Color arguments..., 'lab'
+
+_input.lab = lab2rgb
+
+Color::lab = () ->
+ rgb2lab @_rgb
+
+
src/node_modules/chroma-js/src/io/lch.coffee
+# @require utils lch2rgb rgb2lch
+
+chroma.lch = () ->
+ args = unpack arguments
+ new Color args, 'lch'
+
+chroma.hcl = () ->
+ args = unpack arguments
+ new Color args, 'hcl'
+
+_input.lch = lch2rgb
+
+_input.hcl = () ->
+ [h,c,l] = unpack arguments
+ lch2rgb [l,c,h]
+
+Color::lch = () ->
+ rgb2lch @_rgb
+
+Color::hcl = () ->
+ rgb2lch(@_rgb).reverse()
+
+
src/node_modules/chroma-js/src/io/luminance.coffee
+# @requires rgb2luminance interpolate-rgb
+
+Color::luminance = (lum, mode='rgb') ->
+ if !arguments.length
+ return rgb2luminance @_rgb
+
+ # set luminance
+ rgba = @_rgb
+ if lum == 0
+ rgba = [0,0,0,@_rgb[3]]
+ else if lum == 1
+ rgba = [255,255,255,@[3]]
+ else
+ cur_lum = rgb2luminance @_rgb
+ eps = 1e-7
+ max_iter = 20
+
+ test = (l,h) ->
+ m = l.interpolate(h, 0.5, mode)
+ lm = m.luminance()
+ if Math.abs(lum - lm) < eps or not max_iter--
+ return m
+ if lm > lum
+ return test(l, m)
+ return test(m, h)
+
+ if cur_lum > lum
+ rgba = test(chroma('black'), @).rgba()
+ else
+ rgba = test(@, chroma('white')).rgba()
+
+ chroma(rgba).alpha(@alpha())
src/node_modules/chroma-js/src/io/named.coffee
+#
+# @requires hex hex2rgb w3cx11
+#
+
+_input.named = (name) ->
+ hex2rgb w3cx11[name]
+
+_guess_formats.push
+ p: 5,
+ test: (n) ->
+ 'named' if arguments.length == 1 and w3cx11[n]?
+
+Color::name = (n) ->
+ if arguments.length
+ @_rgb = hex2rgb w3cx11[n] if w3cx11[n]
+ @_rgb[3] = 1
+ @
+ # resolve name from hex
+ h = @hex('rgb')
+ for k of w3cx11
+ if h == w3cx11[k]
+ return k
+ h
src/node_modules/chroma-js/src/io/num.coffee
+# @require utils num2rgb rgb2num
+
+chroma.num = (num) ->
+ new Color num, 'num'
+
+Color::num = (mode='rgb') ->
+ rgb2num @_rgb, mode
+
+_input.num = num2rgb
+
+_guess_formats.push
+ p: 1,
+ test: (n) ->
+ 'num' if arguments.length == 1 and type(n) == "number" and n >= 0 and n <= 0xFFFFFF
src/node_modules/chroma-js/src/io/rgb.coffee
+# @require utils
+
+_input.rgb = () ->
+ (v for k,v of unpack arguments)
+
+chroma.rgb = () ->
+ new Color arguments..., 'rgb'
+
+Color::rgb = (round=true) ->
+ if round then @_rgb.map(Math.round).slice 0,3 else @_rgb.slice 0,3
+
+Color::rgba = (round=true) ->
+ return @_rgb.slice(0) if not round
+ return [Math.round(@_rgb[0]), Math.round(@_rgb[1]), Math.round(@_rgb[2]), @_rgb[3]]
+
+_guess_formats.push
+ p: 3
+ test: (n) ->
+ a = unpack arguments
+ return 'rgb' if type(a) == 'array' and a.length == 3
+ return 'rgb' if a.length == 4 and type(a[3]) == "number" and a[3] >= 0 and a[3] <= 1
+
+_input.lrgb = _input.rgb
src/node_modules/chroma-js/src/io/temperature.coffee
+# @requires utils rgb2temperature temperature2rgb
+
+chroma.temperature = chroma.kelvin = () ->
+ new Color arguments..., 'temperature'
+
+_input.temperature = _input.kelvin = _input.K = temperature2rgb
+
+Color::temperature = () ->
+ rgb2temperature @_rgb
+
+Color::kelvin = Color::temperature
+
src/node_modules/chroma-js/src/limits.coffee
+
+chroma.analyze = (data, key, filter) ->
+ r =
+ min: Number.MAX_VALUE
+ max: Number.MAX_VALUE*-1
+ sum: 0
+ values: []
+ count: 0
+
+ if not filter?
+ filter = ->
+ true
+
+ add = (val) ->
+ if val? and not isNaN val
+ r.values.push val
+ r.sum += val
+ r.min = val if val < r.min
+ r.max = val if val > r.max
+ r.count += 1
+ return
+
+ visit = (val, k) ->
+ if filter val, k
+ if key? and type(key) == 'function'
+ add key val
+ else if key? and type(key) == 'string' or type(key) == 'number'
+ add val[key]
+ else
+ add val
+
+ if type(data) == 'array'
+ for val in data
+ visit val
+ else
+ for k, val of data
+ visit val, k
+ r.domain = [r.min, r.max]
+ r.limits = (mode, num) ->
+ chroma.limits r, mode, num
+ r
+
+
+
+chroma.limits = (data, mode='equal', num=7) ->
+ if type(data) == 'array'
+ data = chroma.analyze data
+ min = data.min
+ max = data.max
+ sum = data.sum
+ values = data.values.sort (a,b)->
+ a-b
+
+ return [min,max] if num == 1
+
+ limits = []
+
+ if mode.substr(0,1) == 'c' # continuous
+ limits.push min
+ limits.push max
+
+ if mode.substr(0,1) == 'e' # equal interval
+ limits.push min
+ for i in [1..num-1]
+ limits.push min+(i/num)*(max-min)
+ limits.push max
+
+ else if mode.substr(0,1) == 'l' # log scale
+ if min <= 0
+ throw 'Logarithmic scales are only possible for values > 0'
+ min_log = Math.LOG10E * log min
+ max_log = Math.LOG10E * log max
+ limits.push min
+ for i in [1..num-1]
+ limits.push pow 10, min_log + (i/num) * (max_log - min_log)
+ limits.push max
+
+ else if mode.substr(0,1) == 'q' # quantile scale
+ limits.push min
+ for i in [1..num-1]
+ p = (values.length-1) * i/num
+ pb = floor p
+ if pb == p
+ limits.push values[pb]
+ else # p > pb
+ pr = p - pb
+ limits.push values[pb]*(1-pr) + values[pb+1]*pr
+ limits.push max
+
+ else if mode.substr(0,1) == 'k' # k-means clustering
+ ###
+ implementation based on
+ http://code.google.com/p/figue/source/browse/trunk/figue.js#336
+ simplified for 1-d input values
+ ###
+ n = values.length
+ assignments = new Array n
+ clusterSizes = new Array num
+ repeat = true
+ nb_iters = 0
+ centroids = null
+
+ # get seed values
+ centroids = []
+ centroids.push min
+ for i in [1..num-1]
+ centroids.push min + (i/num) * (max-min)
+ centroids.push max
+
+ while repeat
+ # assignment step
+ for j in [0..num-1]
+ clusterSizes[j] = 0
+ for i in [0..n-1]
+ value = values[i]
+ mindist = Number.MAX_VALUE
+ for j in [0..num-1]
+ dist = abs centroids[j]-value
+ if dist < mindist
+ mindist = dist
+ best = j
+ clusterSizes[best]++
+ assignments[i] = best
+
+ # update centroids step
+ newCentroids = new Array num
+ for j in [0..num-1]
+ newCentroids[j] = null
+ for i in [0..n-1]
+ cluster = assignments[i]
+ if newCentroids[cluster] == null
+ newCentroids[cluster] = values[i]
+ else
+ newCentroids[cluster] += values[i]
+ for j in [0..num-1]
+ newCentroids[j] *= 1/clusterSizes[j]
+
+ # check convergence
+ repeat = false
+ for j in [0..num-1]
+ if newCentroids[j] != centroids[i]
+ repeat = true
+ break
+
+ centroids = newCentroids
+ nb_iters++
+
+ if nb_iters > 200
+ repeat = false
+
+ # finished k-means clustering
+ # the next part is borrowed from gabrielflor.it
+ kClusters = {}
+ for j in [0..num-1]
+ kClusters[j] = []
+ for i in [0..n-1]
+ cluster = assignments[i]
+ kClusters[cluster].push values[i]
+ tmpKMeansBreaks = []
+ for j in [0..num-1]
+ tmpKMeansBreaks.push kClusters[j][0]
+ tmpKMeansBreaks.push kClusters[j][kClusters[j].length-1]
+ tmpKMeansBreaks = tmpKMeansBreaks.sort (a,b)->
+ a-b
+ limits.push tmpKMeansBreaks[0]
+ for i in [1..tmpKMeansBreaks.length-1] by 2
+ v = tmpKMeansBreaks[i]
+ if not isNaN(v) and limits.indexOf(v) == -1
+ limits.push v
+ limits
+
+
src/node_modules/chroma-js/src/ops/alpha.coffee
+# @require color
+
+Color::alpha = (a) ->
+ if arguments.length
+ return chroma.rgb([@_rgb[0], @_rgb[1], @_rgb[2], a])
+ @_rgb[3]
src/node_modules/chroma-js/src/ops/blend.coffee
+#
+# interpolates between a set of colors uzing a bezier spline
+# blend mode formulas taken from http://www.venture-ware.com/kevin/coding/lets-learn-math-photoshop-blend-modes/
+#
+
+# @require utils color
+
+blend = (bottom, top, mode) ->
+ if !blend[mode]
+ throw 'unknown blend mode ' + mode
+ blend[mode](bottom, top)
+
+blend_f = (f) ->
+ (bottom,top) ->
+ c0 = chroma(top).rgb()
+ c1 = chroma(bottom).rgb()
+ chroma(f(c0,c1), 'rgb')
+
+each = (f) ->
+ (c0, c1) ->
+ out = []
+ for i in [0..3]
+ out[i] = f(c0[i], c1[i])
+ out
+
+normal = (a,b) ->
+ a
+
+multiply = (a,b) ->
+ a * b / 255
+
+darken = (a,b) ->
+ if a > b then b else a
+
+lighten = (a,b) ->
+ if a > b then a else b
+
+screen = (a,b) ->
+ 255 * (1 - (1-a/255) * (1-b/255))
+
+overlay = (a,b) ->
+ if b < 128
+ 2 * a * b / 255
+ else
+ 255 * (1 - 2 * (1 - a / 255 ) * ( 1 - b / 255 ))
+
+burn = (a,b) ->
+ 255 * (1 - (1 - b / 255) / (a/255))
+
+dodge = (a,b) ->
+ return 255 if a == 255
+ a = 255 * (b / 255) / (1 - a / 255)
+ if a > 255 then 255 else a
+
+# add = (a,b) ->
+# if (a + b > 255) then 255 else a + b
+
+blend.normal = blend_f each normal
+blend.multiply = blend_f each multiply
+blend.screen = blend_f each screen
+blend.overlay = blend_f each overlay
+blend.darken = blend_f each darken
+blend.lighten = blend_f each lighten
+blend.dodge = blend_f each dodge
+blend.burn = blend_f each burn
+# blend.add = blend_f each add
+chroma.blend = blend
src/node_modules/chroma-js/src/ops/clipped.coffee
+# @require color
+
+Color::clipped = () ->
+ @_rgb._clipped or false
src/node_modules/chroma-js/src/ops/darken.coffee
+# @requires color lab lab-constants
+
+Color::darken = (amount=1) ->
+ me = @
+ lab = me.lab()
+ lab[0] -= LAB_CONSTANTS.Kn * amount
+ chroma.lab(lab).alpha(me.alpha())
+
+Color::brighten = (amount=1) ->
+ @darken -amount
+
+Color::darker = Color::darken
+Color::brighter = Color::brighten
src/node_modules/chroma-js/src/ops/get.coffee
+Color::get = (modechan) ->
+ me = @
+ [mode,channel] = modechan.split '.'
+ src = me[mode]()
+ if channel
+ i = mode.indexOf channel
+ if i > -1
+ return src[i]
+ else
+ console.warn 'unknown channel '+channel+' in mode '+mode
+ else
+ return src
+
+
src/node_modules/chroma-js/src/ops/premultiply.coffee
+# @requires color rgb
+
+Color::premultiply = ->
+ rgb = @rgb()
+ a = @alpha()
+ chroma(rgb[0]*a, rgb[1]*a, rgb[2]*a, a)
src/node_modules/chroma-js/src/ops/saturate.coffee
+# requrie lab-constants lch
+
+Color::saturate = (amount=1) ->
+ me = @
+ lch = me.lch()
+ lch[1] += amount * LAB_CONSTANTS.Kn
+ lch[1] = 0 if lch[1] < 0
+ chroma.lch(lch).alpha(me.alpha())
+Color::desaturate = (amount=1) ->
+ @saturate -amount
src/node_modules/chroma-js/src/ops/set.coffee
+Color::set = (modechan, value) ->
+ me = @
+ [mode,channel] = modechan.split '.'
+ if channel
+ src = me[mode]()
+ i = mode.indexOf channel
+ if i > -1
+ if type(value) == 'string'
+ switch value.charAt(0)
+ when '+' then src[i] += +value
+ when '-' then src[i] += +value
+ when '*' then src[i] *= +(value.substr(1))
+ when '/' then src[i] /= +(value.substr(1))
+ else src[i] = +value
+ else
+ src[i] = value
+ else
+ console.warn 'unknown channel '+channel+' in mode '+mode
+ else
+ src = value
+ chroma(src, mode).alpha(me.alpha())
+
+
src/node_modules/chroma-js/src/scale.coffee
+# minimal multi-purpose interface
+
+# @requires utils color analyze
+
+chroma.scale = (colors, positions) ->
+
+ # constructor
+ _mode = 'rgb'
+ _nacol = chroma '#ccc'
+ _spread = 0
+ _fixed = false
+ _domain = [0, 1]
+ _pos = []
+ _padding = [0,0]
+ _classes = false
+ _colors = []
+ _out = false
+ _min = 0
+ _max = 1
+ _correctLightness = false
+ _colorCache = {}
+ _useCache = true
+ _gamma = 1
+
+ # private methods
+
+ setColors = (colors) ->
+ if not colors?
+ colors = ['#fff', '#000']
+ if colors? and type(colors) == 'string' and chroma.brewer?
+ colors = chroma.brewer[colors] || chroma.brewer[colors.toLowerCase()] || colors
+ if type(colors) == 'array'
+ # handle single color
+ if colors.length == 1
+ colors = [colors[0], colors[0]]
+ # make a copy of the colors
+ colors = colors.slice(0)
+ # convert to chroma classes
+ for c in [0..colors.length-1]
+ col = colors[c]
+ colors[c] = chroma(col) if type(col) == "string"
+ # auto-fill color position
+ _pos.length = 0
+ for c in [0..colors.length-1]
+ _pos.push c/(colors.length-1)
+ resetCache()
+ _colors = colors
+
+ getClass = (value) ->
+ if _classes?
+ n = _classes.length-1
+ i = 0
+ while i < n and value >= _classes[i]
+ i++
+ return i-1
+ return 0
+
+ tmap = (t) -> t
+
+ classifyValue = (value) ->
+ val = value
+ if _classes.length > 2
+ n = _classes.length-1
+ i = getClass(value)
+ minc = _classes[0] + (_classes[1]-_classes[0]) * (0 + _spread * 0.5) # center of 1st class
+ maxc = _classes[n-1] + (_classes[n]-_classes[n-1]) * (1 - _spread * 0.5) # center of last class
+ val = _min + ((_classes[i] + (_classes[i+1] - _classes[i]) * 0.5 - minc) / (maxc-minc)) * (_max - _min)
+ val
+
+ getColor = (val, bypassMap=false) ->
+ if isNaN(val) then return _nacol
+ if not bypassMap
+ if _classes and _classes.length > 2
+ # find the class
+ c = getClass val
+ t = c / (_classes.length-2)
+ else if _max != _min
+ # just interpolate between min/max
+ t = (val - _min) / (_max - _min)
+ else
+ t = 1
+ else
+ t = val
+
+ if not bypassMap
+ t = tmap t # lightness correction
+
+ t = pow t, _gamma if _gamma != 1
+
+ t = _padding[0] + (t * (1 - _padding[0] - _padding[1]))
+
+ t = Math.min(1, Math.max(0, t))
+
+ k = Math.floor(t * 10000)
+
+ if _useCache && _colorCache[k]
+ col = _colorCache[k]
+ else
+ if type(_colors) == 'array'
+ for i in [0.._pos.length-1]
+ p = _pos[i]
+ if t <= p
+ col = _colors[i]
+ break
+ if t >= p and i == _pos.length-1
+ col = _colors[i]
+ break
+ if t > p and t < _pos[i+1]
+ t = (t-p)/(_pos[i+1]-p)
+ col = chroma.interpolate _colors[i], _colors[i+1], t, _mode
+ break
+ else if type(_colors) == 'function'
+ col = _colors t
+ _colorCache[k] = col if _useCache
+ col
+
+ resetCache = () ->
+ _colorCache = {}
+
+ setColors colors
+
+ # public interface
+
+ f = (v) ->
+ c = chroma getColor v
+ if _out and c[_out] then c[_out]() else c
+
+ f.classes = (classes) ->
+ if classes?
+ if type(classes) == 'array'
+ _classes = classes
+ _domain = [classes[0], classes[classes.length-1]]
+ else
+ d = chroma.analyze _domain
+ if classes == 0
+ _classes = [d.min, d.max]
+ else
+ _classes = chroma.limits d, 'e', classes
+ return f
+ _classes
+
+
+ f.domain = (domain) ->
+ if not arguments.length
+ return _domain
+ _min = domain[0]
+ _max = domain[domain.length-1]
+ _pos = []
+ k = _colors.length
+ if domain.length == k and _min != _max
+ # update positions
+ for d in domain
+ _pos.push (d-_min) / (_max-_min)
+ else
+ for c in [0..k-1]
+ _pos.push c/(k-1)
+ _domain = [_min, _max]
+ f
+
+ f.mode = (_m) ->
+ if not arguments.length
+ return _mode
+ _mode = _m
+ resetCache()
+ f
+
+ f.range = (colors, _pos) ->
+ setColors colors, _pos
+ f
+
+ f.out = (_o) ->
+ _out = _o
+ f
+
+ f.spread = (val) ->
+ if not arguments.length
+ return _spread
+ _spread = val
+ f
+
+ f.correctLightness = (v=true) ->
+ _correctLightness = v
+ resetCache()
+ if _correctLightness
+ tmap = (t) ->
+ L0 = getColor(0, true).lab()[0]
+ L1 = getColor(1, true).lab()[0]
+ pol = L0 > L1
+ L_actual = getColor(t, true).lab()[0]
+ L_ideal = L0 + (L1 - L0) * t
+ L_diff = L_actual - L_ideal
+ t0 = 0
+ t1 = 1
+ max_iter = 20
+ while Math.abs(L_diff) > 1e-2 and max_iter-- > 0
+ do () ->
+ L_diff *= -1 if pol
+ if L_diff < 0
+ t0 = t
+ t += (t1 - t) * 0.5
+ else
+ t1 = t
+ t += (t0 - t) * 0.5
+ L_actual = getColor(t, true).lab()[0]
+ L_diff = L_actual - L_ideal
+ t
+ else
+ tmap = (t) -> t
+ f
+
+ f.padding = (p) ->
+ if p?
+ if type(p) == 'number'
+ p = [p,p]
+ _padding = p
+ f
+ else
+ _padding
+
+ f.colors = (numColors, out) ->
+ # If no arguments are given, return the original colors that were provided
+ out = 'hex' if arguments.length < 2
+ result = []
+
+ if arguments.length == 0
+ result = _colors.slice 0
+
+ else if numColors == 1
+ result = [f(0.5)]
+
+ else if numColors > 1
+ dm = _domain[0]
+ dd = _domain[1] - dm
+ result = [0...numColors].map (i) -> f( dm + i/(numColors-1) * dd )
+
+ else # returns all colors based on the defined classes
+ colors = []
+ samples = []
+ if _classes and _classes.length > 2
+ for i in [1..._classes.length]
+ samples.push (_classes[i-1]+_classes[i])*0.5
+ else
+ samples = _domain
+ result = samples.map (v) -> f(v)
+
+ if chroma[out]
+ result = result.map (c) -> c[out]()
+ result
+
+ f.cache = (c) ->
+ if c?
+ _useCache = c
+ f
+ else
+ _useCache
+
+ f.gamma = (g) ->
+ if g?
+ _gamma = g
+ f
+ else
+ _gamma
+
+ f
+
+# some pre-defined color scales:
+chroma.scales ?= {}
+
+chroma.scales.cool = ->
+ chroma.scale [chroma.hsl(180,1,.9), chroma.hsl(250,.7,.4)]
+
+chroma.scales.hot = ->
+ chroma.scale(['#000','#f00','#ff0','#fff'], [0,.25,.75,1]).mode('rgb')
+
+
src/node_modules/chroma-js/src/utils.coffee
+type = do ->
+ ###
+ for browser-safe type checking+
+ ported from jQuery's $.type
+ ###
+ classToType = {}
+ for name in "Boolean Number String Function Array Date RegExp Undefined Null".split(" ")
+ classToType["[object " + name + "]"] = name.toLowerCase()
+
+ (obj) ->
+ strType = Object::toString.call(obj)
+ classToType[strType] or "object"
+
+
+limit = (x, min=0, max=1) ->
+ x = min if x < min
+ x = max if x > max
+ x
+
+unpack = (args) ->
+ if args.length >= 3
+ Array.prototype.slice.call args
+ else
+ args[0]
+
+clip_rgb = (rgb) ->
+ rgb._clipped = false
+ rgb._unclipped = rgb.slice(0)
+ for i in [0...3]
+ if i < 3
+ rgb._clipped = true if rgb[i] < 0 or rgb[i] > 255
+ rgb[i] = 0 if rgb[i] < 0
+ rgb[i] = 255 if rgb[i] > 255
+ else if i == 3
+ rgb[i] = 0 if rgb[i] < 0
+ rgb[i] = 1 if rgb[i] > 1
+ delete rgb._unclipped if not rgb._clipped
+ rgb
+
+{PI, round, cos, floor, pow, log, sin, sqrt, atan2, max, abs} = Math
+TWOPI = PI*2
+PITHIRD = PI/3
+DEG2RAD = PI / 180
+RAD2DEG = 180 / PI
+
src/node_modules/chroma-js/test/alpha-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+vows
+ .describe('Tests for the alpha channel')
+
+ .addBatch
+
+ 'setting & getting alpha channel':
+ topic: chroma 'red'
+ 'no arguments gets alpha': (topic) -> assert.equal topic.alpha(), 1
+ 'setting alpha to 0.5': (topic) -> assert.equal topic.alpha(0.5).alpha(), 0.5
+ 'alpha is unchanged': (topic) -> assert.equal topic.alpha(), 1
+
+ 'interpolating alpha channel':
+ topic: chroma.mix chroma('white').alpha(0), chroma('black').alpha(1), 0.3
+ 'hex is #b3b3b3': (topic) -> assert.equal topic.hex('rgb'), '#b3b3b3'
+ 'hex with alpha': (topic) -> assert.equal topic.hex(), '#b3b3b34d'
+ 'alpha is 30%': (topic) -> assert.equal topic.alpha(), 0.3
+
+ 'constructing rgba color':
+ topic: new chroma 255,0,0,0.5,'rgb'
+ 'alpha is 50%': (topic) -> assert.equal topic.alpha(), 0.5
+
+ 'constructing rgba color, rgb shorthand':
+ topic: chroma.rgb(255,0,0,0.5)
+ 'alpha is 50%': (topic) -> assert.equal topic.alpha(), 0.5
+
+ 'constructing rgba color, hsl shorthand':
+ topic: chroma.hsl(0,1,0.5).alpha(0.5)
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 50%': (topic) -> assert.equal topic.alpha(), 0.5
+
+ 'parsing hex rgba colors':
+ topic: chroma '#ff00004d'
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 30%': (topic) -> assert.equal topic.alpha(), 0.3
+ 'rgba output': (topic) -> assert.deepEqual topic.rgba(), [255,0,0,0.3]
+
+ 'parsing rgba colors':
+ topic: chroma.css 'rgba(255,0,0,.3)'
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 30%': (topic) -> assert.equal topic.alpha(), 0.3
+ 'rgba output': (topic) -> assert.deepEqual topic.rgba(), [255,0,0,0.3]
+
+ 'parsing rgba colors (percentage)':
+ topic: chroma.css 'rgba(100%,0%,0%,0.2)'
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 20%': (topic) -> assert.equal topic.alpha(), 0.2
+ 'rgb output': (topic) -> assert.deepEqual topic.rgb(), [255,0,0]
+ 'rgba output': (topic) -> assert.deepEqual topic.rgba(), [255,0,0,0.2]
+
+ 'parsing hsla colors':
+ topic: chroma.css 'hsla(0,100%,50%,0.25)'
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 25%': (topic) -> assert.equal topic.alpha(), 0.25
+ 'rgb output': (topic) -> assert.deepEqual topic.rgb(), [255,0,0]
+ 'rgba output': (topic) -> assert.deepEqual topic.rgba(), [255,0,0,0.25]
+
+ 'constructing hsla color':
+ topic: chroma 0,1,0.5,0.25,'hsl'
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 25%': (topic) -> assert.equal topic.alpha(), 0.25
+
+ 'constructing hsva color':
+ topic: chroma 0,1,1,0.25,'hsv'
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 25%': (topic) -> assert.equal topic.alpha(), 0.25
+
+ 'constructing hsia color':
+ topic: chroma 0,1,0.3333334,0.25,'hsi'
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 25%': (topic) -> assert.equal topic.alpha(), 0.25
+
+ 'constructing laba color':
+ topic: chroma 53.24079414130722, 80.09245959641109, 67.20319651585301,0.25,'lab'
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 25%': (topic) -> assert.equal topic.alpha(), 0.25
+
+ 'constructing lcha color':
+ topic: chroma 53.24079414130722, 104.55176567686985, 39.99901061253297,0.25,'lch'
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 25%': (topic) -> assert.equal topic.alpha(), 0.25
+
+ 'constructing cmyka color':
+ topic: chroma 0,1,1,0,0.25,'cmyk'
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 25%': (topic) -> assert.equal topic.alpha(), 0.25
+
+ 'gl output':
+ topic: chroma.gl 1, 0, 0, 0.25
+ 'color is red': (topic) -> assert.equal topic.name(), 'red'
+ 'alpha is 25%': (topic) -> assert.equal topic.alpha(), 0.25
+ 'gloutput': (topic) -> assert.deepEqual topic.gl(), [1, 0, 0, 0.25]
+
+ 'rgba css output':
+ topic: chroma.css 'hsla(0,100%,50%,0.25)'
+ 'cssoutput': -> (topic) -> assert.equal topic.css(), 'rgba(255,0,0,0.25)'
+
+ 'hex output':
+ topic: chroma.gl 1, 0, 0, 0.25
+ 'hex': (topic) -> assert.equal topic.hex(), '#ff000040'
+ 'rgb': (topic) -> assert.equal topic.hex('rgb'), '#ff0000'
+ 'rgba': (topic) -> assert.equal topic.hex('rgba'), '#ff000040'
+ 'argb': (topic) -> assert.equal topic.hex('argb'), '#40ff0000'
+
+ 'num output':
+ topic: chroma.gl 1, 0, 0, 0.25
+ 'num ignores alpha': (topic) -> assert.equal topic.num(), 0xff0000
+
+ 'setting alpha returns new instance':
+ topic: chroma('red')
+ 'set alpha to 0.5': (topic) ->
+ topic.alpha(0.5)
+ assert.equal topic.alpha(), 1
+
+ .export(module)
src/node_modules/chroma-js/test/analyze-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+vows
+ .describe('Some tests for chroma.analyze()')
+
+ .addBatch
+ 'analyze an array of numbers':
+ topic: chroma.analyze [1,2,2,3,4,5]
+ 'sum is 17': (topic) -> assert.equal topic.sum, 17
+ 'count is 6': (topic) -> assert.equal topic.count, 6
+ 'maximum is 5': (topic) -> assert.equal topic.max, 5
+ 'minumum is 1': (topic) -> assert.equal topic.min, 1
+ 'domain is [1,5]': (topic) -> assert.deepEqual topic.domain, [1,5]
+
+ 'analyze an object of numbers':
+ topic: chroma.analyze {a: 1, b: 2, c: 2, d: 3, e: 4, f: 5}
+ 'sum is 17': (topic) -> assert.equal topic.sum, 17
+ 'count is 6': (topic) -> assert.equal topic.count, 6
+ 'maximum is 5': (topic) -> assert.equal topic.max, 5
+ 'minumum is 1': (topic) -> assert.equal topic.min, 1
+ 'domain is [1,5]': (topic) -> assert.deepEqual topic.domain, [1,5]
+
+ 'analyze an array of objects':
+ topic: chroma.analyze [{ k: 1 }, { k: 2 }, { k: 2 }, { k: 3 }, { k: 4 }, { k: 5 }], 'k'
+ 'sum is 17': (topic) -> assert.equal topic.sum, 17
+ 'count is 6': (topic) -> assert.equal topic.count, 6
+ 'maximum is 5': (topic) -> assert.equal topic.max, 5
+ 'minumum is 1': (topic) -> assert.equal topic.min, 1
+ 'domain is [1,5]': (topic) -> assert.deepEqual topic.domain, [1,5]
+
+ 'analyze an object of objects':
+ topic: chroma.analyze { a: { k: 1 }, b: { k: 2 }, c: { k: 2 }, d: { k: 3 }, e: { k: 4 }, f: { k: 5 }}, 'k'
+ 'sum is 17': (topic) -> assert.equal topic.sum, 17
+ 'count is 6': (topic) -> assert.equal topic.count, 6
+ 'maximum is 5': (topic) -> assert.equal topic.max, 5
+ 'minumum is 1': (topic) -> assert.equal topic.min, 1
+ 'domain is [1,5]': (topic) -> assert.deepEqual topic.domain, [1,5]
+ .export(module)
src/node_modules/chroma-js/test/average-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+colors = [[125,133,127], [131,127,134], [138,121,141], [144,114,147], [149,107,153],
+ [165,83,170], [160,92,164], [170,73,175], [175,62,180], [155,100,159]]
+
+vows
+ .describe('Testing color averaging modes')
+ .addBatch
+ 'avg some colors':
+ topic: ['red', 'blue']
+ 'is #5a0000': (topic) -> assert.equal chroma.average(topic).hex(), chroma.mix(topic[0], topic[1]).hex()
+ 'three colors':
+ topic: chroma.average(['blue', 'red', 'white'])
+ 'is #5a0000': (topic) -> assert.equal topic.hex(), '#aa55aa'
+ 'alpha avg':
+ topic: chroma.average(['rgba(0,0,0,0)', 'red'])
+ 'is #5a0000': (topic) -> assert.deepEqual topic.rgba(), [128, 0, 0, 0.5]
+ 'is #5a0000-2': (topic) -> assert.deepEqual topic.rgba(false), [127.5, 0, 0, 0.5]
+ 'average in lab':
+ topic: chroma.average(['blue', 'red', 'white'], 'lab')
+ 'is #5a0000': (topic) -> assert.equal topic.hex(), '#e26daf'
+ 'average h in lch':
+ topic: chroma.average([chroma.lch(50, 50, 0), chroma.lch(50, 50, 90)], 'lch').get('lch.h')
+ 'is approximately 45': (topic) -> assert.equal Math.round(topic), 45
+ 'average in hsl of same colors':
+ topic: chroma.average(['#02c03a', '#02c03a'], 'hsl')
+ 'is same': (topic) -> assert.equal topic.hex(), '#02c03a'
+ 'average same color':
+ topic: chroma.average(["#02c03a", "#02c03a"],'hsl')
+ 'is #02c03a': (topic) -> assert.equal topic.hex(), '#02c03a'
+ 'lrgb avergage':
+ topic: chroma.average(colors, 'lrgb')
+ 'is ???': (topic) -> assert.equal topic.hex(), '#9b649f'
+
+ .export(module)
src/node_modules/chroma-js/test/bezier-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+vows
+ .describe('Testing bezier interpolation')
+
+ .addBatch
+
+ 'simple two color linear interpolation':
+ topic:
+ f: chroma.bezier ['white', 'black']
+ 'starts from white': (topic) -> assert.equal topic.f(0).hex(), '#ffffff'
+ 'ends in black': (topic) -> assert.equal topic.f(1).hex(), '#000000'
+ 'center is grey': (topic) -> assert.equal topic.f(0.5).hex(), '#777777'
+
+ 'three color quadratic bezier interpolation':
+ topic:
+ f: chroma.bezier ['white', 'red', 'black']
+ 'starts from white': (topic) -> assert.equal topic.f(0).hex(), '#ffffff'
+ 'ends in black': (topic) -> assert.equal topic.f(1).hex(), '#000000'
+ 'center is a greyish red': (topic) -> assert.equal topic.f(0.5).hex(), '#c45c44'
+
+ 'four color cubic bezier interpolation':
+ topic:
+ f: chroma.bezier ['white', 'yellow', 'red', 'black']
+ 'starts from white': (topic) -> assert.equal topic.f(0).hex(), '#ffffff'
+ 'ends in black': (topic) -> assert.equal topic.f(1).hex(), '#000000'
+ '1st quarter': (topic) -> assert.equal topic.f(0.25).hex(), '#ffe085'
+ 'center': (topic) -> assert.equal topic.f(0.5).hex(), '#e69735'
+ '3rd quarter': (topic) -> assert.equal topic.f(0.75).hex(), '#914213'
+
+ 'five color diverging quadratic bezier interpolation':
+ topic:
+ f: chroma.bezier ['darkred', 'orange', 'snow', 'lightgreen', 'royalblue']
+ 'starts from darkred': (topic) -> assert.equal topic.f(0).hex(), '#8b0000'
+ 'ends in royalblue': (topic) -> assert.equal topic.f(1).hex(), '#4169e1'
+ 'center is snow': (topic) -> assert.equal topic.f(0.5).hex(), '#fffafa'
+ '1st quarter': (topic) -> assert.equal topic.f(0.25).hex(), '#e9954e'
+ '3rd quarter': (topic) -> assert.equal topic.f(0.75).hex(), '#a6cfc1'
+
+ 'using bezier in a chroma.scale':
+ topic:
+ f: chroma.scale(chroma.bezier(['darkred', 'orange', 'snow', 'lightgreen', 'royalblue'])).domain([0,1],5).out('hex')
+ 'starts from darkred': (topic) -> assert.equal topic.f(0), '#8b0000'
+ 'ends in royalblue': (topic) -> assert.equal topic.f(1), '#4169e1'
+ 'center is snow': (topic) -> assert.equal topic.f(0.5), '#fffafa'
+ '1st quarter': (topic) -> assert.equal topic.f(0.25), '#e9954e'
+ '3rd quarter': (topic) -> assert.equal topic.f(0.75), '#a6cfc1'
+
+ .export(module)
src/node_modules/chroma-js/test/blend-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+vows
+ .describe('Testing blend modes')
+ .addBatch
+ 'multiply 1':
+ topic: chroma.blend 'red', '#5a9f37', 'multiply'
+ 'is #5a0000': (topic) -> assert.equal topic.hex(), '#5a0000'
+
+ 'multiply 2':
+ topic: chroma.blend '#33b16f', '#857590', 'multiply'
+ 'is #1a513e': (topic) -> assert.equal topic.hex(), '#1b513f'
+
+ 'screen':
+ topic: chroma.blend '#b83d31', '#0da671', 'screen'
+ 'is #bbbb8c': (topic) -> assert.equal topic.hex(), '#bcbb8c'
+
+ 'overlay':
+ topic: chroma.blend '#b83d31', '#0da671', 'overlay'
+ 'is #784f2b': (topic) -> assert.equal topic.hex(), '#784f2b'
+
+ .export(module)
src/node_modules/chroma-js/test/cache-performance.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+
+s = chroma.scale('RdYlGn')
+ .mode('lab')
+ .domain([0,100000], 10)
+
+t0 = new Date().getTime()
+
+for i in [1..100000]
+ s(i).hex()
+
+t1 = new Date().getTime()
+
+console.log (t1 - t0) + "ms"
src/node_modules/chroma-js/test/cmyk-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+round = (digits) ->
+ d = Math.pow 10,digits
+ return (v) ->
+ Math.round(v*d) / d
+
+vows
+ .describe('Testing CMYK color conversions')
+ .addBatch
+
+ 'export simple colors to CMYK':
+ topic: ['black','white','red','#0f0','blue','yellow','cyan','magenta','gray']
+ 'black': (t) -> assert.deepEqual chroma(t[0]).cmyk(), [0,0,0,1]
+ 'white': (t) -> assert.deepEqual chroma(t[1]).cmyk(), [0,0,0,0]
+ 'red': (t) -> assert.deepEqual chroma(t[2]).cmyk(), [0,1,1,0]
+ 'green': (t) -> assert.deepEqual chroma(t[3]).cmyk(), [1,0,1,0]
+ 'blue': (t) -> assert.deepEqual chroma(t[4]).cmyk(), [1,1,0,0]
+ 'yellow': (t) -> assert.deepEqual chroma(t[5]).cmyk(), [0,0,1,0]
+ 'cyan': (t) -> assert.deepEqual chroma(t[6]).cmyk(), [1,0,0,0]
+ 'magenta': (t) -> assert.deepEqual chroma(t[7]).cmyk(), [0,1,0,0]
+ 'gray': (t) -> assert.deepEqual chroma(t[8]).cmyk().map(round(4)), [0,0,0,0.498]
+
+ 'parse simple CMYK colors':
+ topic: [[0,0,0,1],[0,0,0,0],[0,1,1,0],[1,0,1,0],[1,1,0,0],[0,0,1,0],[1,0,0,0],[0,1,0,0]]
+ 'black': (t) -> assert.equal chroma(t[0], 'cmyk').hex(), '#000000'
+ 'white': (t) -> assert.equal chroma(t[1], 'cmyk').hex(), '#ffffff'
+ 'red': (t) -> assert.equal chroma(t[2], 'cmyk').hex(), '#ff0000'
+ 'green': (t) -> assert.equal chroma(t[3], 'cmyk').hex(), '#00ff00'
+ 'blue': (t) -> assert.equal chroma(t[4], 'cmyk').hex(), '#0000ff'
+ 'yellow': (t) -> assert.equal chroma(t[5], 'cmyk').hex(), '#ffff00'
+ 'cyan': (t) -> assert.equal chroma(t[6], 'cmyk').hex(), '#00ffff'
+ 'magenta': (t) -> assert.equal chroma(t[7], 'cmyk').hex(), '#ff00ff'
+
+ 'alternative syntax':
+ topic: [1,0,1,0]
+ 'array-mode': (cmyk) -> assert.equal chroma(cmyk, 'cmyk').hex(), '#00ff00'
+ 'values-mode': (cmyk) -> assert.equal chroma(cmyk...,'cmyk').hex(), '#00ff00'
+ 'shortcut 1': (cmyk) -> assert.equal chroma.cmyk(cmyk).hex(), '#00ff00'
+ 'shortcut 2': (cmyk) -> assert.equal chroma.cmyk(cmyk...).hex(), '#00ff00'
+
+ .export(module)
src/node_modules/chroma-js/test/colors-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+round = (digits) ->
+ d = Math.pow 10,digits
+ return (v) ->
+ Math.round(v*d) / d
+
+vows
+ .describe('Some tests for chroma.color()')
+
+ .addBatch
+
+ 'hsv black':
+ topic: chroma('black').hsv()
+ 'hue is NaN': (topic) -> assert isNaN topic[0]
+ 'but hue is defined': (topic) -> assert topic[0]?
+
+ 'toString':
+ topic: chroma 'greenyellow'
+ 'explicit': (topic) -> assert.equal topic.toString(), '#adff2f'
+ 'implicit': (topic) -> assert.equal ''+topic, '#adff2f'
+ 'implicit2': (topic) -> assert.equal String(topic), '#adff2f'
+
+ 'constructing numeric color':
+ topic: chroma.num 0xadff2f
+ 'color is red': (topic) -> assert.equal topic.name(), 'greenyellow'
+ 'alpha is 100%': (topic) -> assert.equal topic.alpha(), 1
+
+ 'normalize hue':
+ topic: chroma.rgb(0,255,255).lch()
+ 'hue > 0': (topic) -> assert topic[2] >= 0
+ 'hue < 360': (topic) -> assert topic[2] <= 360
+
+ 'lab conversion red':
+ topic: chroma('red').lab().map(round(3))
+ 'is right': (topic) -> assert.deepEqual topic, [53.241, 80.092, 67.203]
+
+ 'lab conversion blue':
+ topic: chroma('blue').lab().map(round(3))
+ 'is right': (topic) -> assert.deepEqual topic, [32.297, 79.188, -107.86]
+
+ 'lab conversion green':
+ topic: chroma('green').lab().map(round(3))
+ 'is right': (topic) -> assert.deepEqual topic, [46.227, -51.698, 49.897]
+
+ 'lab conversion yellow':
+ topic: chroma('yellow').lab().map(round(3))
+ 'is right': (topic) -> assert.deepEqual topic, [97.139, -21.554, 94.478]
+
+ 'lab conversion magenta':
+ topic: chroma('magenta').lab().map(round(3))
+ 'is right': (topic) -> assert.deepEqual topic, [60.324, 98.234, -60.825]
+
+ 'hueless css hsl colors':
+ topic: [chroma('black'), chroma('gray'), chroma('white')]
+ 'black': (topic) -> assert.equal topic[0].css('hsl'), 'hsl(0,0%,0%)'
+ 'gray': (topic) -> assert.equal topic[1].css('hsl'), 'hsl(0,0%,50.2%)'
+ 'white': (topic) -> assert.equal topic[2].css('hsl'), 'hsl(0,0%,100%)'
+
+ 'hcl.h is NaN for hue-less colors':
+ topic: [chroma('black'), chroma('gray'), chroma('white')]
+ 'black': (topic) -> assert.isNaN topic[0].hcl()[0]
+ 'gray': (topic) -> assert.isNaN topic[1].hcl()[0]
+ 'white': (topic) -> assert.isNaN topic[2].hcl()[0]
+
+ 'lab-rgb precision':
+ topic: [74, 24, 78],
+ 'to_rgb_to_lab': (topic) -> assert.deepEqual chroma.rgb(chroma.lab(topic).rgb(false)).lab().map(round(3)), topic
+
+ 'cmyk-rgb precision':
+ topic: [0, 1, 1, 0.02],
+ 'to_rgb_to_cmyk': (topic) -> assert.deepEqual chroma.rgb(chroma.cmyk(topic).rgb(false)).cmyk().map(round(3)), topic
+
+ 'auto-detect rgba in hex output':
+ topic: ['rgba(255,0,0,1)', 'rgba(255,0,0,0.5)']
+ 'rgb if alpha == 1': (topic) -> assert.equal chroma(topic[0]).hex(), '#ff0000'
+ 'rgba if alpha != 1': (topic) -> assert.equal chroma(topic[1]).hex(), '#ff000080'
+
+ .export(module)
src/node_modules/chroma-js/test/contrast-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+vows
+ .describe('Testing contrast ratio')
+
+ .addBatch
+
+ 'maximum contrast':
+ topic: chroma.contrast 'black', 'white'
+ 'is 21:1': (topic) -> assert.equal topic, 21
+
+ 'minimum contrast':
+ topic: chroma.contrast 'white', 'white'
+ 'is 1:1': (topic) -> assert.equal topic, 1
+
+ 'contrast between white and red':
+ topic: chroma.contrast 'red', 'white'
+ 'is 4:1': (topic) -> assert.equal Math.round(topic,5), 4
+ .export(module)
src/node_modules/chroma-js/test/converters-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+test = vows.describe('Testing color conversions')
+
+for k of chroma.colors
+ test.addBatch
+ k:
+ topic: chroma.colors[k]
+ 'to hsl and back': (t) -> assert.equal chroma.hsl(chroma(t).hsl()).hex(), t
+ 'to cmyk and back': (t) -> assert.equal chroma.cmyk(chroma(t).cmyk()).hex(), t
+ 'to css and back': (t) -> assert.equal chroma.css(chroma(t).css()).hex(), t
+ 'to hsi and back': (t) -> assert.equal chroma.hsi(chroma(t).hsi()).hex(), t
+ 'to hsl and back': (t) -> assert.equal chroma.hsl(chroma(t).hsl()).hex(), t
+ 'to hsv and back': (t) -> assert.equal chroma.hsv(chroma(t).hsv()).hex(), t
+ 'to lab and back': (t) -> assert.equal chroma.lab(chroma(t).lab()).hex(), t
+ 'to lch and back': (t) -> assert.equal chroma.lch(chroma(t).lch()).hex(), t
+ 'to num and back': (t) -> assert.equal chroma.num(chroma(t).num()).hex(), t
+test.export(module)
src/node_modules/chroma-js/test/cubehelix-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+vows
+ .describe('Testing cubehelix scales')
+
+ .addBatch
+
+ 'default helix':
+ topic: () -> chroma.cubehelix()
+ 'starts in black': (t) -> assert.equal t(0).hex(), '#000000'
+ 'at 0.25': (t) -> assert.equal t(0.25).hex(), '#16534c'
+ 'at 0.5': (t) -> assert.equal t(0.5).hex(), '#a07949'
+ 'at 0.75': (t) -> assert.equal t(0.75).hex(), '#c7b3ed'
+ 'ends in white': (t) -> assert.equal t(1).hex(), '#ffffff'
+
+ 'red helix':
+ topic: () -> chroma.cubehelix(0, 1, 1, 1)
+ 'starts in black': (t) -> assert.equal t(0).hex(), '#000000'
+ 'at 0.25': (t) -> assert.equal t(0.25).hex(), '#2e5117'
+ 'at 0.5': (t) -> assert.equal t(0.5).hex(), '#4c949f'
+ 'at 0.75': (t) -> assert.equal t(0.75).hex(), '#d1aee8'
+ 'ends in white': (t) -> assert.equal t(1).hex(), '#ffffff'
+
+ 'red helix - partial l range':
+ topic: () -> chroma.cubehelix(0, 1, 1, 1, [0.25, 0.75])
+ 'starts': (t) -> assert.equal t(0).hex(), '#663028'
+ 'at 0.25': (t) -> assert.equal t(0.25).hex(), '#49752d'
+ 'at 0.5': (t) -> assert.equal t(0.5).hex(), '#4c949f'
+ 'at 0.75': (t) -> assert.equal t(0.75).hex(), '#b68ad2'
+ 'ends': (t) -> assert.equal t(1).hex(), '#e6b0a8'
+
+ 'red helix - gamma':
+ topic: () -> chroma.cubehelix(0, 1, 1, 0.8, [0,1])
+ 'starts in black': (t) -> assert.equal t(0).hex(), '#000000'
+ 'at 0.25': (t) -> assert.equal t(0.25).hex(), '#3f6824'
+ 'at 0.5': (t) -> assert.equal t(0.5).hex(), '#60a6b1'
+ 'at 0.75': (t) -> assert.equal t(0.75).hex(), '#dabcee'
+ 'ends in white': (t) -> assert.equal t(1).hex(), '#ffffff'
+
+ 'red helix - no saturation':
+ topic: () -> chroma.cubehelix(0, 1, 0, 1, [0,1])
+ 'starts in black': (t) -> assert.equal t(0).hex(), '#000000'
+ 'at 0.25': (t) -> assert.equal t(0.25).hex(), '#404040'
+ 'at 0.5': (t) -> assert.equal t(0.5).hex(), '#808080'
+ 'at 0.75': (t) -> assert.equal t(0.75).hex(), '#bfbfbf'
+ 'ends in white': (t) -> assert.equal t(1).hex(), '#ffffff'
+
+ 'red helix - saturation range':
+ topic: () -> chroma.cubehelix(0, 1, [1,0], 1, [0,1])
+ 'starts in black': (t) -> assert.equal t(0).hex(), '#000000'
+ 'at 0.25': (t) -> assert.equal t(0.25).hex(), '#324c21'
+ 'at 0.5': (t) -> assert.equal t(0.5).hex(), '#668a8f'
+ 'at 0.75': (t) -> assert.equal t(0.75).hex(), '#c4bbc9'
+ 'ends in white': (t) -> assert.equal t(1).hex(), '#ffffff'
+ 'saturation decreases': (t) -> assert t(0.33).hsl()[1] > t(0.66).hsl()[1]
+
+ 'non-array lightness':
+ topic: () -> chroma.cubehelix(300, -1.5, 1, 1, 0.5)
+ 'start': (t) -> assert.equal t(0).hex(), '#ae629f'
+ 'at 0.5': (t) -> assert.equal t(0.5).hex(), '#a07949'
+ 'end': (t) -> assert.equal t(1).hex(), '#519d60'
+
+ .export(module)
src/node_modules/chroma-js/test/get-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+vows
+ .describe('Testing color.get')
+ .addBatch
+ 'get hue':
+ topic: chroma 'hotpink'
+ 'hue not zero': (topic) -> assert.equal topic.hsl()[0], topic.get('hsl.h')
+
+
+ .export(module)
src/node_modules/chroma-js/test/gl-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+vows
+ .describe('Some tests for gl colors')
+
+ .addBatch
+
+ 'gl color':
+ topic: chroma.gl 1,0,0
+ 'name': (topic) -> assert.equal topic.name(), 'red'
+ 'hex': (topic) -> assert.equal topic.hex(), '#ff0000'
+ 'rgb': (topic) -> assert.deepEqual topic.rgb(), [255,0,0]
+
+ 'gl color non-1':
+ topic: chroma.gl 1,0.5,0.2
+ 'hex': (topic) -> assert.equal topic.hex(), '#ff8033'
+ 'rgb': (topic) -> assert.deepEqual topic.rgb(), [255,128,51]
+ 'rgb- no rounding': (topic) -> assert.deepEqual topic.rgb(false), [255,127.5,51]
+
+ 'gl color w/ alpha':
+ topic: chroma.gl 0,0,1,0.5
+ 'rgba': (topic) -> assert.deepEqual topic.rgba(), [0,0,255,0.5]
+
+ .export(module)
src/node_modules/chroma-js/test/guess-format-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+round = (digits) ->
+ d = Math.pow 10,digits
+ return (v) ->
+ Math.round(v*d) / d
+
+vows
+ .describe('Some tests for chroma.color()')
+
+ .addBatch
+
+ 'named colors':
+ topic: chroma 'red'
+ 'hex': (topic) -> assert.equal topic.hex(), '#ff0000'
+ 'rgb': (topic) -> assert.deepEqual topic.rgb(), [255,0,0]
+
+ 'hex colors':
+ topic: chroma '#f00'
+ 'name': (topic) -> assert.equal topic.name(), 'red'
+ 'hex': (topic) -> assert.equal topic.hex(), '#ff0000'
+ 'hex rgba': (topic) -> assert.equal topic.hex('rgba'), '#ff0000ff'
+ 'hex argb': (topic) -> assert.equal topic.hex('argb'), '#ffff0000'
+ 'rgb': (topic) -> assert.deepEqual topic.rgb(), [255,0,0]
+
+ 'hex color, no #':
+ topic: chroma 'F00'
+ 'name': (topic) -> assert.equal topic.name(), 'red'
+ 'hex': (topic) -> assert.equal topic.hex(), '#ff0000'
+ 'rgb': (topic) -> assert.deepEqual topic.rgb(), [255,0,0]
+
+ 'css color rgb':
+ topic: chroma 'rgb(255,0,0)'
+ 'hex': (topic) -> assert.equal topic.hex(), '#ff0000'
+
+ 'rgba css color':
+ topic: chroma 'rgba(128,0,128,0.5)'
+ 'hex': (topic) -> assert.equal topic.hex(), '#80008080'
+ 'hex rgb': (topic) -> assert.equal topic.hex('rgb'), '#800080'
+ 'alpha': (topic) -> assert.equal topic.alpha(), 0.5
+ 'css': (topic) -> assert.equal topic.css(), 'rgba(128,0,128,0.5)'
+
+ 'hsla css color':
+ topic: chroma 'hsla(240,100%,50%,0.5)'
+ 'hex': (topic) -> assert.equal topic.hex(), '#0000ff80'
+ 'hex rgb': (topic) -> assert.equal topic.hex('rgb'), '#0000ff'
+ 'alpha': (topic) -> assert.equal topic.alpha(), 0.5
+ 'css': (topic) -> assert.equal topic.css(), 'rgba(0,0,255,0.5)'
+
+ 'hsla color':
+ topic: chroma 'lightsalmon'
+ 'css (default)': (topic) -> assert.equal topic.css(), 'rgb(255,160,122)'
+ 'css (rgb)': (topic) -> assert.equal topic.css('rgb'), 'rgb(255,160,122)'
+ 'css (hsl)': (topic) -> assert.equal chroma(topic.css('hsl')).name(), 'lightsalmon'
+ 'css (rgb-css)': (topic) -> assert.equal chroma(topic.css('rgb')).name(), 'lightsalmon'
+
+ 'rgb color':
+ topic: chroma 255,0,0
+ 'hex': (topic) -> assert.equal topic.hex(), '#ff0000'
+
+ 'hsv black':
+ topic: chroma('black').hsv()
+ 'hue is NaN': (topic) -> assert isNaN topic[0]
+ 'but hue is defined': (topic) -> assert topic[0]?
+
+ 'hsl black':
+ topic: chroma('black').hsl()
+ 'hue is NaN': (topic) -> assert isNaN topic[0]
+ 'but hue is defined': (topic) -> assert topic[0]?
+ 'sat is 0': (topic) -> assert.equal topic[1], 0
+ 'lightness is 0': (topic) -> assert.equal topic[2], 0
+
+ 'constructing with array, but no mode':
+ topic: chroma [255, 0, 0]
+ 'falls back to rgb': (topic) -> assert.equal topic.hex(), chroma([255, 0, 0],'rgb').hex()
+
+ 'num color':
+ topic: [chroma(0xff0000), chroma(0x000000), chroma(0xffffff), chroma(0x31ff98), chroma('red')]
+ 'hex': (topic) -> assert.equal topic[0].hex(), '#ff0000'
+ 'num': (topic) -> assert.equal topic[0].num(), 0xff0000
+ 'hex-black': (topic) -> assert.equal topic[1].hex(), '#000000'
+ 'num-black': (topic) -> assert.equal topic[1].num(), 0x000000
+ 'hex-white': (topic) -> assert.equal topic[2].hex(), '#ffffff'
+ 'num-white': (topic) -> assert.equal topic[2].num(), 0xffffff
+ 'hex-rand': (topic) -> assert.equal topic[3].hex(), '#31ff98'
+ 'num-rand': (topic) -> assert.equal topic[3].num(), 0x31ff98
+ 'rum-red': (topic) -> assert.equal topic[4].num(), 0xff0000
+
+
+ .export(module)
src/node_modules/chroma-js/test/html/bezier.html
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Bezier Interpolation</title>
+ <script type="text/javascript" src="../../chroma.js"></script>
+</head>
+<body>
+
+ <script type="text/javascript">
+
+ function showGradient(I, outerdiv, steps) {
+ var I = chroma.interpolate.bezier(c),
+ c = document.createElement('div'),
+ totalW = 800;
+ for (var i=0; i < steps; i++) {
+ var d = document.createElement('div');
+ d.style.display = 'inline-block';
+ d.style.width = (totalW / steps) + 'px';
+ d.style.height = '60px';
+ d.style.background = I(i/(steps-1)).hex();
+ c.appendChild(d);
+ }
+ outerdiv.appendChild(c);
+ }
+
+ var colors = [
+ ['white', 'black'],
+ ['white', 'red', 'black'],
+ ['white', 'yellow', 'red', 'black'],
+ ['red', 'white', 'blue'],
+ ['#fdfdf9', 'darkred'],
+ ['#fdfdf9', 'orange', 'darkred'],
+ ['#fdfdf9', 'yellow', 'orange', 'darkred'],
+ ['darkred', 'orange', 'snow', 'lightgreen', 'royalblue'],
+ ];
+
+ for (var c in colors) {
+ c = colors[c];
+ d = document.createElement('div');
+ d.style.position = 'relative';
+ document.body.appendChild(d);
+ d.innerHTML = "<div style='position:absolute;top:5px;left:10px;opacity:0.9;color:#000;text-shadow:-1px -1px 0px rgba(255,255,255,0.3), 1px 1px 0px rgba(255,255,255,0.3), -1px 1px 0px rgba(255,255,255,0.3), 1px -1px 0px rgba(255,255,255,0.3)'><code>" + c + "</code></div>";
+ showGradient(colors, d, 13);
+ }
+
+
+
+ </script>
+</body>
+</html>
src/node_modules/chroma-js/test/html/blend.html
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Chroma.js</title>
+ <script type="text/javascript" src="../../chroma.js"></script>
+</head>
+<style type="text/css">
+ body { font-family: Helvetica; }
+ h1 { font-size: 18px; }
+ .row { margin-bottom: 10px; }
+ .left, .right { display: inline-block; margin-right: 20px; position: relative; }
+ .swatch { display: inline-block; width: 60px; height: 50px; }
+ .swatch.overlay { position: absolute; left: 60px; }
+</style>
+<body>
+
+
+ <script type="text/javascript">
+
+ var names = Object.keys(chroma.colors), l = names.length;
+
+ var cssMap = {
+ dodge: 'color-dodge',
+ burn: 'color-burn'
+ };
+
+ Object.keys(chroma.blend).forEach(function(mode) {
+
+ document.write('<h1>'+mode+'</h1>');
+ for (var i=0; i<10; i++) {
+ var row = el('div.row'),
+ left = el('div.left'),
+ right = el('div.right');
+
+ var bottom = names[Math.floor(Math.random()*l)],
+ top = names[Math.floor(Math.random()*l)];
+
+ swatch(bottom, left);
+ swatch(chroma.blend(bottom, top, mode).hex(), left);
+ swatch(top, left);
+
+ swatch(bottom, right);
+ swatch(bottom, right);
+ var s = swatch(top, right);
+ s.className = 'swatch overlay';
+ s.style.mixBlendMode = cssMap[mode] || mode;
+ swatch(top, right);
+ }
+
+ });
+
+ function swatch(color, parent) {
+ var s = el('div.swatch', parent);
+ s.setAttribute('title', color);
+ s.style.background = color;
+ return s;
+ }
+
+ function el(t, parent) {
+ var p = t.split('.');
+ var e = document.createElement(p[0]);
+ if (p[1]) e.className = p[1];
+ (parent || document.body).appendChild(e);
+ return e;
+ }
+
+ </script>
+</body>
+</html>
src/node_modules/chroma-js/test/html/colorscales.html
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Chroma.js</title>
+ <script type="text/javascript" src="../chroma.js"></script>
+</head>
+<body>
+
+ <script type="text/javascript">
+
+ function showScale(cs, outerdiv, log) {
+ cs.out('hex');
+ var c = document.createElement('div');
+ for (var i=0; i<= 1; i += 0.002) {
+ var d = document.createElement('div');
+ d.style.display = 'inline-block';
+ d.style.width = '2px';
+ d.style.height = '60px';
+ d.style.background = cs(log ? Math.pow(10, i * 3): i);
+ c.appendChild(d);
+ }
+ outerdiv.appendChild(c);
+ }
+
+ var scales = [
+ "scale(['lightyellow', 'navy'])",
+ "scale(['lightyellow', 'navy']).mode('lab')",
+ "scale(['lightyellow', 'navy']).mode('lch')",
+ "scale(['lightyellow', 'navy']).mode('hsv')",
+ "scale(['lightyellow', 'navy']).mode('hsl')",
+ "scale(['lightyellow', 'navy']).mode('hsi')",
+ "scale(['white', 'darkred']).mode('lab')",
+ "scale(['white', 'yellow', 'orange', 'darkred']).mode('lab')",
+ "scale(['darkred', 'orange', 'snow', 'lightgreen', 'royalblue']).mode('lab')",
+ "scale('RdYlGn').domain([0, 1], 9)",
+ "scale('RdYlGn')",
+ "scale(['#A50026', '#FFFFBF', '#006837']).mode('lab')",
+ "scale(['#A50026', '#FFFFBF', '#006837']).mode('lch')",
+ "scale(['#A50026', '#FFFFBF', '#006837']).mode('hsv')",
+ "scale(['#A50026', '#FFFFBF', '#006837']).mode('rgb')",
+ "scale(['#A50026', '#FFFFBF', '#006837']).mode('hsl')",
+ "scale(['#A50026', '#FFFFBF', '#006837']).mode('hsi')",
+ "scale(['#ffeeef', '#CD002F', '#400001']).domain([0,1], 9).mode('lab')",
+ "scale(['#ffeeef', '#CD002F', '#400001']).domain([0,1], 9).mode('lch')",
+ "scale(['#ffeeef', '#CD002F', '#400001']).domain([0,1], 9).mode('rgb')",
+ "scale(['#ffeeef', '#CD002F', '#400001']).domain([0,1], 9).mode('hsv')",
+ "scale(['#ffeeef', '#CD002F', '#400001']).domain([0,1], 9).mode('hsl')",
+ "scale(['#ffffff', '#000000']).domain([0,1], 9).mode('lab')",
+ "scale(['#ffffff', '#000000']).domain([0,1], 9).mode('lch')",
+ "scale(['#ffffff', '#000000']).domain([0,1], 9).mode('rgb')",
+ "scale(['#ffffff', '#000000']).domain([0,1], 9).mode('hsv')",
+ "scale(['#ffffff', '#000000']).domain([1,1000], 9, 'log').mode('hsl')",
+ "scale('RdYlGn').domain([0,1], 7).mode('lab')",
+ "scale(['a01','F7F7F7','25a']).domain([0, 0.14285714285714285, 0.2857142857142857, 0.42857142857142855, 0.5714285714285714, 0.7142857142857143, 0.8571428571428571, 1]).mode('lab')",
+ "scale(['a01','F7F7F7','25a']).domain([0,.05,.13,.2,.4,.6,.8,1]).mode('lab')",
+ "scale(['a01','F7F7F7','25a']).domain([0,.05,.13,.2,.4,.6,.8,1]).fixed(true).mode('lab')",
+ ];
+
+ for (var s in scales) {
+ s = scales[s];
+ d = document.createElement('div');
+ d.style.position = 'relative';
+ document.body.appendChild(d);
+ d.innerHTML = "<div style='position:absolute;top:5px;left:10px;opacity:0.9;color:#000;text-shadow:-1px -1px 0px rgba(255,255,255,0.3), 1px 1px 0px rgba(255,255,255,0.3), -1px 1px 0px rgba(255,255,255,0.3), 1px -1px 0px rgba(255,255,255,0.3)'><code>chroma." + s + "</code></div>";
+ showScale(eval("chroma." + s), d, s.indexOf("log") > 0);
+ }
+
+
+
+ </script>
+</body>
+</html>
src/node_modules/chroma-js/test/html/cubehelix.html
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Cubejelix Interpolation</title>
+ <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
+ <script type="text/javascript" src="../../chroma.js"></script>
+ <style type="text/css">
+input[type=number] { width: 40px; }
+ </style>
+</head>
+<body>
+ start <input type="number" id="start" value="300" step="20" />
+ rotations <input type="number" id="rot" value="-1.5" step="0.1" />
+ gamma <input type="number" id="gamma" value="1" step="0.1" />
+ l min/max <input type="number" id="lmin" value="0" step="0.1" min="0" />
+ <input type="number" id="lmax" value="1" step="0.1" max="1" />
+ sat min/max <input type="number" id="smin" value="1" step="0.1" min="0" />
+ <input type="number" id="smax" value="1" step="0.1" min="0" />
+
+<hr>
+ <script type="text/javascript">
+
+ $('input').on('change', update);
+
+ function v(id) { return +$('#'+id).val(); }
+
+ var j = 0;
+
+ function update() {
+ var steps = 200,
+ totalW = 800;
+ var sat = [v('smin'), v('smax')];
+ $('.scale').remove();
+ var ch = chroma.cubehelix(
+ v('start'),
+ v('rot'),
+ sat[0] != sat[1] ? sat : sat[0],
+ v('gamma'),
+ [v('lmin'), v('lmax')]
+ );
+ var c = $('<div />').addClass('scale').appendTo('body');
+ for (var i=0; i < steps; i++) {
+ $('<div/>').css({
+ display: 'inline-block',
+ width: (totalW / steps) + 'px',
+ height: '100px',
+ background: ch(i/(steps-1)).hex()
+ })
+ .appendTo(c);
+ }
+ }
+
+ update();
+
+ </script>
+</body>
+</html>
src/node_modules/chroma-js/test/html/luminance.html
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Chroma.js</title>
+ <script type="text/javascript" src="../../chroma.js"></script>
+</head>
+<body>
+
+ <script type="text/javascript">
+
+ function showScale(color, mode, odiv) {
+ var c = document.createElement('div');
+ for (var i=0; i <= 1; i += 0.01) {
+ var col = chroma(color).luminance(i, mode);
+ var d = document.createElement('div');
+ d.style.display = 'inline-block';
+ d.style.width = '10px';
+ d.style.height = '60px';
+ d.style.background = col.hex();
+ c.appendChild(d);
+ }
+ odiv.appendChild(c);
+ }
+
+ var scales = [
+ ['red', 'rgb'],
+ ['red', 'lab'],
+ ['yellow', 'lab'],
+ ['black', 'rgb'],
+ ['blue', 'rgb'],
+ ['green', 'rgb'],
+ ['green', 'lab'],
+ ['orange', 'rgb']
+ ];
+
+ for (var s in scales) {
+ s = scales[s];
+ d = document.createElement('div');
+ d.style.position = 'relative';
+ document.body.appendChild(d);
+ d.innerHTML = "<div style='position:absolute;top:5px;left:10px;opacity:0.9;color:#000;text-shadow:-1px -1px 0px rgba(255,255,255,0.3), 1px 1px 0px rgba(255,255,255,0.3), -1px 1px 0px rgba(255,255,255,0.3), 1px -1px 0px rgba(255,255,255,0.3)'><code>" + s.join(' / ') + "</code></div>";
+ showScale(s[0], s[1], d);
+ }
+
+
+
+ </script>
+</body>
+</html>
src/node_modules/chroma-js/test/interpolate-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+vows
+ .describe('Some tests for chroma.color()')
+
+ .addBatch
+
+ 'hsv interpolation white <-> red':
+ topic: chroma('white').interpolate('red', 0.5, 'hsv')
+ 'works': (topic) -> assert.deepEqual topic.hex(), '#ff8080'
+
+ 'use mix as alias':
+ topic: chroma('white').mix('red', 0.5, 'hsv')
+ 'works': (topic) -> assert.deepEqual topic.hex(), '#ff8080'
+
+ 'alternative mix syntax':
+ topic: chroma.mix('red', 'blue', 0.25)
+ 'works': (topic) -> assert.deepEqual topic.hex(), '#bf0040'
+
+ 'hsl interpolation white <-> red':
+ topic: chroma('white').interpolate('red', 0.5, 'hsl')
+ 'works': (topic) -> assert.deepEqual topic.hex(), '#ff8080'
+
+ 'rgb interpolation white <-> red':
+ topic: chroma('white').interpolate('red', 0.5, 'rgb')
+ 'works': (topic) -> assert.deepEqual topic.hex(), '#ff8080'
+
+ 'hsv interpolation red <-> white':
+ topic: chroma('red').interpolate('white', 0.5, 'hsv')
+ 'works': (topic) -> assert.deepEqual topic.hex(), '#ff8080'
+
+ 'hsl interpolation red <-> white':
+ topic: chroma('red').interpolate('white', 0.5, 'hsl')
+ 'works': (topic) -> assert.deepEqual topic.hex(), '#ff8080'
+
+ 'rgb interpolation red <-> white':
+ topic: chroma('red').interpolate('white', 0.5, 'rgb')
+ 'works': (topic) -> assert.deepEqual topic.hex(), '#ff8080'
+
+ 'interpolation short function':
+ topic:
+ f: (t) -> chroma.interpolate('#ff0000', '#ffffff', t, 'hsv').hex()
+ 'starts at red': (topic) -> assert.equal topic.f(0), '#ff0000'
+ 'goes over light red': (topic) -> assert.equal topic.f(0.5), '#ff8080'
+ 'ends at white': (topic) -> assert.equal topic.f(1), '#ffffff'
+
+ 'num interpolation white <-> red':
+ topic: chroma(0xffffff).interpolate(0xff0000, 0.5, 'num')
+ 'works': (topic) -> assert.deepEqual topic.hex(), '#ff7fff'
+
+ 'num interpolation red <-> white':
+ topic: chroma(0xff0000).interpolate(0xffffff, 0.5, 'num')
+ 'works': (topic) -> assert.deepEqual topic.hex(), '#ff7fff'
+
+ 'interpolation short function with num provided':
+ topic:
+ f: (t) -> chroma.interpolate(0xff0000, 0xffffff, t, 'num').hex()
+ 'starts at red': (topic) -> assert.equal topic.f(0), '#ff0000'
+ 'goes over light red': (topic) -> assert.equal topic.f(0.5), '#ff7fff'
+ 'ends at white': (topic) -> assert.equal topic.f(1), '#ffffff'
+
+ 'interpolate in num':
+ topic: chroma.interpolate chroma.num(0xffffe0), chroma.num(0x102180), 0.5, 'num'
+ 'hex': (topic) -> assert.equal topic.hex(), '#8810b0'
+ 'num': (topic) -> assert.equal topic.num(), 8917168
+
+ 'interpolate in hsv':
+ topic: chroma.interpolate 'white', 'black', 0.5, 'hsv'
+ 'hex': (topic) -> assert.equal topic.hex(), '#808080'
+
+ 'interpolate in hsl':
+ topic: chroma.interpolate 'lightyellow', 'navy', 0.5, 'hsl'
+ 'hex': (topic) -> assert.equal topic.hex(), '#31ff98'
+
+ 'interpolate in lrgb':
+ topic: chroma.interpolate 'red', 'blue', 0.5, 'lrgb'
+ 'hex': (topic) -> assert.equal topic.hex(), '#b400b4'
+
+
+ .export(module)
src/node_modules/chroma-js/test/lch-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+vows
+ .describe('Some tests for chroma.lch()')
+
+ .addBatch
+
+ 'lch grayscale':
+ topic: ([l,0,0] for l in [0,100,25,50,75])
+ 'black': (t) -> assert.equal chroma.lch(t[0]).hex(), '#000000'
+ 'white': (t) -> assert.equal chroma.lch(t[1]).hex(), '#ffffff'
+ 'gray 1': (t) -> assert.equal chroma.lch(t[2]).hex(), '#3b3b3b'
+ 'gray 2': (t) -> assert.equal chroma.lch(t[3]).hex(), '#777777'
+ 'gray 3': (t) -> assert.equal chroma.lch(t[4]).hex(), '#b9b9b9'
+
+ 'lch hues':
+ topic: ([50,70,h] for h in [0,60,120,180,240,300])
+ 'red-ish': (t) -> assert.equal chroma.lch(t[0]).hex(), '#dc2c7a'
+ 'yellow-ish': (t) -> assert.equal chroma.lch(t[1]).hex(), '#bd5c00'
+ 'green-ish': (t) -> assert.equal chroma.lch(t[2]).hex(), '#548400'
+ 'teal-ish': (t) -> assert.equal chroma.lch(t[3]).hex(), '#009175'
+ 'blue-ish': (t) -> assert.equal chroma.lch(t[4]).hex(), '#008cde'
+ 'purple-ish': (t) -> assert.equal chroma.lch(t[5]).hex(), '#6f67df'
+
+ 'clipping':
+ topic: (chroma.hcl(50, 40, l) for l in [20,40,60,80,100])
+ '20-clipped': (t) -> assert.equal t[0].clipped(), true
+ '40-not clipped': (t) -> assert.equal t[1].clipped(), false
+ '60-not clipped': (t) -> assert.equal t[2].clipped(), false
+ '80-clipped': (t) -> assert.equal t[3].clipped(), true
+ '100-clipped': (t) -> assert.equal t[4].clipped(), true
+
+ .export(module)
src/node_modules/chroma-js/test/lcorrection-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+vows
+ .describe('Testing lightess correction')
+
+ .addBatch
+
+ 'simple two color linear interpolation':
+ topic:
+ f: chroma.scale(['white', 'black']).mode('lab')
+ 'center L is 50': (topic) ->
+ assert.equal Math.round(topic.f(0.5).lab()[0]), 50
+
+ 'hot - w/o correction':
+ topic:
+ f: chroma.scale(['white', 'yellow', 'red', 'black']).mode('lab')
+ 'center L is 74': (topic) ->
+ assert.equal Math.round(topic.f(0.5).lab()[0]), 74
+
+ 'hot - with correction':
+ topic:
+ f: chroma.scale(['white', 'yellow', 'red', 'black']).mode('lab').correctLightness(true)
+ 'center L is 50': (topic) ->
+ assert.equal Math.round(topic.f(0.5).lab()[0]), 50
+
+ 'hot - w/o correction - domained [0,100]':
+ topic:
+ f: chroma.scale(['white', 'yellow', 'red', 'black']).domain([0,100]).mode('lab')
+ 'center L is 74': (topic) ->
+ assert.equal Math.round(topic.f(50).lab()[0]), 74
+
+ 'hot - with correction - domained [0,100]':
+ topic:
+ f: chroma.scale(['white', 'yellow', 'red', 'black']).domain([0,100]).mode('lab').correctLightness(true)
+ 'center L is 50': (topic) ->
+ assert.equal Math.round(topic.f(50).lab()[0]), 50
+
+ 'hot - w/o correction - domained [0,20,40,60,80,100]':
+ topic:
+ f: chroma.scale(['white', 'yellow', 'red', 'black']).domain([0,20,40,60,80,100]).mode('lab')
+ 'center L is 74': (topic) ->
+ assert.equal Math.round(topic.f(50).lab()[0]), 74
+
+ 'hot - with correction - domained [0,20,40,60,80,100]':
+ topic:
+ f: chroma.scale(['white', 'yellow', 'red', 'black']).domain([0,20,40,60,80,100]).mode('lab').correctLightness(true)
+ 'center L is 50': (topic) ->
+ assert.equal Math.round(topic.f(50).lab()[0]), 50
+ .export(module)
src/node_modules/chroma-js/test/limits-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+vows
+ .describe('Some tests for chroma.limits()')
+
+ .addBatch
+
+ 'simple continuous domain':
+ topic: chroma.limits [1,2,3,4,5], 'continuous'
+ 'domain': (topic) -> assert.deepEqual topic, [1,5]
+
+ 'continuous domain, negative values':
+ topic: chroma.limits [1,-2, -3,4,5], 'continuous'
+ 'domain': (topic) -> assert.deepEqual topic, [-3,5]
+
+ 'continuous domain, null values':
+ topic: chroma.limits [1, undefined, null, 4, 5], 'continuous'
+ 'domain': (topic) -> assert.deepEqual topic, [1,5]
+
+ 'equidistant domain':
+ topic: chroma.limits [0,10], 'equidistant', 5
+ 'domain': (topic) -> assert.deepEqual topic, [0, 2, 4, 6, 8, 10]
+
+ 'equidistant domain, NaN values':
+ topic: chroma.limits [0,9,3,6,3,5,undefined,Number.NaN,10], 'equidistant', 5
+ 'domain': (topic) -> assert.deepEqual topic, [0, 2, 4, 6, 8, 10]
+
+ 'logarithmic domain':
+ topic: chroma.limits [1,10000], 'log', 4
+ 'domain': (topic) -> assert.deepEqual topic, [1, 10, 100, 1000, 10000]
+
+ 'logarithmic domain - non-positive values':
+ topic: [-1,10000]
+ 'domain': (topic) ->
+ assert.throws () ->
+ chroma.limits topic, 'log', 4
+ , 'Logarithmic scales should only be possible for values > 0'
+
+ 'quantiles domain':
+ topic: chroma.limits [1,2,3,4,5,10,20,100], 'quantiles', 2
+ 'domain': (topic) -> assert.deepEqual topic, [1, 4.5, 100]
+
+ 'quantiles not enough values':
+ topic: chroma.limits [0,1], 'quantiles', 5
+ 'domain': (topic) -> assert.deepEqual topic, [0,0.2,0.4,0.6,0.8,1]
+
+ .export(module)
src/node_modules/chroma-js/test/luminance-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+rnd = (f,d) ->
+ d = Math.pow(10,d)
+ Math.round(f*d) / d
+
+vows
+ .describe('Testing relative luminance')
+
+ .addBatch
+
+ 'black':
+ topic: chroma 'black'
+ 'lum = 0': (topic) -> assert.equal topic.luminance(), 0
+
+ 'white':
+ topic: chroma 'white'
+ 'lum = 1': (topic) -> assert.equal topic.luminance(), 1
+
+ 'red':
+ topic: chroma 'red'
+ 'lum = 0.21': (topic) -> assert.equal topic.luminance(), 0.2126
+
+ 'yellow brighter than blue':
+ topic: [chroma('yellow').luminance(), chroma('blue').luminance()]
+ 'yellow > blue': (topic) -> assert topic[0] > topic[1]
+
+ 'green darker than red':
+ topic: [chroma('green').luminance(), chroma('red').luminance()]
+ 'green < red': (topic) -> assert topic[0] < topic[1]
+
+ # setting luminance
+ 'set red luminance to 0.4':
+ topic: chroma('red').luminance 0.4
+ 'lum = 0.4': (topic) -> assert.equal rnd(topic.luminance(),3), 0.4
+
+ # setting luminance
+ 'set red luminance to 0':
+ topic: chroma('red').luminance 0
+ 'lum = 0': (topic) -> assert.equal rnd(topic.luminance(),2), 0
+ 'hex = #000': (topic) -> assert.equal topic.hex(), '#000000'
+
+ # setting luminance
+ 'set black luminance to 0.5':
+ topic: chroma('black').luminance 0.5
+ 'lum = 0.5': (topic) -> assert.equal rnd(topic.luminance(), 2), 0.5
+ 'hex': (topic) -> assert.equal '#bcbcbc', topic.hex()
+
+ # setting luminance
+ 'set black luminance to 0.5 (lab)':
+ topic: chroma('black').luminance 0.5, 'lab'
+ 'lum = 0.5': (topic) -> assert.equal rnd(topic.luminance(),2), 0.5
+ 'hex': (topic) -> assert.equal '#bcbcbc', topic.hex()
+
+ 'setting luminance returns new color':
+ topic: chroma('red')
+ 'red luminance is 0.21': (topic) -> assert.equal rnd(topic.luminance(),2), 0.21
+ 'set luminance to 0.4': (topic) -> assert.equal topic.luminance(0.4).hex(), '#ff8686'
+ 'old luminance is still 0.21': (topic) -> assert.equal rnd(topic.luminance(),2), 0.21
+ 'old color is still red': (topic) -> assert.equal topic.hex(), '#ff0000'
+
+ .export(module)
src/node_modules/chroma-js/test/manipulate-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+round = (digits) ->
+ d = Math.pow 10,digits
+ return (v) ->
+ Math.round(v*d) / d
+
+vows
+ .describe('Some tests for chroma.color()')
+
+ .addBatch
+
+ 'modify colors':
+ topic: () -> chroma '#ff0000'
+ 'darken': (topic) -> assert.equal topic.darken().hex(), '#c20000'
+ 'darker': (topic) -> assert.equal topic.darker().hex(), '#c20000'
+ 'darken more': (topic) -> assert.equal topic.darker(2).hex(), '#890000'
+ 'darken too much': (topic) -> assert.equal topic.darker(10).hex(), '#000000'
+ 'brighten': (topic) -> assert.equal topic.brighten().hex(), '#ff5a36'
+ 'brighten too much': (topic) -> assert.equal topic.brighten(10).hex(), '#ffffff'
+ 'brighter': (topic) -> assert.equal topic.brighter().hex(), '#ff5a36'
+ 'saturate': (topic) -> assert.equal topic.saturate().hex(), '#ff0000'
+ 'desaturate': (topic) -> assert.equal topic.desaturate().hex(), '#ee3a20'
+ 'desaturate more': (topic) -> assert.equal topic.desaturate(2).hex(), '#db5136'
+ 'desaturate too much': (topic) -> assert.equal topic.desaturate(400).hex(), '#7f7f7f'
+
+ 'premultiply':
+ topic: chroma 'rgba(32, 48, 96, 0.5)'
+ 'premultiply rgba': (topic) -> assert.deepEqual topic.premultiply().rgba(), [16, 24, 48, 0.5]
+ 'premultiply hex': (topic) -> assert.equal topic.premultiply().hex(), '#10183080'
+ 'premultiply hex rgb': (topic) -> assert.equal topic.premultiply().hex('rgb'), '#101830'
+ 'premultiply num': (topic) -> assert.equal topic.premultiply().num(), 0x101830
+
+ .export(module)
src/node_modules/chroma-js/test/num-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+vows
+ .describe('Some tests for chroma.num()')
+
+ .addBatch
+
+ 'number output':
+ topic: chroma.hsl 0,1,0.5,0.5
+ 'numoutput': -> (topic) -> assert.equal topic.num(), 0xff0000
+
+ 'num color':
+ topic: [chroma(0xff0000), chroma(0x000000), chroma(0xffffff), chroma(0x31ff98), chroma('red')]
+ 'hex': (topic) -> assert.equal topic[0].hex(), '#ff0000'
+ 'num': (topic) -> assert.equal topic[0].num(), 0xff0000
+ 'hex-black': (topic) -> assert.equal topic[1].hex(), '#000000'
+ 'num-black': (topic) -> assert.equal topic[1].num(), 0x000000
+ 'hex-white': (topic) -> assert.equal topic[2].hex(), '#ffffff'
+ 'num-white': (topic) -> assert.equal topic[2].num(), 0xffffff
+ 'hex-rand': (topic) -> assert.equal topic[3].hex(), '#31ff98'
+ 'num-rand': (topic) -> assert.equal topic[3].num(), 0x31ff98
+ 'rum-red': (topic) -> assert.equal topic[4].num(), 0xff0000
+
+ .export(module)
src/node_modules/chroma-js/test/random-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+vows
+ .describe('Some tests for random colors')
+
+ .addBatch
+
+ 'random colors':
+ topic: chroma.random()
+ 'valid hex code': (topic) -> assert /^#[0-9a-f]{6}$/i.test(topic.hex())
+
+ .export(module)
src/node_modules/chroma-js/test/scales-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+vows
+ .describe('Some tests for chroma.scale()')
+
+ .addBatch
+
+ 'simple rgb scale (white-->black)':
+ topic:
+ f: chroma.scale ['white','black']
+ 'starts white': (topic) -> assert.equal topic.f(0).hex(), '#ffffff'
+ 'mid gray': (topic) -> assert.equal topic.f(0.5).hex(), '#808080'
+ 'ends black': (topic) -> assert.equal topic.f(1).hex(), '#000000'
+
+ 'simple hsv scale (white-->black)':
+ topic:
+ f: chroma.scale(['white','black']).mode('hsv')
+ 'starts white': (topic) -> assert.equal topic.f(0).hex(), '#ffffff'
+ 'mid gray': (topic) -> assert.equal topic.f(0.5).hex(), '#808080'
+ 'ends black': (topic) -> assert.equal topic.f(1).hex(), '#000000'
+ 'colors': (topic) -> assert.deepEqual topic.f.colors(), ['#ffffff', '#000000']
+ 'colors start and end': (topic) -> assert.deepEqual topic.f.colors(2), ['#ffffff', '#000000']
+ 'color mode': (topic) -> assert.deepEqual topic.f.colors(2, 'rgb')[1], [0,0,0]
+ 'color mode null len': (topic) -> assert.equal topic.f.colors(2, null).length, 2
+ 'color mode null': (topic) -> assert topic.f.colors(2, null)[0]._rgb
+
+ 'simple hsv scale (white-->black), classified':
+ topic:
+ f: chroma.scale(['white','black']).classes(7).mode('hsv')
+ 'starts white': (topic) -> assert.equal topic.f(0).hex(), '#ffffff'
+ 'mid gray': (topic) -> assert.equal topic.f(0.5).hex(), '#808080'
+ 'ends black': (topic) -> assert.equal topic.f(1).hex(), '#000000'
+ 'colors': (topic) -> assert.deepEqual topic.f.colors(7), ['#ffffff', '#d5d5d5', '#aaaaaa', '#808080', '#555555', '#2a2a2a', '#000000']
+
+ 'simple lab scale (white-->black)':
+ topic:
+ f: chroma.scale(['white','black']).mode('lab')
+ 'starts white': (topic) -> assert.equal topic.f(0).hex(), '#ffffff'
+ 'mid gray': (topic) -> assert.equal topic.f(0.5).hex(), '#777777'
+ 'ends black': (topic) -> assert.equal topic.f(1).hex(), '#000000'
+
+ 'colorbrewer scale':
+ topic:
+ f: chroma.scale 'RdYlGn'
+ 'starts white': (topic) -> assert.equal topic.f(0).hex(), '#a50026'
+ 'mid gray': (topic) -> assert.equal topic.f(0.5).hex(), '#ffffbf'
+ 'ends black': (topic) -> assert.equal topic.f(1).hex(), '#006837'
+
+ 'colorbrewer scale - domained':
+ topic:
+ f: chroma.scale('RdYlGn').domain([0, 100])
+ 'starts white': (topic) -> assert.equal topic.f(0).hex(), '#a50026'
+ 'foo': (topic) -> assert.notEqual topic.f(10).hex(), '#ffffbf'
+ 'mid gray': (topic) -> assert.equal topic.f(50).hex(), '#ffffbf'
+ 'ends black': (topic) -> assert.equal topic.f(100).hex(), '#006837'
+
+ 'colorbrewer scale - lowercase':
+ topic:
+ f: chroma.scale 'rdylgn'
+ 'starts white': (topic) -> assert.equal topic.f(0).hex(), '#a50026'
+ 'mid gray': (topic) -> assert.equal topic.f(0.5).hex(), '#ffffbf'
+ 'ends black': (topic) -> assert.equal topic.f(1).hex(), '#006837'
+
+ 'colorbrewer scale - domained - classified':
+ topic:
+ f: chroma.scale('RdYlGn').domain([0, 100]).classes(5)
+ 'starts white': (topic) -> assert.equal topic.f(0).hex(), '#a50026'
+ '10': (topic) -> assert.equal topic.f(10).hex(), '#a50026'
+ 'mid gray': (topic) -> assert.equal topic.f(50).hex(), '#ffffbf'
+ 'ends black': (topic) -> assert.equal topic.f(100).hex(), '#006837'
+ 'get colors': (topic) -> assert.deepEqual topic.f.colors(5), ['#a50026', '#f98e52', '#ffffbf', '#86cb67', '#006837']
+
+ 'calling domain with no arguments':
+ topic:
+ f: chroma.scale('RdYlGn').domain([0, 100]).classes(5)
+ 'returns domain': (topic) -> assert.deepEqual topic.f.domain(), [0, 100]
+ 'returns classes': (topic) -> assert.deepEqual topic.f.classes(), [0, 20, 40, 60, 80, 100]
+
+ 'source array keeps untouched':
+ topic: chroma.brewer.Blues.slice(0)
+ 'colors are an array': (colors) ->
+ assert.equal colors.length, 9
+ 'colors are strings': (colors) ->
+ assert.equal typeof colors[0], 'string'
+ 'creating a color scale': (colors) ->
+ chroma.scale(colors)
+ assert true
+ 'colors are still strings': (colors) ->
+ assert.equal typeof colors[0], 'string'
+
+
+ 'domain with same min and max':
+ topic:
+ f: chroma.scale(['white','black']).domain([1, 1])
+ 'returns color': (topic) -> assert.deepEqual topic.f(1).hex(), '#000000'
+
+ 'simple num scale (white-->black)':
+ topic:
+ f: chroma.scale(['white','black']).mode('num')
+ 'starts white': (topic) -> assert.equal topic.f(0).hex(), '#ffffff'
+ '25%': (topic) -> assert.equal topic.f(0.25).hex(), '#bfffff'
+ '50%': (topic) -> assert.equal topic.f(0.5).hex(), '#7fffff'
+ '75%': (topic) -> assert.equal topic.f(0.75).hex(), '#3fffff'
+ '95%': (topic) -> assert.equal topic.f(0.95).hex(), '#0ccccc'
+ 'ends black': (topic) -> assert.equal topic.f(1).hex(), '#000000'
+
+ 'css rgb colors':
+ topic: chroma.scale("YlGnBu")(0.3).css()
+ 'have rounded rgb() values': (topic) -> assert.equal topic, 'rgb(170,222,183)'
+
+ 'css rgba colors':
+ topic: chroma.scale("YlGnBu")(0.3).alpha(0.675).css()
+ 'dont round alpha value': (topic) -> assert.equal topic, 'rgba(170,222,183,0.675)'
+
+ 'get colors from a scale':
+ topic:
+ f: chroma.scale(['yellow','darkgreen'])
+ 'just colors': (topic) -> assert.deepEqual topic.f.colors(), ['#ffff00', '#006400']
+ 'five hex colors': (topic) -> assert.deepEqual topic.f.colors(5), ['#ffff00','#bfd800','#80b200','#408b00','#006400']
+ 'three css colors': (topic) -> assert.deepEqual topic.f.colors(3,'css'), ['rgb(255,255,0)', 'rgb(128,178,0)', 'rgb(0,100,0)' ]
+
+ 'get colors from a scale with more than two colors':
+ topic:
+ f: chroma.scale(['yellow','orange', 'darkgreen'])
+ 'just origianl colors': (topic) -> assert.deepEqual topic.f.colors(), ['#ffff00', '#ffa500', '#006400']
+
+ 'test example in readme':
+ topic:
+ f: chroma.scale('RdYlGn')
+ 'five hex colors (new)': (topic) -> assert.deepEqual topic.f.colors(5), ['#a50026','#f98e52','#ffffbf','#86cb67','#006837']
+
+ 'weird result':
+ topic:
+ f: chroma.scale([[ 0, 0, 0, 1 ], [ 255, 255, 255, 1 ]]).domain([0,10]).mode('rgb')
+ 'has hex function at 0.5': (topic) -> assert.equal typeof topic.f(0.5).hex, 'function'
+ 'has hex function at 0': (topic) -> assert.equal typeof topic.f(0).hex, 'function'
+
+ 'scale padding, simple':
+ topic:
+ f: chroma.scale('RdYlBu').padding(0.15)
+ '0': (topic) -> assert.equal topic.f(0).hex(), '#e64f35'
+ '0.5': (topic) -> assert.equal topic.f(0.5).hex(), '#ffffbf'
+ '1': (topic) -> assert.equal topic.f(1).hex(), '#5d91c3'
+
+ 'scale padding, one-sided':
+ topic:
+ f: chroma.scale('OrRd').padding([0.2, 0])
+ '0': (topic) -> assert.equal topic.f(0).hex(), '#fddcaf'
+ '0.5': (topic) -> assert.equal topic.f(0.5).hex(), '#f26d4b'
+ '1': (topic) -> assert.equal topic.f(1).hex(), '#7f0000'
+
+ 'colors return original colors':
+ topic:
+ f: chroma.scale(['red', 'white', 'blue'])
+ 'same colors': (topic) -> assert.deepEqual topic.f.colors(), ['#ff0000', '#ffffff', '#0000ff']
+
+ 'scale with one color':
+ topic:
+ f: chroma.scale(['red'])
+ 'should return that color': (topic) -> assert.equal topic.f(0.3).hex(), '#ff0000'
+
+ .export(module)
src/node_modules/chroma-js/test/set-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+vows
+ .describe('Testing color.set')
+ .addBatch
+ 'set hue':
+ topic: chroma 'hotpink'
+ 'hue not zero': (topic) -> assert.equal topic.hsl()[0], 330
+ 'hue zero': (topic) -> assert.equal topic.set('hsl.h', 0).hsl()[0], 0
+
+
+ .export(module)
src/node_modules/chroma-js/test/temperature-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+
+vows
+ .describe('Testing color temperature')
+
+ .addBatch
+
+ 'generate colors by temperatures':
+ topic: [4000,5000,10000,20000,30000,1000]
+ '1k': (t) -> assert.equal chroma.kelvin(t[5]).hex(), '#ff3a00'
+ '4k': (t) -> assert.equal chroma.kelvin(t[0]).hex(), '#ffd0a4'
+ '5k': (t) -> assert.equal chroma.kelvin(t[1]).hex(), '#ffe4cd'
+ '7k': (t) -> assert.equal chroma.kelvin(t[1]).hex(), '#ffe4cd'
+ '10k': (t) -> assert.equal chroma.kelvin(t[2]).hex(), '#ccdcff'
+ '20k': (t) -> assert.equal chroma.kelvin(t[3]).hex(), '#a8c5ff'
+ '30k': (t) -> assert.equal chroma.kelvin(t[4]).hex(), '#9fbeff'
+
+ 'color --> temp':
+ topic: ['#ff3a00', 'ffcfa3', 'cbdbff', '9ebeff']
+ '1k': (t) -> assert.equal chroma(t[0]).kelvin(), 1000
+ '4k': (t) -> assert.equal chroma(t[1]).kelvin(), 3989
+ '10k': (t) -> assert.equal chroma(t[2]).kelvin(), 10115
+ '30k': (t) -> assert.equal chroma(t[3]).kelvin(), 31100
+ .export(module)
src/node_modules/chroma-js/test/utils-test.coffee
+require 'es6-shim'
+vows = require 'vows'
+assert = require 'assert'
+chroma = require '../chroma'
+
+unpack = (args) ->
+ if args.length >= 3
+ [].slice.call args
+ else
+ args[0]
+
+vows
+ .describe('Some tests for utils')
+
+ .addBatch
+
+ 'unpack arguments':
+ topic: [1,2,3]
+ 'unpacked from array': (t) -> assert.deepEqual unpack(t), [1,2,3]
+ 'unpacked from single values': (t) -> assert.deepEqual unpack([t]), [1,2,3]
+
+
+ .export(module)
src/package-lock.json
+{
+ "name": "palette",
+ "version": "1.0.0",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "chroma-js": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-1.4.0.tgz",
+ "integrity": "sha512-5vBYGJkhSnK2SRZ0XkxwTL+TSRyP7PHIxjeg+1uce5qpNDRLLwAXcF12kIztas/BYakWPQhchzV4TKkiwKNd8Q=="
+ }
+ }
+}
src/package.json
+{
+ "name": "palette",
+ "version": "1.0.0",
+ "description": "Bins by colour, sorts by lightness.",
+ "main": "main.js",
+ "author": "Dave Jarvis",
+ "license": "MIT",
+ "dependencies": {
+ "chroma-js": "^1.4.0"
+ }
+}
src/run.sh
+#!/bin/bash
+
+cat data/template-head.svg > data/base.svg
+node main.js < data/all.dat >> data/base.svg
+cat data/template-foot.svg >> data/base.svg
+
tints.dat
-#f7d6e1
-#fae9f1
-#ffe3ef
-#c5c3d1
-#e1f5fe
-#daf3ff
-#ced2d3
-#f9f4a0
-#fff253
tones.dat
-#eda6bb
-#f27cb0
-#e288ea
-#8f79e8
-#b9b9dd
-#627fbb
-#8aaad9
-#3393cd
-#2e8cba
-#76c4c8
-#28b362
-#8cc09e
Delta 14670 lines added, 696 lines removed, 13974-line increase