001/** 002 * Copyright (c) 2011, The University of Southampton and the individual contributors. 003 * All rights reserved. 004 * 005 * Redistribution and use in source and binary forms, with or without modification, 006 * are permitted provided that the following conditions are met: 007 * 008 * * Redistributions of source code must retain the above copyright notice, 009 * this list of conditions and the following disclaimer. 010 * 011 * * Redistributions in binary form must reproduce the above copyright notice, 012 * this list of conditions and the following disclaimer in the documentation 013 * and/or other materials provided with the distribution. 014 * 015 * * Neither the name of the University of Southampton nor the names of its 016 * contributors may be used to endorse or promote products derived from this 017 * software without specific prior written permission. 018 * 019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 022 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 023 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 024 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 025 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 026 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 027 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 028 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 029 */ 030package org.openimaj.image.colour; 031 032import org.openimaj.image.FImage; 033import org.openimaj.image.MBFImage; 034 035/** 036 * Colour maps 037 * 038 * @author Jonathon Hare (jsh2@ecs.soton.ac.uk) 039 */ 040public enum ColourMap { 041 /** 042 * Octave Autumn colour map. The map ranges from red through orange to 043 * yellow. 044 */ 045 Autumn { 046 @Override 047 public void apply(float val, float[] out) { 048 out[0] = 1; 049 out[1] = val; 050 out[2] = 0; 051 } 052 053 @Override 054 public Type type() { 055 return Type.SEQUENTIAL; 056 } 057 058 @Override 059 public Mode mode() { 060 return Mode.INTERPOLATED; 061 } 062 }, 063 /** 064 * Octave Bone colour map. The map varies from black to white with gray-blue 065 * shades. 066 */ 067 Bone { 068 @Override 069 public void apply(float x, float[] out) { 070 out[0] = ((x < 3f / 4f) ? 1 : 0) * (7f / 8f * x) + 071 ((x >= 3f / 4f) ? 1 : 0) * (11f / 8f * x - 3f / 8f); 072 out[1] = ((x < 3f / 8f) ? 1 : 0) * (7f / 8f * x) + 073 ((x >= 3f / 8f && x < 3f / 4f) ? 1 : 0) * (29f / 24f * x - 1f / 8f) + 074 ((x >= 3f / 4f) ? 1 : 0) * (7f / 8f * x + 1f / 8f); 075 out[2] = ((x < 3f / 8f) ? 1 : 0) * (29f / 24f * x) + 076 ((x >= 3f / 8f) ? 1 : 0) * (7f / 8f * x + 1f / 8f); 077 } 078 079 @Override 080 public Type type() { 081 return Type.SEQUENTIAL; 082 } 083 084 @Override 085 public Mode mode() { 086 return Mode.INTERPOLATED; 087 } 088 }, 089 /** 090 * Octave Cool colour map. The map varies from cyan to magenta. 091 */ 092 Cool { 093 @Override 094 public void apply(float x, float[] out) { 095 out[0] = x; 096 out[1] = 1 - x; 097 out[2] = 1; 098 } 099 100 @Override 101 public Type type() { 102 return Type.SEQUENTIAL; 103 } 104 105 @Override 106 public Mode mode() { 107 return Mode.INTERPOLATED; 108 } 109 }, 110 /** 111 * Octave Copper colour map. The map varies from black to a light copper 112 * tone. 113 */ 114 Copper { 115 @Override 116 public void apply(float x, float[] out) { 117 out[0] = ((x < 4f / 5f) ? 1 : 0) * (5f / 4f * x) + ((x >= 4f / 5f) ? 1 : 0); 118 out[1] = 4f / 5f * x; 119 out[2] = 1f / 2f * x; 120 } 121 122 @Override 123 public Type type() { 124 return Type.SEQUENTIAL; 125 } 126 127 @Override 128 public Mode mode() { 129 return Mode.INTERPOLATED; 130 } 131 }, 132 /** 133 * Octave Hot colour map. The map ranges from black through dark red, red, 134 * orange, yellow, to white. 135 */ 136 Hot { 137 @Override 138 public void apply(float x, float[] out) { 139 out[0] = ((x < 2f / 5f) ? 1 : 0) * (5f / 2f * x) + ((x >= 2f / 5f) ? 1 : 0); 140 out[1] = ((x >= 2f / 5f && x < 4f / 5f) ? 1 : 0) * (5f / 2f * x - 1) + ((x >= 4f / 5f) ? 1 : 0); 141 out[2] = ((x >= 4f / 5f) ? 1 : 0) * (5f * x - 4f); 142 } 143 144 @Override 145 public Type type() { 146 return Type.SEQUENTIAL; 147 } 148 149 @Override 150 public Mode mode() { 151 return Mode.INTERPOLATED; 152 } 153 }, 154 /** 155 * Octave HSV colour map. The map begins with red, changes through yellow, 156 * green, cyan, blue, and magenta, before returning to red. 157 */ 158 HSV { 159 @Override 160 public void apply(float x, float[] out) { 161 final FImage h = new FImage(1, 1); 162 final FImage s = new FImage(1, 1); 163 final FImage v = new FImage(1, 1); 164 165 h.pixels[0][0] = x; 166 s.pixels[0][0] = 1; 167 v.pixels[0][0] = 1; 168 169 final MBFImage img = Transforms.HSV_TO_RGB(new MBFImage(ColourSpace.HSV, h, s, v)); 170 171 out[0] = img.getBand(0).pixels[0][0]; 172 out[1] = img.getBand(1).pixels[0][0]; 173 out[2] = img.getBand(2).pixels[0][0]; 174 } 175 176 @Override 177 public MBFImage apply(FImage img) { 178 final FImage ones = new FImage(img.width, img.height); 179 ones.fill(1); 180 final MBFImage mbf = new MBFImage(ColourSpace.HSV, img, ones, ones); 181 return Transforms.HSV_TO_RGB(mbf); 182 } 183 184 @Override 185 public Type type() { 186 return Type.QUALITATIVE; 187 } 188 189 @Override 190 public Mode mode() { 191 return Mode.INTERPOLATED; 192 } 193 }, 194 /** 195 * Octave Jet colour map. The map ranges from dark blue through blue, cyan, 196 * green, yellow, red, to dark red. 197 */ 198 Jet { 199 @Override 200 public void apply(float x, float[] out) { 201 out[0] = ((x >= 3f / 8f && x < 5f / 8f) ? 1 : 0) * (4f * x - 3f / 2f) + 202 ((x >= 5f / 8f && x < 7f / 8f) ? 1 : 0) + 203 ((x >= 7f / 8f) ? 1 : 0) * (-4f * x + 9f / 2f); 204 out[1] = ((x >= 1f / 8f && x < 3f / 8f) ? 1 : 0) * (4f * x - 1f / 2f) + 205 ((x >= 3f / 8f && x < 5f / 8f) ? 1 : 0) + 206 ((x >= 5f / 8f && x < 7f / 8f) ? 1 : 0) * (-4f * x + 7f / 2f); 207 out[2] = ((x < 1f / 8f) ? 1 : 0) * (4f * x + 1f / 2f) + 208 ((x >= 1f / 8f && x < 3f / 8f) ? 1 : 0) + 209 ((x >= 3f / 8f && x < 5f / 8f) ? 1 : 0) * (-4f * x + 5f / 2f); 210 } 211 212 @Override 213 public Type type() { 214 return Type.QUALITATIVE; 215 } 216 217 @Override 218 public Mode mode() { 219 return Mode.INTERPOLATED; 220 } 221 }, 222 /** 223 * Octave Spring colour map. The map varies from magenta to yellow. 224 */ 225 Spring { 226 @Override 227 public void apply(float x, float[] out) { 228 out[0] = 1; 229 out[1] = x; 230 out[2] = 1 - x; 231 } 232 233 @Override 234 public Type type() { 235 return Type.SEQUENTIAL; 236 } 237 238 @Override 239 public Mode mode() { 240 return Mode.INTERPOLATED; 241 } 242 }, 243 /** 244 * Octave Summer colour map. The map varies from green to yellow. 245 */ 246 Summer { 247 @Override 248 public void apply(float x, float[] out) { 249 out[0] = x; 250 out[1] = 0.5f + x / 2f; 251 out[2] = 0.4f; 252 } 253 254 @Override 255 public Type type() { 256 return Type.SEQUENTIAL; 257 } 258 259 @Override 260 public Mode mode() { 261 return Mode.INTERPOLATED; 262 } 263 }, 264 /** 265 * Octave Rainbow colour map. The map ranges from red through orange, 266 * yellow, green, blue, to violet. 267 */ 268 Rainbow { 269 @Override 270 public void apply(float x, float[] out) { 271 out[0] = ((x < 2f / 5f) ? 1 : 0) + 272 ((x >= 2f / 5f && x < 3f / 5f) ? 1 : 0) * (-5f * x + 3f) + 273 ((x >= 4f / 5f) ? 1 : 0) * (10f / 3f * x - 8f / 3f); 274 out[1] = ((x < 2f / 5f) ? 1 : 0) * (5f / 2f * x) + 275 ((x >= 2f / 5f & x < 3f / 5f) ? 1 : 0) + 276 ((x >= 3f / 5f & x < 4f / 5f) ? 1 : 0) * (-5f * x + 4f); 277 out[2] = ((x >= 3f / 5f & x < 4f / 5f) ? 1 : 0) * (5f * x - 3f) + 278 ((x >= 4f / 5f) ? 1 : 0); 279 } 280 281 @Override 282 public Type type() { 283 return Type.QUALITATIVE; 284 } 285 286 @Override 287 public Mode mode() { 288 return Mode.INTERPOLATED; 289 } 290 }, 291 /** 292 * Octave Winter colour map. The map varies from blue to green. 293 */ 294 Winter { 295 @Override 296 public void apply(float x, float[] out) { 297 out[0] = 0; 298 out[1] = x; 299 out[2] = 1f - x / 2f; 300 } 301 302 @Override 303 public Type type() { 304 return Type.SEQUENTIAL; 305 } 306 307 @Override 308 public Mode mode() { 309 return Mode.INTERPOLATED; 310 } 311 }, 312 /** 313 * Sepia colour map based on the Octave Pink colour map. 314 */ 315 Sepia { 316 @Override 317 public void apply(float x, float[] out) { 318 out[0] = ((x < 3f / 8f) ? 1 : 0) * (14f / 9f * x) + 319 ((x >= 3f / 8f) ? 1 : 0) * (2f / 3f * x + 1f / 3f); 320 out[1] = ((x < 3f / 8f) ? 1 : 0) * (2f / 3f * x) + 321 ((x >= 3f / 8f && x < 3f / 4f) ? 1 : 0) * (14f / 9f * x - 1f / 3f) + 322 ((x >= 3f / 4f) ? 1 : 0) * (2f / 3f * x + 1f / 3f); 323 out[1] = ((x < 3f / 4f) ? 1 : 0) * (2f / 3f * x) + 324 ((x >= 3f / 4f) ? 1 : 0) * (2f * x - 1f); 325 326 } 327 328 @Override 329 public Type type() { 330 return Type.SEQUENTIAL; 331 } 332 333 @Override 334 public Mode mode() { 335 return Mode.INTERPOLATED; 336 } 337 }, 338 /** 339 * Red, green, blue, yellow, magenta, cyan discrete map 340 */ 341 RGBYMC { 342 private final float[][] cols = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 }, { 1, 1, 0 }, { 1, 0, 1 }, { 0, 1, 1 } }; 343 344 @Override 345 public void apply(float x, float[] out) { 346 final int i = Math.min((int) (x * 6), 5); 347 348 final float[] col = cols[i]; 349 350 out[0] = col[0]; 351 out[1] = col[1]; 352 out[2] = col[2]; 353 } 354 355 @Override 356 public Type type() { 357 return Type.QUALITATIVE; 358 } 359 360 @Override 361 public Mode mode() { 362 return Mode.DISCRETE; 363 } 364 }, 365 /** 366 * Discrete Rainbow (red, orange, yellow, green, blue, violet) 367 */ 368 Prism { 369 private final float[][] cols = { { 1, 0, 0 }, { 1, 0.5f, 0 }, { 1, 1, 0 }, { 0, 1, 0 }, { 0, 0, 1 }, 370 { 2f / 3f, 0, 1 } }; 371 372 @Override 373 public void apply(float x, float[] out) { 374 final int i = Math.min((int) (x * 6), 5); 375 376 final float[] col = cols[i]; 377 378 out[0] = col[0]; 379 out[1] = col[1]; 380 out[2] = col[2]; 381 } 382 383 @Override 384 public Type type() { 385 return Type.QUALITATIVE; 386 } 387 388 @Override 389 public Mode mode() { 390 return Mode.DISCRETE; 391 } 392 }, 393 /** 394 * ColorBrewer "Accent" colour map with 3 colours. See <a 395 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 396 * information. 397 */ 398 Accent3 { 399 private final float[][] cols = { { 127f / 265f, 201f / 265f, 127f / 265f }, 400 { 190f / 265f, 174f / 265f, 212f / 265f }, { 253f / 265f, 192f / 265f, 134f / 265f } }; 401 402 @Override 403 public void apply(float x, float[] out) { 404 final int i = Math.min((int) (x * cols.length), cols.length - 1); 405 406 final float[] col = cols[i]; 407 408 out[0] = col[0]; 409 out[1] = col[1]; 410 out[2] = col[2]; 411 } 412 413 @Override 414 public Type type() { 415 return Type.QUALITATIVE; 416 } 417 418 @Override 419 public Mode mode() { 420 return Mode.DISCRETE; 421 } 422 }, 423 424 /** 425 * ColorBrewer "Accent" colour map with 4 colours. See <a 426 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 427 * information. 428 */ 429 Accent4 { 430 private final float[][] cols = { { 127f / 265f, 201f / 265f, 127f / 265f }, 431 { 190f / 265f, 174f / 265f, 212f / 265f }, { 253f / 265f, 192f / 265f, 134f / 265f }, 432 { 255f / 265f, 255f / 265f, 153f / 265f } }; 433 434 @Override 435 public void apply(float x, float[] out) { 436 final int i = Math.min((int) (x * cols.length), cols.length - 1); 437 438 final float[] col = cols[i]; 439 440 out[0] = col[0]; 441 out[1] = col[1]; 442 out[2] = col[2]; 443 } 444 445 @Override 446 public Type type() { 447 return Type.QUALITATIVE; 448 } 449 450 @Override 451 public Mode mode() { 452 return Mode.DISCRETE; 453 } 454 }, 455 456 /** 457 * ColorBrewer "Accent" colour map with 5 colours. See <a 458 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 459 * information. 460 */ 461 Accent5 { 462 private final float[][] cols = { { 127f / 265f, 201f / 265f, 127f / 265f }, 463 { 190f / 265f, 174f / 265f, 212f / 265f }, { 253f / 265f, 192f / 265f, 134f / 265f }, 464 { 255f / 265f, 255f / 265f, 153f / 265f }, { 56f / 265f, 108f / 265f, 176f / 265f } }; 465 466 @Override 467 public void apply(float x, float[] out) { 468 final int i = Math.min((int) (x * cols.length), cols.length - 1); 469 470 final float[] col = cols[i]; 471 472 out[0] = col[0]; 473 out[1] = col[1]; 474 out[2] = col[2]; 475 } 476 477 @Override 478 public Type type() { 479 return Type.QUALITATIVE; 480 } 481 482 @Override 483 public Mode mode() { 484 return Mode.DISCRETE; 485 } 486 }, 487 488 /** 489 * ColorBrewer "Accent" colour map with 6 colours. See <a 490 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 491 * information. 492 */ 493 Accent6 { 494 private final float[][] cols = { { 127f / 265f, 201f / 265f, 127f / 265f }, 495 { 190f / 265f, 174f / 265f, 212f / 265f }, { 253f / 265f, 192f / 265f, 134f / 265f }, 496 { 255f / 265f, 255f / 265f, 153f / 265f }, { 56f / 265f, 108f / 265f, 176f / 265f }, 497 { 240f / 265f, 2f / 265f, 127f / 265f } }; 498 499 @Override 500 public void apply(float x, float[] out) { 501 final int i = Math.min((int) (x * cols.length), cols.length - 1); 502 503 final float[] col = cols[i]; 504 505 out[0] = col[0]; 506 out[1] = col[1]; 507 out[2] = col[2]; 508 } 509 510 @Override 511 public Type type() { 512 return Type.QUALITATIVE; 513 } 514 515 @Override 516 public Mode mode() { 517 return Mode.DISCRETE; 518 } 519 }, 520 521 /** 522 * ColorBrewer "Accent" colour map with 7 colours. See <a 523 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 524 * information. 525 */ 526 Accent7 { 527 private final float[][] cols = { { 127f / 265f, 201f / 265f, 127f / 265f }, 528 { 190f / 265f, 174f / 265f, 212f / 265f }, { 253f / 265f, 192f / 265f, 134f / 265f }, 529 { 255f / 265f, 255f / 265f, 153f / 265f }, { 56f / 265f, 108f / 265f, 176f / 265f }, 530 { 240f / 265f, 2f / 265f, 127f / 265f }, { 191f / 265f, 91f / 265f, 23f / 265f } }; 531 532 @Override 533 public void apply(float x, float[] out) { 534 final int i = Math.min((int) (x * cols.length), cols.length - 1); 535 536 final float[] col = cols[i]; 537 538 out[0] = col[0]; 539 out[1] = col[1]; 540 out[2] = col[2]; 541 } 542 543 @Override 544 public Type type() { 545 return Type.QUALITATIVE; 546 } 547 548 @Override 549 public Mode mode() { 550 return Mode.DISCRETE; 551 } 552 }, 553 554 /** 555 * ColorBrewer "Accent" colour map with 8 colours. See <a 556 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 557 * information. 558 */ 559 Accent8 { 560 private final float[][] cols = { { 127f / 265f, 201f / 265f, 127f / 265f }, 561 { 190f / 265f, 174f / 265f, 212f / 265f }, { 253f / 265f, 192f / 265f, 134f / 265f }, 562 { 255f / 265f, 255f / 265f, 153f / 265f }, { 56f / 265f, 108f / 265f, 176f / 265f }, 563 { 240f / 265f, 2f / 265f, 127f / 265f }, { 191f / 265f, 91f / 265f, 23f / 265f }, 564 { 102f / 265f, 102f / 265f, 102f / 265f } }; 565 566 @Override 567 public void apply(float x, float[] out) { 568 final int i = Math.min((int) (x * cols.length), cols.length - 1); 569 570 final float[] col = cols[i]; 571 572 out[0] = col[0]; 573 out[1] = col[1]; 574 out[2] = col[2]; 575 } 576 577 @Override 578 public Type type() { 579 return Type.QUALITATIVE; 580 } 581 582 @Override 583 public Mode mode() { 584 return Mode.DISCRETE; 585 } 586 }, 587 588 /** 589 * ColorBrewer "Blues" colour map with 3 colours. See <a 590 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 591 * information. 592 */ 593 Blues3 { 594 private final float[][] cols = { { 222f / 265f, 235f / 265f, 247f / 265f }, 595 { 158f / 265f, 202f / 265f, 225f / 265f }, { 49f / 265f, 130f / 265f, 189f / 265f } }; 596 597 @Override 598 public void apply(float x, float[] out) { 599 final int i = Math.min((int) (x * cols.length), cols.length - 1); 600 601 final float[] col = cols[i]; 602 603 out[0] = col[0]; 604 out[1] = col[1]; 605 out[2] = col[2]; 606 } 607 608 @Override 609 public Type type() { 610 return Type.SEQUENTIAL; 611 } 612 613 @Override 614 public Mode mode() { 615 return Mode.DISCRETE; 616 } 617 }, 618 619 /** 620 * ColorBrewer "Blues" colour map with 4 colours. See <a 621 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 622 * information. 623 */ 624 Blues4 { 625 private final float[][] cols = { { 239f / 265f, 243f / 265f, 255f / 265f }, 626 { 189f / 265f, 215f / 265f, 231f / 265f }, { 107f / 265f, 174f / 265f, 214f / 265f }, 627 { 33f / 265f, 113f / 265f, 181f / 265f } }; 628 629 @Override 630 public void apply(float x, float[] out) { 631 final int i = Math.min((int) (x * cols.length), cols.length - 1); 632 633 final float[] col = cols[i]; 634 635 out[0] = col[0]; 636 out[1] = col[1]; 637 out[2] = col[2]; 638 } 639 640 @Override 641 public Type type() { 642 return Type.SEQUENTIAL; 643 } 644 645 @Override 646 public Mode mode() { 647 return Mode.DISCRETE; 648 } 649 }, 650 651 /** 652 * ColorBrewer "Blues" colour map with 5 colours. See <a 653 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 654 * information. 655 */ 656 Blues5 { 657 private final float[][] cols = { { 239f / 265f, 243f / 265f, 255f / 265f }, 658 { 189f / 265f, 215f / 265f, 231f / 265f }, { 107f / 265f, 174f / 265f, 214f / 265f }, 659 { 49f / 265f, 130f / 265f, 189f / 265f }, { 8f / 265f, 81f / 265f, 156f / 265f } }; 660 661 @Override 662 public void apply(float x, float[] out) { 663 final int i = Math.min((int) (x * cols.length), cols.length - 1); 664 665 final float[] col = cols[i]; 666 667 out[0] = col[0]; 668 out[1] = col[1]; 669 out[2] = col[2]; 670 } 671 672 @Override 673 public Type type() { 674 return Type.SEQUENTIAL; 675 } 676 677 @Override 678 public Mode mode() { 679 return Mode.DISCRETE; 680 } 681 }, 682 683 /** 684 * ColorBrewer "Blues" colour map with 6 colours. See <a 685 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 686 * information. 687 */ 688 Blues6 { 689 private final float[][] cols = { { 239f / 265f, 243f / 265f, 255f / 265f }, 690 { 198f / 265f, 219f / 265f, 239f / 265f }, { 158f / 265f, 202f / 265f, 225f / 265f }, 691 { 107f / 265f, 174f / 265f, 214f / 265f }, { 49f / 265f, 130f / 265f, 189f / 265f }, 692 { 8f / 265f, 81f / 265f, 156f / 265f } }; 693 694 @Override 695 public void apply(float x, float[] out) { 696 final int i = Math.min((int) (x * cols.length), cols.length - 1); 697 698 final float[] col = cols[i]; 699 700 out[0] = col[0]; 701 out[1] = col[1]; 702 out[2] = col[2]; 703 } 704 705 @Override 706 public Type type() { 707 return Type.SEQUENTIAL; 708 } 709 710 @Override 711 public Mode mode() { 712 return Mode.DISCRETE; 713 } 714 }, 715 716 /** 717 * ColorBrewer "Blues" colour map with 7 colours. See <a 718 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 719 * information. 720 */ 721 Blues7 { 722 private final float[][] cols = { { 239f / 265f, 243f / 265f, 255f / 265f }, 723 { 198f / 265f, 219f / 265f, 239f / 265f }, { 158f / 265f, 202f / 265f, 225f / 265f }, 724 { 107f / 265f, 174f / 265f, 214f / 265f }, { 66f / 265f, 146f / 265f, 198f / 265f }, 725 { 33f / 265f, 113f / 265f, 181f / 265f }, { 8f / 265f, 69f / 265f, 148f / 265f } }; 726 727 @Override 728 public void apply(float x, float[] out) { 729 final int i = Math.min((int) (x * cols.length), cols.length - 1); 730 731 final float[] col = cols[i]; 732 733 out[0] = col[0]; 734 out[1] = col[1]; 735 out[2] = col[2]; 736 } 737 738 @Override 739 public Type type() { 740 return Type.SEQUENTIAL; 741 } 742 743 @Override 744 public Mode mode() { 745 return Mode.DISCRETE; 746 } 747 }, 748 749 /** 750 * ColorBrewer "Blues" colour map with 8 colours. See <a 751 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 752 * information. 753 */ 754 Blues8 { 755 private final float[][] cols = { { 247f / 265f, 251f / 265f, 255f / 265f }, 756 { 222f / 265f, 235f / 265f, 247f / 265f }, { 198f / 265f, 219f / 265f, 239f / 265f }, 757 { 158f / 265f, 202f / 265f, 225f / 265f }, { 107f / 265f, 174f / 265f, 214f / 265f }, 758 { 66f / 265f, 146f / 265f, 198f / 265f }, { 33f / 265f, 113f / 265f, 181f / 265f }, 759 { 8f / 265f, 69f / 265f, 148f / 265f } }; 760 761 @Override 762 public void apply(float x, float[] out) { 763 final int i = Math.min((int) (x * cols.length), cols.length - 1); 764 765 final float[] col = cols[i]; 766 767 out[0] = col[0]; 768 out[1] = col[1]; 769 out[2] = col[2]; 770 } 771 772 @Override 773 public Type type() { 774 return Type.SEQUENTIAL; 775 } 776 777 @Override 778 public Mode mode() { 779 return Mode.DISCRETE; 780 } 781 }, 782 783 /** 784 * ColorBrewer "Blues" colour map with 9 colours. See <a 785 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 786 * information. 787 */ 788 Blues9 { 789 private final float[][] cols = { { 247f / 265f, 251f / 265f, 255f / 265f }, 790 { 222f / 265f, 235f / 265f, 247f / 265f }, { 198f / 265f, 219f / 265f, 239f / 265f }, 791 { 158f / 265f, 202f / 265f, 225f / 265f }, { 107f / 265f, 174f / 265f, 214f / 265f }, 792 { 66f / 265f, 146f / 265f, 198f / 265f }, { 33f / 265f, 113f / 265f, 181f / 265f }, 793 { 8f / 265f, 81f / 265f, 156f / 265f }, { 8f / 265f, 48f / 265f, 107f / 265f } }; 794 795 @Override 796 public void apply(float x, float[] out) { 797 final int i = Math.min((int) (x * cols.length), cols.length - 1); 798 799 final float[] col = cols[i]; 800 801 out[0] = col[0]; 802 out[1] = col[1]; 803 out[2] = col[2]; 804 } 805 806 @Override 807 public Type type() { 808 return Type.SEQUENTIAL; 809 } 810 811 @Override 812 public Mode mode() { 813 return Mode.DISCRETE; 814 } 815 }, 816 817 /** 818 * ColorBrewer "BrBG" colour map with 3 colours. See <a 819 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 820 * information. 821 */ 822 BrBG3 { 823 private final float[][] cols = { { 216f / 265f, 179f / 265f, 101f / 265f }, 824 { 245f / 265f, 245f / 265f, 245f / 265f }, { 90f / 265f, 180f / 265f, 172f / 265f } }; 825 826 @Override 827 public void apply(float x, float[] out) { 828 final int i = Math.min((int) (x * cols.length), cols.length - 1); 829 830 final float[] col = cols[i]; 831 832 out[0] = col[0]; 833 out[1] = col[1]; 834 out[2] = col[2]; 835 } 836 837 @Override 838 public Type type() { 839 return Type.DIVERGING; 840 } 841 842 @Override 843 public Mode mode() { 844 return Mode.DISCRETE; 845 } 846 }, 847 848 /** 849 * ColorBrewer "BrBG" colour map with 4 colours. See <a 850 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 851 * information. 852 */ 853 BrBG4 { 854 private final float[][] cols = { { 166f / 265f, 97f / 265f, 26f / 265f }, 855 { 223f / 265f, 194f / 265f, 125f / 265f }, { 128f / 265f, 205f / 265f, 193f / 265f }, 856 { 1f / 265f, 133f / 265f, 113f / 265f } }; 857 858 @Override 859 public void apply(float x, float[] out) { 860 final int i = Math.min((int) (x * cols.length), cols.length - 1); 861 862 final float[] col = cols[i]; 863 864 out[0] = col[0]; 865 out[1] = col[1]; 866 out[2] = col[2]; 867 } 868 869 @Override 870 public Type type() { 871 return Type.DIVERGING; 872 } 873 874 @Override 875 public Mode mode() { 876 return Mode.DISCRETE; 877 } 878 }, 879 880 /** 881 * ColorBrewer "BrBG" colour map with 5 colours. See <a 882 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 883 * information. 884 */ 885 BrBG5 { 886 private final float[][] cols = { { 166f / 265f, 97f / 265f, 26f / 265f }, 887 { 223f / 265f, 194f / 265f, 125f / 265f }, { 245f / 265f, 245f / 265f, 245f / 265f }, 888 { 128f / 265f, 205f / 265f, 193f / 265f }, { 1f / 265f, 133f / 265f, 113f / 265f } }; 889 890 @Override 891 public void apply(float x, float[] out) { 892 final int i = Math.min((int) (x * cols.length), cols.length - 1); 893 894 final float[] col = cols[i]; 895 896 out[0] = col[0]; 897 out[1] = col[1]; 898 out[2] = col[2]; 899 } 900 901 @Override 902 public Type type() { 903 return Type.DIVERGING; 904 } 905 906 @Override 907 public Mode mode() { 908 return Mode.DISCRETE; 909 } 910 }, 911 912 /** 913 * ColorBrewer "BrBG" colour map with 6 colours. See <a 914 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 915 * information. 916 */ 917 BrBG6 { 918 private final float[][] cols = { { 140f / 265f, 81f / 265f, 10f / 265f }, 919 { 216f / 265f, 179f / 265f, 101f / 265f }, { 246f / 265f, 232f / 265f, 195f / 265f }, 920 { 199f / 265f, 234f / 265f, 229f / 265f }, { 90f / 265f, 180f / 265f, 172f / 265f }, 921 { 1f / 265f, 102f / 265f, 94f / 265f } }; 922 923 @Override 924 public void apply(float x, float[] out) { 925 final int i = Math.min((int) (x * cols.length), cols.length - 1); 926 927 final float[] col = cols[i]; 928 929 out[0] = col[0]; 930 out[1] = col[1]; 931 out[2] = col[2]; 932 } 933 934 @Override 935 public Type type() { 936 return Type.DIVERGING; 937 } 938 939 @Override 940 public Mode mode() { 941 return Mode.DISCRETE; 942 } 943 }, 944 945 /** 946 * ColorBrewer "BrBG" colour map with 7 colours. See <a 947 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 948 * information. 949 */ 950 BrBG7 { 951 private final float[][] cols = { { 140f / 265f, 81f / 265f, 10f / 265f }, 952 { 216f / 265f, 179f / 265f, 101f / 265f }, { 246f / 265f, 232f / 265f, 195f / 265f }, 953 { 245f / 265f, 245f / 265f, 245f / 265f }, { 199f / 265f, 234f / 265f, 229f / 265f }, 954 { 90f / 265f, 180f / 265f, 172f / 265f }, { 1f / 265f, 102f / 265f, 94f / 265f } }; 955 956 @Override 957 public void apply(float x, float[] out) { 958 final int i = Math.min((int) (x * cols.length), cols.length - 1); 959 960 final float[] col = cols[i]; 961 962 out[0] = col[0]; 963 out[1] = col[1]; 964 out[2] = col[2]; 965 } 966 967 @Override 968 public Type type() { 969 return Type.DIVERGING; 970 } 971 972 @Override 973 public Mode mode() { 974 return Mode.DISCRETE; 975 } 976 }, 977 978 /** 979 * ColorBrewer "BrBG" colour map with 8 colours. See <a 980 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 981 * information. 982 */ 983 BrBG8 { 984 private final float[][] cols = { { 140f / 265f, 81f / 265f, 10f / 265f }, 985 { 191f / 265f, 129f / 265f, 45f / 265f }, { 223f / 265f, 194f / 265f, 125f / 265f }, 986 { 246f / 265f, 232f / 265f, 195f / 265f }, { 199f / 265f, 234f / 265f, 229f / 265f }, 987 { 128f / 265f, 205f / 265f, 193f / 265f }, { 53f / 265f, 151f / 265f, 143f / 265f }, 988 { 1f / 265f, 102f / 265f, 94f / 265f } }; 989 990 @Override 991 public void apply(float x, float[] out) { 992 final int i = Math.min((int) (x * cols.length), cols.length - 1); 993 994 final float[] col = cols[i]; 995 996 out[0] = col[0]; 997 out[1] = col[1]; 998 out[2] = col[2]; 999 } 1000 1001 @Override 1002 public Type type() { 1003 return Type.DIVERGING; 1004 } 1005 1006 @Override 1007 public Mode mode() { 1008 return Mode.DISCRETE; 1009 } 1010 }, 1011 1012 /** 1013 * ColorBrewer "BrBG" colour map with 9 colours. See <a 1014 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1015 * information. 1016 */ 1017 BrBG9 { 1018 private final float[][] cols = { { 140f / 265f, 81f / 265f, 10f / 265f }, 1019 { 191f / 265f, 129f / 265f, 45f / 265f }, { 223f / 265f, 194f / 265f, 125f / 265f }, 1020 { 246f / 265f, 232f / 265f, 195f / 265f }, { 245f / 265f, 245f / 265f, 245f / 265f }, 1021 { 199f / 265f, 234f / 265f, 229f / 265f }, { 128f / 265f, 205f / 265f, 193f / 265f }, 1022 { 53f / 265f, 151f / 265f, 143f / 265f }, { 1f / 265f, 102f / 265f, 94f / 265f } }; 1023 1024 @Override 1025 public void apply(float x, float[] out) { 1026 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1027 1028 final float[] col = cols[i]; 1029 1030 out[0] = col[0]; 1031 out[1] = col[1]; 1032 out[2] = col[2]; 1033 } 1034 1035 @Override 1036 public Type type() { 1037 return Type.DIVERGING; 1038 } 1039 1040 @Override 1041 public Mode mode() { 1042 return Mode.DISCRETE; 1043 } 1044 }, 1045 1046 /** 1047 * ColorBrewer "BrBG" colour map with 10 colours. See <a 1048 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1049 * information. 1050 */ 1051 BrBG10 { 1052 private final float[][] cols = { { 84f / 265f, 48f / 265f, 5f / 265f }, { 140f / 265f, 81f / 265f, 10f / 265f }, 1053 { 191f / 265f, 129f / 265f, 45f / 265f }, { 223f / 265f, 194f / 265f, 125f / 265f }, 1054 { 246f / 265f, 232f / 265f, 195f / 265f }, { 199f / 265f, 234f / 265f, 229f / 265f }, 1055 { 128f / 265f, 205f / 265f, 193f / 265f }, { 53f / 265f, 151f / 265f, 143f / 265f }, 1056 { 1f / 265f, 102f / 265f, 94f / 265f }, { 0f / 265f, 60f / 265f, 48f / 265f } }; 1057 1058 @Override 1059 public void apply(float x, float[] out) { 1060 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1061 1062 final float[] col = cols[i]; 1063 1064 out[0] = col[0]; 1065 out[1] = col[1]; 1066 out[2] = col[2]; 1067 } 1068 1069 @Override 1070 public Type type() { 1071 return Type.DIVERGING; 1072 } 1073 1074 @Override 1075 public Mode mode() { 1076 return Mode.DISCRETE; 1077 } 1078 }, 1079 1080 /** 1081 * ColorBrewer "BrBG" colour map with 11 colours. See <a 1082 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1083 * information. 1084 */ 1085 BrBG11 { 1086 private final float[][] cols = { { 84f / 265f, 48f / 265f, 5f / 265f }, { 140f / 265f, 81f / 265f, 10f / 265f }, 1087 { 191f / 265f, 129f / 265f, 45f / 265f }, { 223f / 265f, 194f / 265f, 125f / 265f }, 1088 { 246f / 265f, 232f / 265f, 195f / 265f }, { 245f / 265f, 245f / 265f, 245f / 265f }, 1089 { 199f / 265f, 234f / 265f, 229f / 265f }, { 128f / 265f, 205f / 265f, 193f / 265f }, 1090 { 53f / 265f, 151f / 265f, 143f / 265f }, { 1f / 265f, 102f / 265f, 94f / 265f }, 1091 { 0f / 265f, 60f / 265f, 48f / 265f } }; 1092 1093 @Override 1094 public void apply(float x, float[] out) { 1095 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1096 1097 final float[] col = cols[i]; 1098 1099 out[0] = col[0]; 1100 out[1] = col[1]; 1101 out[2] = col[2]; 1102 } 1103 1104 @Override 1105 public Type type() { 1106 return Type.DIVERGING; 1107 } 1108 1109 @Override 1110 public Mode mode() { 1111 return Mode.DISCRETE; 1112 } 1113 }, 1114 1115 /** 1116 * ColorBrewer "BuGn" colour map with 3 colours. See <a 1117 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1118 * information. 1119 */ 1120 BuGn3 { 1121 private final float[][] cols = { { 229f / 265f, 245f / 265f, 249f / 265f }, 1122 { 153f / 265f, 216f / 265f, 201f / 265f }, { 44f / 265f, 162f / 265f, 95f / 265f } }; 1123 1124 @Override 1125 public void apply(float x, float[] out) { 1126 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1127 1128 final float[] col = cols[i]; 1129 1130 out[0] = col[0]; 1131 out[1] = col[1]; 1132 out[2] = col[2]; 1133 } 1134 1135 @Override 1136 public Type type() { 1137 return Type.SEQUENTIAL; 1138 } 1139 1140 @Override 1141 public Mode mode() { 1142 return Mode.DISCRETE; 1143 } 1144 }, 1145 1146 /** 1147 * ColorBrewer "BuGn" colour map with 4 colours. See <a 1148 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1149 * information. 1150 */ 1151 BuGn4 { 1152 private final float[][] cols = { { 237f / 265f, 248f / 265f, 251f / 265f }, 1153 { 178f / 265f, 226f / 265f, 226f / 265f }, { 102f / 265f, 194f / 265f, 164f / 265f }, 1154 { 35f / 265f, 139f / 265f, 69f / 265f } }; 1155 1156 @Override 1157 public void apply(float x, float[] out) { 1158 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1159 1160 final float[] col = cols[i]; 1161 1162 out[0] = col[0]; 1163 out[1] = col[1]; 1164 out[2] = col[2]; 1165 } 1166 1167 @Override 1168 public Type type() { 1169 return Type.SEQUENTIAL; 1170 } 1171 1172 @Override 1173 public Mode mode() { 1174 return Mode.DISCRETE; 1175 } 1176 }, 1177 1178 /** 1179 * ColorBrewer "BuGn" colour map with 5 colours. See <a 1180 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1181 * information. 1182 */ 1183 BuGn5 { 1184 private final float[][] cols = { { 237f / 265f, 248f / 265f, 251f / 265f }, 1185 { 178f / 265f, 226f / 265f, 226f / 265f }, { 102f / 265f, 194f / 265f, 164f / 265f }, 1186 { 44f / 265f, 162f / 265f, 95f / 265f }, { 0f / 265f, 109f / 265f, 44f / 265f } }; 1187 1188 @Override 1189 public void apply(float x, float[] out) { 1190 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1191 1192 final float[] col = cols[i]; 1193 1194 out[0] = col[0]; 1195 out[1] = col[1]; 1196 out[2] = col[2]; 1197 } 1198 1199 @Override 1200 public Type type() { 1201 return Type.SEQUENTIAL; 1202 } 1203 1204 @Override 1205 public Mode mode() { 1206 return Mode.DISCRETE; 1207 } 1208 }, 1209 1210 /** 1211 * ColorBrewer "BuGn" colour map with 6 colours. See <a 1212 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1213 * information. 1214 */ 1215 BuGn6 { 1216 private final float[][] cols = { { 237f / 265f, 248f / 265f, 251f / 265f }, 1217 { 204f / 265f, 236f / 265f, 230f / 265f }, { 153f / 265f, 216f / 265f, 201f / 265f }, 1218 { 102f / 265f, 194f / 265f, 164f / 265f }, { 44f / 265f, 162f / 265f, 95f / 265f }, 1219 { 0f / 265f, 109f / 265f, 44f / 265f } }; 1220 1221 @Override 1222 public void apply(float x, float[] out) { 1223 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1224 1225 final float[] col = cols[i]; 1226 1227 out[0] = col[0]; 1228 out[1] = col[1]; 1229 out[2] = col[2]; 1230 } 1231 1232 @Override 1233 public Type type() { 1234 return Type.SEQUENTIAL; 1235 } 1236 1237 @Override 1238 public Mode mode() { 1239 return Mode.DISCRETE; 1240 } 1241 }, 1242 1243 /** 1244 * ColorBrewer "BuGn" colour map with 7 colours. See <a 1245 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1246 * information. 1247 */ 1248 BuGn7 { 1249 private final float[][] cols = { { 237f / 265f, 248f / 265f, 251f / 265f }, 1250 { 204f / 265f, 236f / 265f, 230f / 265f }, { 153f / 265f, 216f / 265f, 201f / 265f }, 1251 { 102f / 265f, 194f / 265f, 164f / 265f }, { 65f / 265f, 174f / 265f, 118f / 265f }, 1252 { 35f / 265f, 139f / 265f, 69f / 265f }, { 0f / 265f, 88f / 265f, 36f / 265f } }; 1253 1254 @Override 1255 public void apply(float x, float[] out) { 1256 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1257 1258 final float[] col = cols[i]; 1259 1260 out[0] = col[0]; 1261 out[1] = col[1]; 1262 out[2] = col[2]; 1263 } 1264 1265 @Override 1266 public Type type() { 1267 return Type.SEQUENTIAL; 1268 } 1269 1270 @Override 1271 public Mode mode() { 1272 return Mode.DISCRETE; 1273 } 1274 }, 1275 1276 /** 1277 * ColorBrewer "BuGn" colour map with 8 colours. See <a 1278 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1279 * information. 1280 */ 1281 BuGn8 { 1282 private final float[][] cols = { { 247f / 265f, 252f / 265f, 253f / 265f }, 1283 { 229f / 265f, 245f / 265f, 249f / 265f }, { 204f / 265f, 236f / 265f, 230f / 265f }, 1284 { 153f / 265f, 216f / 265f, 201f / 265f }, { 102f / 265f, 194f / 265f, 164f / 265f }, 1285 { 65f / 265f, 174f / 265f, 118f / 265f }, { 35f / 265f, 139f / 265f, 69f / 265f }, 1286 { 0f / 265f, 88f / 265f, 36f / 265f } }; 1287 1288 @Override 1289 public void apply(float x, float[] out) { 1290 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1291 1292 final float[] col = cols[i]; 1293 1294 out[0] = col[0]; 1295 out[1] = col[1]; 1296 out[2] = col[2]; 1297 } 1298 1299 @Override 1300 public Type type() { 1301 return Type.SEQUENTIAL; 1302 } 1303 1304 @Override 1305 public Mode mode() { 1306 return Mode.DISCRETE; 1307 } 1308 }, 1309 1310 /** 1311 * ColorBrewer "BuGn" colour map with 9 colours. See <a 1312 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1313 * information. 1314 */ 1315 BuGn9 { 1316 private final float[][] cols = { { 247f / 265f, 252f / 265f, 253f / 265f }, 1317 { 229f / 265f, 245f / 265f, 249f / 265f }, { 204f / 265f, 236f / 265f, 230f / 265f }, 1318 { 153f / 265f, 216f / 265f, 201f / 265f }, { 102f / 265f, 194f / 265f, 164f / 265f }, 1319 { 65f / 265f, 174f / 265f, 118f / 265f }, { 35f / 265f, 139f / 265f, 69f / 265f }, 1320 { 0f / 265f, 109f / 265f, 44f / 265f }, { 0f / 265f, 68f / 265f, 27f / 265f } }; 1321 1322 @Override 1323 public void apply(float x, float[] out) { 1324 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1325 1326 final float[] col = cols[i]; 1327 1328 out[0] = col[0]; 1329 out[1] = col[1]; 1330 out[2] = col[2]; 1331 } 1332 1333 @Override 1334 public Type type() { 1335 return Type.SEQUENTIAL; 1336 } 1337 1338 @Override 1339 public Mode mode() { 1340 return Mode.DISCRETE; 1341 } 1342 }, 1343 1344 /** 1345 * ColorBrewer "BuPu" colour map with 3 colours. See <a 1346 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1347 * information. 1348 */ 1349 BuPu3 { 1350 private final float[][] cols = { { 224f / 265f, 236f / 265f, 244f / 265f }, 1351 { 158f / 265f, 188f / 265f, 218f / 265f }, { 136f / 265f, 86f / 265f, 167f / 265f } }; 1352 1353 @Override 1354 public void apply(float x, float[] out) { 1355 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1356 1357 final float[] col = cols[i]; 1358 1359 out[0] = col[0]; 1360 out[1] = col[1]; 1361 out[2] = col[2]; 1362 } 1363 1364 @Override 1365 public Type type() { 1366 return Type.SEQUENTIAL; 1367 } 1368 1369 @Override 1370 public Mode mode() { 1371 return Mode.DISCRETE; 1372 } 1373 }, 1374 1375 /** 1376 * ColorBrewer "BuPu" colour map with 4 colours. See <a 1377 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1378 * information. 1379 */ 1380 BuPu4 { 1381 private final float[][] cols = { { 237f / 265f, 248f / 265f, 251f / 265f }, 1382 { 179f / 265f, 205f / 265f, 227f / 265f }, { 140f / 265f, 150f / 265f, 198f / 265f }, 1383 { 136f / 265f, 65f / 265f, 157f / 265f } }; 1384 1385 @Override 1386 public void apply(float x, float[] out) { 1387 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1388 1389 final float[] col = cols[i]; 1390 1391 out[0] = col[0]; 1392 out[1] = col[1]; 1393 out[2] = col[2]; 1394 } 1395 1396 @Override 1397 public Type type() { 1398 return Type.SEQUENTIAL; 1399 } 1400 1401 @Override 1402 public Mode mode() { 1403 return Mode.DISCRETE; 1404 } 1405 }, 1406 1407 /** 1408 * ColorBrewer "BuPu" colour map with 5 colours. See <a 1409 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1410 * information. 1411 */ 1412 BuPu5 { 1413 private final float[][] cols = { { 237f / 265f, 248f / 265f, 251f / 265f }, 1414 { 179f / 265f, 205f / 265f, 227f / 265f }, { 140f / 265f, 150f / 265f, 198f / 265f }, 1415 { 136f / 265f, 86f / 265f, 167f / 265f }, { 129f / 265f, 15f / 265f, 124f / 265f } }; 1416 1417 @Override 1418 public void apply(float x, float[] out) { 1419 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1420 1421 final float[] col = cols[i]; 1422 1423 out[0] = col[0]; 1424 out[1] = col[1]; 1425 out[2] = col[2]; 1426 } 1427 1428 @Override 1429 public Type type() { 1430 return Type.SEQUENTIAL; 1431 } 1432 1433 @Override 1434 public Mode mode() { 1435 return Mode.DISCRETE; 1436 } 1437 }, 1438 1439 /** 1440 * ColorBrewer "BuPu" colour map with 6 colours. See <a 1441 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1442 * information. 1443 */ 1444 BuPu6 { 1445 private final float[][] cols = { { 237f / 265f, 248f / 265f, 251f / 265f }, 1446 { 191f / 265f, 211f / 265f, 230f / 265f }, { 158f / 265f, 188f / 265f, 218f / 265f }, 1447 { 140f / 265f, 150f / 265f, 198f / 265f }, { 136f / 265f, 86f / 265f, 167f / 265f }, 1448 { 129f / 265f, 15f / 265f, 124f / 265f } }; 1449 1450 @Override 1451 public void apply(float x, float[] out) { 1452 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1453 1454 final float[] col = cols[i]; 1455 1456 out[0] = col[0]; 1457 out[1] = col[1]; 1458 out[2] = col[2]; 1459 } 1460 1461 @Override 1462 public Type type() { 1463 return Type.SEQUENTIAL; 1464 } 1465 1466 @Override 1467 public Mode mode() { 1468 return Mode.DISCRETE; 1469 } 1470 }, 1471 1472 /** 1473 * ColorBrewer "BuPu" colour map with 7 colours. See <a 1474 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1475 * information. 1476 */ 1477 BuPu7 { 1478 private final float[][] cols = { { 237f / 265f, 248f / 265f, 251f / 265f }, 1479 { 191f / 265f, 211f / 265f, 230f / 265f }, { 158f / 265f, 188f / 265f, 218f / 265f }, 1480 { 140f / 265f, 150f / 265f, 198f / 265f }, { 140f / 265f, 107f / 265f, 177f / 265f }, 1481 { 136f / 265f, 65f / 265f, 157f / 265f }, { 110f / 265f, 1f / 265f, 107f / 265f } }; 1482 1483 @Override 1484 public void apply(float x, float[] out) { 1485 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1486 1487 final float[] col = cols[i]; 1488 1489 out[0] = col[0]; 1490 out[1] = col[1]; 1491 out[2] = col[2]; 1492 } 1493 1494 @Override 1495 public Type type() { 1496 return Type.SEQUENTIAL; 1497 } 1498 1499 @Override 1500 public Mode mode() { 1501 return Mode.DISCRETE; 1502 } 1503 }, 1504 1505 /** 1506 * ColorBrewer "BuPu" colour map with 8 colours. See <a 1507 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1508 * information. 1509 */ 1510 BuPu8 { 1511 private final float[][] cols = { { 247f / 265f, 252f / 265f, 253f / 265f }, 1512 { 224f / 265f, 236f / 265f, 244f / 265f }, { 191f / 265f, 211f / 265f, 230f / 265f }, 1513 { 158f / 265f, 188f / 265f, 218f / 265f }, { 140f / 265f, 150f / 265f, 198f / 265f }, 1514 { 140f / 265f, 107f / 265f, 177f / 265f }, { 136f / 265f, 65f / 265f, 157f / 265f }, 1515 { 110f / 265f, 1f / 265f, 107f / 265f } }; 1516 1517 @Override 1518 public void apply(float x, float[] out) { 1519 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1520 1521 final float[] col = cols[i]; 1522 1523 out[0] = col[0]; 1524 out[1] = col[1]; 1525 out[2] = col[2]; 1526 } 1527 1528 @Override 1529 public Type type() { 1530 return Type.SEQUENTIAL; 1531 } 1532 1533 @Override 1534 public Mode mode() { 1535 return Mode.DISCRETE; 1536 } 1537 }, 1538 1539 /** 1540 * ColorBrewer "BuPu" colour map with 9 colours. See <a 1541 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1542 * information. 1543 */ 1544 BuPu9 { 1545 private final float[][] cols = { { 247f / 265f, 252f / 265f, 253f / 265f }, 1546 { 224f / 265f, 236f / 265f, 244f / 265f }, { 191f / 265f, 211f / 265f, 230f / 265f }, 1547 { 158f / 265f, 188f / 265f, 218f / 265f }, { 140f / 265f, 150f / 265f, 198f / 265f }, 1548 { 140f / 265f, 107f / 265f, 177f / 265f }, { 136f / 265f, 65f / 265f, 157f / 265f }, 1549 { 129f / 265f, 15f / 265f, 124f / 265f }, { 77f / 265f, 0f / 265f, 75f / 265f } }; 1550 1551 @Override 1552 public void apply(float x, float[] out) { 1553 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1554 1555 final float[] col = cols[i]; 1556 1557 out[0] = col[0]; 1558 out[1] = col[1]; 1559 out[2] = col[2]; 1560 } 1561 1562 @Override 1563 public Type type() { 1564 return Type.SEQUENTIAL; 1565 } 1566 1567 @Override 1568 public Mode mode() { 1569 return Mode.DISCRETE; 1570 } 1571 }, 1572 1573 /** 1574 * ColorBrewer "Dark2" colour map with 3 colours. See <a 1575 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1576 * information. 1577 */ 1578 Dark23 { 1579 private final float[][] cols = { { 27f / 265f, 158f / 265f, 119f / 265f }, 1580 { 217f / 265f, 95f / 265f, 2f / 265f }, { 117f / 265f, 112f / 265f, 179f / 265f } }; 1581 1582 @Override 1583 public void apply(float x, float[] out) { 1584 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1585 1586 final float[] col = cols[i]; 1587 1588 out[0] = col[0]; 1589 out[1] = col[1]; 1590 out[2] = col[2]; 1591 } 1592 1593 @Override 1594 public Type type() { 1595 return Type.QUALITATIVE; 1596 } 1597 1598 @Override 1599 public Mode mode() { 1600 return Mode.DISCRETE; 1601 } 1602 }, 1603 1604 /** 1605 * ColorBrewer "Dark2" colour map with 4 colours. See <a 1606 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1607 * information. 1608 */ 1609 Dark24 { 1610 private final float[][] cols = { { 27f / 265f, 158f / 265f, 119f / 265f }, 1611 { 217f / 265f, 95f / 265f, 2f / 265f }, { 117f / 265f, 112f / 265f, 179f / 265f }, 1612 { 231f / 265f, 41f / 265f, 138f / 265f } }; 1613 1614 @Override 1615 public void apply(float x, float[] out) { 1616 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1617 1618 final float[] col = cols[i]; 1619 1620 out[0] = col[0]; 1621 out[1] = col[1]; 1622 out[2] = col[2]; 1623 } 1624 1625 @Override 1626 public Type type() { 1627 return Type.QUALITATIVE; 1628 } 1629 1630 @Override 1631 public Mode mode() { 1632 return Mode.DISCRETE; 1633 } 1634 }, 1635 1636 /** 1637 * ColorBrewer "Dark2" colour map with 5 colours. See <a 1638 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1639 * information. 1640 */ 1641 Dark25 { 1642 private final float[][] cols = { { 27f / 265f, 158f / 265f, 119f / 265f }, 1643 { 217f / 265f, 95f / 265f, 2f / 265f }, { 117f / 265f, 112f / 265f, 179f / 265f }, 1644 { 231f / 265f, 41f / 265f, 138f / 265f }, { 102f / 265f, 166f / 265f, 30f / 265f } }; 1645 1646 @Override 1647 public void apply(float x, float[] out) { 1648 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1649 1650 final float[] col = cols[i]; 1651 1652 out[0] = col[0]; 1653 out[1] = col[1]; 1654 out[2] = col[2]; 1655 } 1656 1657 @Override 1658 public Type type() { 1659 return Type.QUALITATIVE; 1660 } 1661 1662 @Override 1663 public Mode mode() { 1664 return Mode.DISCRETE; 1665 } 1666 }, 1667 1668 /** 1669 * ColorBrewer "Dark2" colour map with 6 colours. See <a 1670 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1671 * information. 1672 */ 1673 Dark26 { 1674 private final float[][] cols = { { 27f / 265f, 158f / 265f, 119f / 265f }, 1675 { 217f / 265f, 95f / 265f, 2f / 265f }, { 117f / 265f, 112f / 265f, 179f / 265f }, 1676 { 231f / 265f, 41f / 265f, 138f / 265f }, { 102f / 265f, 166f / 265f, 30f / 265f }, 1677 { 230f / 265f, 171f / 265f, 2f / 265f } }; 1678 1679 @Override 1680 public void apply(float x, float[] out) { 1681 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1682 1683 final float[] col = cols[i]; 1684 1685 out[0] = col[0]; 1686 out[1] = col[1]; 1687 out[2] = col[2]; 1688 } 1689 1690 @Override 1691 public Type type() { 1692 return Type.QUALITATIVE; 1693 } 1694 1695 @Override 1696 public Mode mode() { 1697 return Mode.DISCRETE; 1698 } 1699 }, 1700 1701 /** 1702 * ColorBrewer "Dark2" colour map with 7 colours. See <a 1703 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1704 * information. 1705 */ 1706 Dark27 { 1707 private final float[][] cols = { { 27f / 265f, 158f / 265f, 119f / 265f }, 1708 { 217f / 265f, 95f / 265f, 2f / 265f }, { 117f / 265f, 112f / 265f, 179f / 265f }, 1709 { 231f / 265f, 41f / 265f, 138f / 265f }, { 102f / 265f, 166f / 265f, 30f / 265f }, 1710 { 230f / 265f, 171f / 265f, 2f / 265f }, { 166f / 265f, 118f / 265f, 29f / 265f } }; 1711 1712 @Override 1713 public void apply(float x, float[] out) { 1714 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1715 1716 final float[] col = cols[i]; 1717 1718 out[0] = col[0]; 1719 out[1] = col[1]; 1720 out[2] = col[2]; 1721 } 1722 1723 @Override 1724 public Type type() { 1725 return Type.QUALITATIVE; 1726 } 1727 1728 @Override 1729 public Mode mode() { 1730 return Mode.DISCRETE; 1731 } 1732 }, 1733 1734 /** 1735 * ColorBrewer "Dark2" colour map with 8 colours. See <a 1736 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1737 * information. 1738 */ 1739 Dark28 { 1740 private final float[][] cols = { { 27f / 265f, 158f / 265f, 119f / 265f }, 1741 { 217f / 265f, 95f / 265f, 2f / 265f }, { 117f / 265f, 112f / 265f, 179f / 265f }, 1742 { 231f / 265f, 41f / 265f, 138f / 265f }, { 102f / 265f, 166f / 265f, 30f / 265f }, 1743 { 230f / 265f, 171f / 265f, 2f / 265f }, { 166f / 265f, 118f / 265f, 29f / 265f }, 1744 { 102f / 265f, 102f / 265f, 102f / 265f } }; 1745 1746 @Override 1747 public void apply(float x, float[] out) { 1748 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1749 1750 final float[] col = cols[i]; 1751 1752 out[0] = col[0]; 1753 out[1] = col[1]; 1754 out[2] = col[2]; 1755 } 1756 1757 @Override 1758 public Type type() { 1759 return Type.QUALITATIVE; 1760 } 1761 1762 @Override 1763 public Mode mode() { 1764 return Mode.DISCRETE; 1765 } 1766 }, 1767 1768 /** 1769 * ColorBrewer "GnBu" colour map with 3 colours. See <a 1770 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1771 * information. 1772 */ 1773 GnBu3 { 1774 private final float[][] cols = { { 224f / 265f, 243f / 265f, 219f / 265f }, 1775 { 168f / 265f, 221f / 265f, 181f / 265f }, { 67f / 265f, 162f / 265f, 202f / 265f } }; 1776 1777 @Override 1778 public void apply(float x, float[] out) { 1779 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1780 1781 final float[] col = cols[i]; 1782 1783 out[0] = col[0]; 1784 out[1] = col[1]; 1785 out[2] = col[2]; 1786 } 1787 1788 @Override 1789 public Type type() { 1790 return Type.SEQUENTIAL; 1791 } 1792 1793 @Override 1794 public Mode mode() { 1795 return Mode.DISCRETE; 1796 } 1797 }, 1798 1799 /** 1800 * ColorBrewer "GnBu" colour map with 4 colours. See <a 1801 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1802 * information. 1803 */ 1804 GnBu4 { 1805 private final float[][] cols = { { 240f / 265f, 249f / 265f, 232f / 265f }, 1806 { 186f / 265f, 228f / 265f, 188f / 265f }, { 123f / 265f, 204f / 265f, 196f / 265f }, 1807 { 43f / 265f, 140f / 265f, 190f / 265f } }; 1808 1809 @Override 1810 public void apply(float x, float[] out) { 1811 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1812 1813 final float[] col = cols[i]; 1814 1815 out[0] = col[0]; 1816 out[1] = col[1]; 1817 out[2] = col[2]; 1818 } 1819 1820 @Override 1821 public Type type() { 1822 return Type.SEQUENTIAL; 1823 } 1824 1825 @Override 1826 public Mode mode() { 1827 return Mode.DISCRETE; 1828 } 1829 }, 1830 1831 /** 1832 * ColorBrewer "GnBu" colour map with 5 colours. See <a 1833 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1834 * information. 1835 */ 1836 GnBu5 { 1837 private final float[][] cols = { { 240f / 265f, 249f / 265f, 232f / 265f }, 1838 { 186f / 265f, 228f / 265f, 188f / 265f }, { 123f / 265f, 204f / 265f, 196f / 265f }, 1839 { 67f / 265f, 162f / 265f, 202f / 265f }, { 8f / 265f, 104f / 265f, 172f / 265f } }; 1840 1841 @Override 1842 public void apply(float x, float[] out) { 1843 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1844 1845 final float[] col = cols[i]; 1846 1847 out[0] = col[0]; 1848 out[1] = col[1]; 1849 out[2] = col[2]; 1850 } 1851 1852 @Override 1853 public Type type() { 1854 return Type.SEQUENTIAL; 1855 } 1856 1857 @Override 1858 public Mode mode() { 1859 return Mode.DISCRETE; 1860 } 1861 }, 1862 1863 /** 1864 * ColorBrewer "GnBu" colour map with 6 colours. See <a 1865 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1866 * information. 1867 */ 1868 GnBu6 { 1869 private final float[][] cols = { { 240f / 265f, 249f / 265f, 232f / 265f }, 1870 { 204f / 265f, 235f / 265f, 197f / 265f }, { 168f / 265f, 221f / 265f, 181f / 265f }, 1871 { 123f / 265f, 204f / 265f, 196f / 265f }, { 67f / 265f, 162f / 265f, 202f / 265f }, 1872 { 8f / 265f, 104f / 265f, 172f / 265f } }; 1873 1874 @Override 1875 public void apply(float x, float[] out) { 1876 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1877 1878 final float[] col = cols[i]; 1879 1880 out[0] = col[0]; 1881 out[1] = col[1]; 1882 out[2] = col[2]; 1883 } 1884 1885 @Override 1886 public Type type() { 1887 return Type.SEQUENTIAL; 1888 } 1889 1890 @Override 1891 public Mode mode() { 1892 return Mode.DISCRETE; 1893 } 1894 }, 1895 1896 /** 1897 * ColorBrewer "GnBu" colour map with 7 colours. See <a 1898 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1899 * information. 1900 */ 1901 GnBu7 { 1902 private final float[][] cols = { { 240f / 265f, 249f / 265f, 232f / 265f }, 1903 { 204f / 265f, 235f / 265f, 197f / 265f }, { 168f / 265f, 221f / 265f, 181f / 265f }, 1904 { 123f / 265f, 204f / 265f, 196f / 265f }, { 78f / 265f, 179f / 265f, 211f / 265f }, 1905 { 43f / 265f, 140f / 265f, 190f / 265f }, { 8f / 265f, 88f / 265f, 158f / 265f } }; 1906 1907 @Override 1908 public void apply(float x, float[] out) { 1909 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1910 1911 final float[] col = cols[i]; 1912 1913 out[0] = col[0]; 1914 out[1] = col[1]; 1915 out[2] = col[2]; 1916 } 1917 1918 @Override 1919 public Type type() { 1920 return Type.SEQUENTIAL; 1921 } 1922 1923 @Override 1924 public Mode mode() { 1925 return Mode.DISCRETE; 1926 } 1927 }, 1928 1929 /** 1930 * ColorBrewer "GnBu" colour map with 8 colours. See <a 1931 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1932 * information. 1933 */ 1934 GnBu8 { 1935 private final float[][] cols = { { 247f / 265f, 252f / 265f, 240f / 265f }, 1936 { 224f / 265f, 243f / 265f, 219f / 265f }, { 204f / 265f, 235f / 265f, 197f / 265f }, 1937 { 168f / 265f, 221f / 265f, 181f / 265f }, { 123f / 265f, 204f / 265f, 196f / 265f }, 1938 { 78f / 265f, 179f / 265f, 211f / 265f }, { 43f / 265f, 140f / 265f, 190f / 265f }, 1939 { 8f / 265f, 88f / 265f, 158f / 265f } }; 1940 1941 @Override 1942 public void apply(float x, float[] out) { 1943 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1944 1945 final float[] col = cols[i]; 1946 1947 out[0] = col[0]; 1948 out[1] = col[1]; 1949 out[2] = col[2]; 1950 } 1951 1952 @Override 1953 public Type type() { 1954 return Type.SEQUENTIAL; 1955 } 1956 1957 @Override 1958 public Mode mode() { 1959 return Mode.DISCRETE; 1960 } 1961 }, 1962 1963 /** 1964 * ColorBrewer "GnBu" colour map with 9 colours. See <a 1965 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 1966 * information. 1967 */ 1968 GnBu9 { 1969 private final float[][] cols = { { 247f / 265f, 252f / 265f, 240f / 265f }, 1970 { 224f / 265f, 243f / 265f, 219f / 265f }, { 204f / 265f, 235f / 265f, 197f / 265f }, 1971 { 168f / 265f, 221f / 265f, 181f / 265f }, { 123f / 265f, 204f / 265f, 196f / 265f }, 1972 { 78f / 265f, 179f / 265f, 211f / 265f }, { 43f / 265f, 140f / 265f, 190f / 265f }, 1973 { 8f / 265f, 104f / 265f, 172f / 265f }, { 8f / 265f, 64f / 265f, 129f / 265f } }; 1974 1975 @Override 1976 public void apply(float x, float[] out) { 1977 final int i = Math.min((int) (x * cols.length), cols.length - 1); 1978 1979 final float[] col = cols[i]; 1980 1981 out[0] = col[0]; 1982 out[1] = col[1]; 1983 out[2] = col[2]; 1984 } 1985 1986 @Override 1987 public Type type() { 1988 return Type.SEQUENTIAL; 1989 } 1990 1991 @Override 1992 public Mode mode() { 1993 return Mode.DISCRETE; 1994 } 1995 }, 1996 1997 /** 1998 * ColorBrewer "Greens" colour map with 3 colours. See <a 1999 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2000 * information. 2001 */ 2002 Greens3 { 2003 private final float[][] cols = { { 229f / 265f, 245f / 265f, 224f / 265f }, 2004 { 161f / 265f, 217f / 265f, 155f / 265f }, { 49f / 265f, 163f / 265f, 84f / 265f } }; 2005 2006 @Override 2007 public void apply(float x, float[] out) { 2008 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2009 2010 final float[] col = cols[i]; 2011 2012 out[0] = col[0]; 2013 out[1] = col[1]; 2014 out[2] = col[2]; 2015 } 2016 2017 @Override 2018 public Type type() { 2019 return Type.SEQUENTIAL; 2020 } 2021 2022 @Override 2023 public Mode mode() { 2024 return Mode.DISCRETE; 2025 } 2026 }, 2027 2028 /** 2029 * ColorBrewer "Greens" colour map with 4 colours. See <a 2030 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2031 * information. 2032 */ 2033 Greens4 { 2034 private final float[][] cols = { { 237f / 265f, 248f / 265f, 233f / 265f }, 2035 { 186f / 265f, 228f / 265f, 179f / 265f }, { 116f / 265f, 196f / 265f, 118f / 265f }, 2036 { 35f / 265f, 139f / 265f, 69f / 265f } }; 2037 2038 @Override 2039 public void apply(float x, float[] out) { 2040 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2041 2042 final float[] col = cols[i]; 2043 2044 out[0] = col[0]; 2045 out[1] = col[1]; 2046 out[2] = col[2]; 2047 } 2048 2049 @Override 2050 public Type type() { 2051 return Type.SEQUENTIAL; 2052 } 2053 2054 @Override 2055 public Mode mode() { 2056 return Mode.DISCRETE; 2057 } 2058 }, 2059 2060 /** 2061 * ColorBrewer "Greens" colour map with 5 colours. See <a 2062 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2063 * information. 2064 */ 2065 Greens5 { 2066 private final float[][] cols = { { 237f / 265f, 248f / 265f, 233f / 265f }, 2067 { 186f / 265f, 228f / 265f, 179f / 265f }, { 116f / 265f, 196f / 265f, 118f / 265f }, 2068 { 49f / 265f, 163f / 265f, 84f / 265f }, { 0f / 265f, 109f / 265f, 44f / 265f } }; 2069 2070 @Override 2071 public void apply(float x, float[] out) { 2072 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2073 2074 final float[] col = cols[i]; 2075 2076 out[0] = col[0]; 2077 out[1] = col[1]; 2078 out[2] = col[2]; 2079 } 2080 2081 @Override 2082 public Type type() { 2083 return Type.SEQUENTIAL; 2084 } 2085 2086 @Override 2087 public Mode mode() { 2088 return Mode.DISCRETE; 2089 } 2090 }, 2091 2092 /** 2093 * ColorBrewer "Greens" colour map with 6 colours. See <a 2094 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2095 * information. 2096 */ 2097 Greens6 { 2098 private final float[][] cols = { { 237f / 265f, 248f / 265f, 233f / 265f }, 2099 { 199f / 265f, 233f / 265f, 192f / 265f }, { 161f / 265f, 217f / 265f, 155f / 265f }, 2100 { 116f / 265f, 196f / 265f, 118f / 265f }, { 49f / 265f, 163f / 265f, 84f / 265f }, 2101 { 0f / 265f, 109f / 265f, 44f / 265f } }; 2102 2103 @Override 2104 public void apply(float x, float[] out) { 2105 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2106 2107 final float[] col = cols[i]; 2108 2109 out[0] = col[0]; 2110 out[1] = col[1]; 2111 out[2] = col[2]; 2112 } 2113 2114 @Override 2115 public Type type() { 2116 return Type.SEQUENTIAL; 2117 } 2118 2119 @Override 2120 public Mode mode() { 2121 return Mode.DISCRETE; 2122 } 2123 }, 2124 2125 /** 2126 * ColorBrewer "Greens" colour map with 7 colours. See <a 2127 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2128 * information. 2129 */ 2130 Greens7 { 2131 private final float[][] cols = { { 237f / 265f, 248f / 265f, 233f / 265f }, 2132 { 199f / 265f, 233f / 265f, 192f / 265f }, { 161f / 265f, 217f / 265f, 155f / 265f }, 2133 { 116f / 265f, 196f / 265f, 118f / 265f }, { 65f / 265f, 171f / 265f, 93f / 265f }, 2134 { 35f / 265f, 139f / 265f, 69f / 265f }, { 0f / 265f, 90f / 265f, 50f / 265f } }; 2135 2136 @Override 2137 public void apply(float x, float[] out) { 2138 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2139 2140 final float[] col = cols[i]; 2141 2142 out[0] = col[0]; 2143 out[1] = col[1]; 2144 out[2] = col[2]; 2145 } 2146 2147 @Override 2148 public Type type() { 2149 return Type.SEQUENTIAL; 2150 } 2151 2152 @Override 2153 public Mode mode() { 2154 return Mode.DISCRETE; 2155 } 2156 }, 2157 2158 /** 2159 * ColorBrewer "Greens" colour map with 8 colours. See <a 2160 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2161 * information. 2162 */ 2163 Greens8 { 2164 private final float[][] cols = { { 247f / 265f, 252f / 265f, 245f / 265f }, 2165 { 229f / 265f, 245f / 265f, 224f / 265f }, { 199f / 265f, 233f / 265f, 192f / 265f }, 2166 { 161f / 265f, 217f / 265f, 155f / 265f }, { 116f / 265f, 196f / 265f, 118f / 265f }, 2167 { 65f / 265f, 171f / 265f, 93f / 265f }, { 35f / 265f, 139f / 265f, 69f / 265f }, 2168 { 0f / 265f, 90f / 265f, 50f / 265f } }; 2169 2170 @Override 2171 public void apply(float x, float[] out) { 2172 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2173 2174 final float[] col = cols[i]; 2175 2176 out[0] = col[0]; 2177 out[1] = col[1]; 2178 out[2] = col[2]; 2179 } 2180 2181 @Override 2182 public Type type() { 2183 return Type.SEQUENTIAL; 2184 } 2185 2186 @Override 2187 public Mode mode() { 2188 return Mode.DISCRETE; 2189 } 2190 }, 2191 2192 /** 2193 * ColorBrewer "Greens" colour map with 9 colours. See <a 2194 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2195 * information. 2196 */ 2197 Greens9 { 2198 private final float[][] cols = { { 247f / 265f, 252f / 265f, 245f / 265f }, 2199 { 229f / 265f, 245f / 265f, 224f / 265f }, { 199f / 265f, 233f / 265f, 192f / 265f }, 2200 { 161f / 265f, 217f / 265f, 155f / 265f }, { 116f / 265f, 196f / 265f, 118f / 265f }, 2201 { 65f / 265f, 171f / 265f, 93f / 265f }, { 35f / 265f, 139f / 265f, 69f / 265f }, 2202 { 0f / 265f, 109f / 265f, 44f / 265f }, { 0f / 265f, 68f / 265f, 27f / 265f } }; 2203 2204 @Override 2205 public void apply(float x, float[] out) { 2206 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2207 2208 final float[] col = cols[i]; 2209 2210 out[0] = col[0]; 2211 out[1] = col[1]; 2212 out[2] = col[2]; 2213 } 2214 2215 @Override 2216 public Type type() { 2217 return Type.SEQUENTIAL; 2218 } 2219 2220 @Override 2221 public Mode mode() { 2222 return Mode.DISCRETE; 2223 } 2224 }, 2225 2226 /** 2227 * ColorBrewer "Greys" colour map with 3 colours. See <a 2228 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2229 * information. 2230 */ 2231 Greys3 { 2232 private final float[][] cols = { { 240f / 265f, 240f / 265f, 240f / 265f }, 2233 { 189f / 265f, 189f / 265f, 189f / 265f }, { 99f / 265f, 99f / 265f, 99f / 265f } }; 2234 2235 @Override 2236 public void apply(float x, float[] out) { 2237 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2238 2239 final float[] col = cols[i]; 2240 2241 out[0] = col[0]; 2242 out[1] = col[1]; 2243 out[2] = col[2]; 2244 } 2245 2246 @Override 2247 public Type type() { 2248 return Type.SEQUENTIAL; 2249 } 2250 2251 @Override 2252 public Mode mode() { 2253 return Mode.DISCRETE; 2254 } 2255 }, 2256 2257 /** 2258 * ColorBrewer "Greys" colour map with 4 colours. See <a 2259 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2260 * information. 2261 */ 2262 Greys4 { 2263 private final float[][] cols = { { 247f / 265f, 247f / 265f, 247f / 265f }, 2264 { 204f / 265f, 204f / 265f, 204f / 265f }, { 150f / 265f, 150f / 265f, 150f / 265f }, 2265 { 82f / 265f, 82f / 265f, 82f / 265f } }; 2266 2267 @Override 2268 public void apply(float x, float[] out) { 2269 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2270 2271 final float[] col = cols[i]; 2272 2273 out[0] = col[0]; 2274 out[1] = col[1]; 2275 out[2] = col[2]; 2276 } 2277 2278 @Override 2279 public Type type() { 2280 return Type.SEQUENTIAL; 2281 } 2282 2283 @Override 2284 public Mode mode() { 2285 return Mode.DISCRETE; 2286 } 2287 }, 2288 2289 /** 2290 * ColorBrewer "Greys" colour map with 5 colours. See <a 2291 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2292 * information. 2293 */ 2294 Greys5 { 2295 private final float[][] cols = { { 247f / 265f, 247f / 265f, 247f / 265f }, 2296 { 204f / 265f, 204f / 265f, 204f / 265f }, { 150f / 265f, 150f / 265f, 150f / 265f }, 2297 { 99f / 265f, 99f / 265f, 99f / 265f }, { 37f / 265f, 37f / 265f, 37f / 265f } }; 2298 2299 @Override 2300 public void apply(float x, float[] out) { 2301 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2302 2303 final float[] col = cols[i]; 2304 2305 out[0] = col[0]; 2306 out[1] = col[1]; 2307 out[2] = col[2]; 2308 } 2309 2310 @Override 2311 public Type type() { 2312 return Type.SEQUENTIAL; 2313 } 2314 2315 @Override 2316 public Mode mode() { 2317 return Mode.DISCRETE; 2318 } 2319 }, 2320 2321 /** 2322 * ColorBrewer "Greys" colour map with 6 colours. See <a 2323 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2324 * information. 2325 */ 2326 Greys6 { 2327 private final float[][] cols = { { 247f / 265f, 247f / 265f, 247f / 265f }, 2328 { 217f / 265f, 217f / 265f, 217f / 265f }, { 189f / 265f, 189f / 265f, 189f / 265f }, 2329 { 150f / 265f, 150f / 265f, 150f / 265f }, { 99f / 265f, 99f / 265f, 99f / 265f }, 2330 { 37f / 265f, 37f / 265f, 37f / 265f } }; 2331 2332 @Override 2333 public void apply(float x, float[] out) { 2334 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2335 2336 final float[] col = cols[i]; 2337 2338 out[0] = col[0]; 2339 out[1] = col[1]; 2340 out[2] = col[2]; 2341 } 2342 2343 @Override 2344 public Type type() { 2345 return Type.SEQUENTIAL; 2346 } 2347 2348 @Override 2349 public Mode mode() { 2350 return Mode.DISCRETE; 2351 } 2352 }, 2353 2354 /** 2355 * ColorBrewer "Greys" colour map with 7 colours. See <a 2356 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2357 * information. 2358 */ 2359 Greys7 { 2360 private final float[][] cols = { { 247f / 265f, 247f / 265f, 247f / 265f }, 2361 { 217f / 265f, 217f / 265f, 217f / 265f }, { 189f / 265f, 189f / 265f, 189f / 265f }, 2362 { 150f / 265f, 150f / 265f, 150f / 265f }, { 115f / 265f, 115f / 265f, 115f / 265f }, 2363 { 82f / 265f, 82f / 265f, 82f / 265f }, { 37f / 265f, 37f / 265f, 37f / 265f } }; 2364 2365 @Override 2366 public void apply(float x, float[] out) { 2367 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2368 2369 final float[] col = cols[i]; 2370 2371 out[0] = col[0]; 2372 out[1] = col[1]; 2373 out[2] = col[2]; 2374 } 2375 2376 @Override 2377 public Type type() { 2378 return Type.SEQUENTIAL; 2379 } 2380 2381 @Override 2382 public Mode mode() { 2383 return Mode.DISCRETE; 2384 } 2385 }, 2386 2387 /** 2388 * ColorBrewer "Greys" colour map with 8 colours. See <a 2389 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2390 * information. 2391 */ 2392 Greys8 { 2393 private final float[][] cols = { { 255f / 265f, 255f / 265f, 255f / 265f }, 2394 { 240f / 265f, 240f / 265f, 240f / 265f }, { 217f / 265f, 217f / 265f, 217f / 265f }, 2395 { 189f / 265f, 189f / 265f, 189f / 265f }, { 150f / 265f, 150f / 265f, 150f / 265f }, 2396 { 115f / 265f, 115f / 265f, 115f / 265f }, { 82f / 265f, 82f / 265f, 82f / 265f }, 2397 { 37f / 265f, 37f / 265f, 37f / 265f } }; 2398 2399 @Override 2400 public void apply(float x, float[] out) { 2401 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2402 2403 final float[] col = cols[i]; 2404 2405 out[0] = col[0]; 2406 out[1] = col[1]; 2407 out[2] = col[2]; 2408 } 2409 2410 @Override 2411 public Type type() { 2412 return Type.SEQUENTIAL; 2413 } 2414 2415 @Override 2416 public Mode mode() { 2417 return Mode.DISCRETE; 2418 } 2419 }, 2420 2421 /** 2422 * ColorBrewer "Greys" colour map with 9 colours. See <a 2423 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2424 * information. 2425 */ 2426 Greys9 { 2427 private final float[][] cols = { { 255f / 265f, 255f / 265f, 255f / 265f }, 2428 { 240f / 265f, 240f / 265f, 240f / 265f }, { 217f / 265f, 217f / 265f, 217f / 265f }, 2429 { 189f / 265f, 189f / 265f, 189f / 265f }, { 150f / 265f, 150f / 265f, 150f / 265f }, 2430 { 115f / 265f, 115f / 265f, 115f / 265f }, { 82f / 265f, 82f / 265f, 82f / 265f }, 2431 { 37f / 265f, 37f / 265f, 37f / 265f }, { 0f / 265f, 0f / 265f, 0f / 265f } }; 2432 2433 @Override 2434 public void apply(float x, float[] out) { 2435 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2436 2437 final float[] col = cols[i]; 2438 2439 out[0] = col[0]; 2440 out[1] = col[1]; 2441 out[2] = col[2]; 2442 } 2443 2444 @Override 2445 public Type type() { 2446 return Type.SEQUENTIAL; 2447 } 2448 2449 @Override 2450 public Mode mode() { 2451 return Mode.DISCRETE; 2452 } 2453 }, 2454 2455 /** 2456 * ColorBrewer "Oranges" colour map with 3 colours. See <a 2457 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2458 * information. 2459 */ 2460 Oranges3 { 2461 private final float[][] cols = { { 254f / 265f, 230f / 265f, 206f / 265f }, 2462 { 253f / 265f, 174f / 265f, 107f / 265f }, { 230f / 265f, 85f / 265f, 13f / 265f } }; 2463 2464 @Override 2465 public void apply(float x, float[] out) { 2466 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2467 2468 final float[] col = cols[i]; 2469 2470 out[0] = col[0]; 2471 out[1] = col[1]; 2472 out[2] = col[2]; 2473 } 2474 2475 @Override 2476 public Type type() { 2477 return Type.SEQUENTIAL; 2478 } 2479 2480 @Override 2481 public Mode mode() { 2482 return Mode.DISCRETE; 2483 } 2484 }, 2485 2486 /** 2487 * ColorBrewer "Oranges" colour map with 4 colours. See <a 2488 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2489 * information. 2490 */ 2491 Oranges4 { 2492 private final float[][] cols = { { 254f / 265f, 237f / 265f, 222f / 265f }, 2493 { 253f / 265f, 190f / 265f, 133f / 265f }, { 253f / 265f, 141f / 265f, 60f / 265f }, 2494 { 217f / 265f, 71f / 265f, 1f / 265f } }; 2495 2496 @Override 2497 public void apply(float x, float[] out) { 2498 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2499 2500 final float[] col = cols[i]; 2501 2502 out[0] = col[0]; 2503 out[1] = col[1]; 2504 out[2] = col[2]; 2505 } 2506 2507 @Override 2508 public Type type() { 2509 return Type.SEQUENTIAL; 2510 } 2511 2512 @Override 2513 public Mode mode() { 2514 return Mode.DISCRETE; 2515 } 2516 }, 2517 2518 /** 2519 * ColorBrewer "Oranges" colour map with 5 colours. See <a 2520 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2521 * information. 2522 */ 2523 Oranges5 { 2524 private final float[][] cols = { { 254f / 265f, 237f / 265f, 222f / 265f }, 2525 { 253f / 265f, 190f / 265f, 133f / 265f }, { 253f / 265f, 141f / 265f, 60f / 265f }, 2526 { 230f / 265f, 85f / 265f, 13f / 265f }, { 166f / 265f, 54f / 265f, 3f / 265f } }; 2527 2528 @Override 2529 public void apply(float x, float[] out) { 2530 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2531 2532 final float[] col = cols[i]; 2533 2534 out[0] = col[0]; 2535 out[1] = col[1]; 2536 out[2] = col[2]; 2537 } 2538 2539 @Override 2540 public Type type() { 2541 return Type.SEQUENTIAL; 2542 } 2543 2544 @Override 2545 public Mode mode() { 2546 return Mode.DISCRETE; 2547 } 2548 }, 2549 2550 /** 2551 * ColorBrewer "Oranges" colour map with 6 colours. See <a 2552 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2553 * information. 2554 */ 2555 Oranges6 { 2556 private final float[][] cols = { { 254f / 265f, 237f / 265f, 222f / 265f }, 2557 { 253f / 265f, 208f / 265f, 162f / 265f }, { 253f / 265f, 174f / 265f, 107f / 265f }, 2558 { 253f / 265f, 141f / 265f, 60f / 265f }, { 230f / 265f, 85f / 265f, 13f / 265f }, 2559 { 166f / 265f, 54f / 265f, 3f / 265f } }; 2560 2561 @Override 2562 public void apply(float x, float[] out) { 2563 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2564 2565 final float[] col = cols[i]; 2566 2567 out[0] = col[0]; 2568 out[1] = col[1]; 2569 out[2] = col[2]; 2570 } 2571 2572 @Override 2573 public Type type() { 2574 return Type.SEQUENTIAL; 2575 } 2576 2577 @Override 2578 public Mode mode() { 2579 return Mode.DISCRETE; 2580 } 2581 }, 2582 2583 /** 2584 * ColorBrewer "Oranges" colour map with 7 colours. See <a 2585 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2586 * information. 2587 */ 2588 Oranges7 { 2589 private final float[][] cols = { { 254f / 265f, 237f / 265f, 222f / 265f }, 2590 { 253f / 265f, 208f / 265f, 162f / 265f }, { 253f / 265f, 174f / 265f, 107f / 265f }, 2591 { 253f / 265f, 141f / 265f, 60f / 265f }, { 241f / 265f, 105f / 265f, 19f / 265f }, 2592 { 217f / 265f, 72f / 265f, 1f / 265f }, { 140f / 265f, 45f / 265f, 4f / 265f } }; 2593 2594 @Override 2595 public void apply(float x, float[] out) { 2596 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2597 2598 final float[] col = cols[i]; 2599 2600 out[0] = col[0]; 2601 out[1] = col[1]; 2602 out[2] = col[2]; 2603 } 2604 2605 @Override 2606 public Type type() { 2607 return Type.SEQUENTIAL; 2608 } 2609 2610 @Override 2611 public Mode mode() { 2612 return Mode.DISCRETE; 2613 } 2614 }, 2615 2616 /** 2617 * ColorBrewer "Oranges" colour map with 8 colours. See <a 2618 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2619 * information. 2620 */ 2621 Oranges8 { 2622 private final float[][] cols = { { 255f / 265f, 245f / 265f, 235f / 265f }, 2623 { 254f / 265f, 230f / 265f, 206f / 265f }, { 253f / 265f, 208f / 265f, 162f / 265f }, 2624 { 253f / 265f, 174f / 265f, 107f / 265f }, { 253f / 265f, 141f / 265f, 60f / 265f }, 2625 { 241f / 265f, 105f / 265f, 19f / 265f }, { 217f / 265f, 72f / 265f, 1f / 265f }, 2626 { 140f / 265f, 45f / 265f, 4f / 265f } }; 2627 2628 @Override 2629 public void apply(float x, float[] out) { 2630 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2631 2632 final float[] col = cols[i]; 2633 2634 out[0] = col[0]; 2635 out[1] = col[1]; 2636 out[2] = col[2]; 2637 } 2638 2639 @Override 2640 public Type type() { 2641 return Type.SEQUENTIAL; 2642 } 2643 2644 @Override 2645 public Mode mode() { 2646 return Mode.DISCRETE; 2647 } 2648 }, 2649 2650 /** 2651 * ColorBrewer "Oranges" colour map with 9 colours. See <a 2652 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2653 * information. 2654 */ 2655 Oranges9 { 2656 private final float[][] cols = { { 255f / 265f, 245f / 265f, 235f / 265f }, 2657 { 254f / 265f, 230f / 265f, 206f / 265f }, { 253f / 265f, 208f / 265f, 162f / 265f }, 2658 { 253f / 265f, 174f / 265f, 107f / 265f }, { 253f / 265f, 141f / 265f, 60f / 265f }, 2659 { 241f / 265f, 105f / 265f, 19f / 265f }, { 217f / 265f, 72f / 265f, 1f / 265f }, 2660 { 166f / 265f, 54f / 265f, 3f / 265f }, { 127f / 265f, 39f / 265f, 4f / 265f } }; 2661 2662 @Override 2663 public void apply(float x, float[] out) { 2664 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2665 2666 final float[] col = cols[i]; 2667 2668 out[0] = col[0]; 2669 out[1] = col[1]; 2670 out[2] = col[2]; 2671 } 2672 2673 @Override 2674 public Type type() { 2675 return Type.SEQUENTIAL; 2676 } 2677 2678 @Override 2679 public Mode mode() { 2680 return Mode.DISCRETE; 2681 } 2682 }, 2683 2684 /** 2685 * ColorBrewer "OrRd" colour map with 3 colours. See <a 2686 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2687 * information. 2688 */ 2689 OrRd3 { 2690 private final float[][] cols = { { 254f / 265f, 232f / 265f, 200f / 265f }, 2691 { 253f / 265f, 187f / 265f, 132f / 265f }, { 227f / 265f, 74f / 265f, 51f / 265f } }; 2692 2693 @Override 2694 public void apply(float x, float[] out) { 2695 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2696 2697 final float[] col = cols[i]; 2698 2699 out[0] = col[0]; 2700 out[1] = col[1]; 2701 out[2] = col[2]; 2702 } 2703 2704 @Override 2705 public Type type() { 2706 return Type.SEQUENTIAL; 2707 } 2708 2709 @Override 2710 public Mode mode() { 2711 return Mode.DISCRETE; 2712 } 2713 }, 2714 2715 /** 2716 * ColorBrewer "OrRd" colour map with 4 colours. See <a 2717 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2718 * information. 2719 */ 2720 OrRd4 { 2721 private final float[][] cols = { { 254f / 265f, 240f / 265f, 217f / 265f }, 2722 { 253f / 265f, 204f / 265f, 138f / 265f }, { 252f / 265f, 141f / 265f, 89f / 265f }, 2723 { 215f / 265f, 48f / 265f, 31f / 265f } }; 2724 2725 @Override 2726 public void apply(float x, float[] out) { 2727 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2728 2729 final float[] col = cols[i]; 2730 2731 out[0] = col[0]; 2732 out[1] = col[1]; 2733 out[2] = col[2]; 2734 } 2735 2736 @Override 2737 public Type type() { 2738 return Type.SEQUENTIAL; 2739 } 2740 2741 @Override 2742 public Mode mode() { 2743 return Mode.DISCRETE; 2744 } 2745 }, 2746 2747 /** 2748 * ColorBrewer "OrRd" colour map with 5 colours. See <a 2749 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2750 * information. 2751 */ 2752 OrRd5 { 2753 private final float[][] cols = { { 254f / 265f, 240f / 265f, 217f / 265f }, 2754 { 253f / 265f, 204f / 265f, 138f / 265f }, { 252f / 265f, 141f / 265f, 89f / 265f }, 2755 { 227f / 265f, 74f / 265f, 51f / 265f }, { 179f / 265f, 0f / 265f, 0f / 265f } }; 2756 2757 @Override 2758 public void apply(float x, float[] out) { 2759 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2760 2761 final float[] col = cols[i]; 2762 2763 out[0] = col[0]; 2764 out[1] = col[1]; 2765 out[2] = col[2]; 2766 } 2767 2768 @Override 2769 public Type type() { 2770 return Type.SEQUENTIAL; 2771 } 2772 2773 @Override 2774 public Mode mode() { 2775 return Mode.DISCRETE; 2776 } 2777 }, 2778 2779 /** 2780 * ColorBrewer "OrRd" colour map with 6 colours. See <a 2781 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2782 * information. 2783 */ 2784 OrRd6 { 2785 private final float[][] cols = { { 254f / 265f, 240f / 265f, 217f / 265f }, 2786 { 253f / 265f, 212f / 265f, 158f / 265f }, { 253f / 265f, 187f / 265f, 132f / 265f }, 2787 { 252f / 265f, 141f / 265f, 89f / 265f }, { 227f / 265f, 74f / 265f, 51f / 265f }, 2788 { 179f / 265f, 0f / 265f, 0f / 265f } }; 2789 2790 @Override 2791 public void apply(float x, float[] out) { 2792 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2793 2794 final float[] col = cols[i]; 2795 2796 out[0] = col[0]; 2797 out[1] = col[1]; 2798 out[2] = col[2]; 2799 } 2800 2801 @Override 2802 public Type type() { 2803 return Type.SEQUENTIAL; 2804 } 2805 2806 @Override 2807 public Mode mode() { 2808 return Mode.DISCRETE; 2809 } 2810 }, 2811 2812 /** 2813 * ColorBrewer "OrRd" colour map with 7 colours. See <a 2814 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2815 * information. 2816 */ 2817 OrRd7 { 2818 private final float[][] cols = { { 254f / 265f, 240f / 265f, 217f / 265f }, 2819 { 253f / 265f, 212f / 265f, 158f / 265f }, { 253f / 265f, 187f / 265f, 132f / 265f }, 2820 { 252f / 265f, 141f / 265f, 89f / 265f }, { 239f / 265f, 101f / 265f, 72f / 265f }, 2821 { 215f / 265f, 48f / 265f, 31f / 265f }, { 153f / 265f, 0f / 265f, 0f / 265f } }; 2822 2823 @Override 2824 public void apply(float x, float[] out) { 2825 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2826 2827 final float[] col = cols[i]; 2828 2829 out[0] = col[0]; 2830 out[1] = col[1]; 2831 out[2] = col[2]; 2832 } 2833 2834 @Override 2835 public Type type() { 2836 return Type.SEQUENTIAL; 2837 } 2838 2839 @Override 2840 public Mode mode() { 2841 return Mode.DISCRETE; 2842 } 2843 }, 2844 2845 /** 2846 * ColorBrewer "OrRd" colour map with 8 colours. See <a 2847 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2848 * information. 2849 */ 2850 OrRd8 { 2851 private final float[][] cols = { { 255f / 265f, 247f / 265f, 236f / 265f }, 2852 { 254f / 265f, 232f / 265f, 200f / 265f }, { 253f / 265f, 212f / 265f, 158f / 265f }, 2853 { 253f / 265f, 187f / 265f, 132f / 265f }, { 252f / 265f, 141f / 265f, 89f / 265f }, 2854 { 239f / 265f, 101f / 265f, 72f / 265f }, { 215f / 265f, 48f / 265f, 31f / 265f }, 2855 { 153f / 265f, 0f / 265f, 0f / 265f } }; 2856 2857 @Override 2858 public void apply(float x, float[] out) { 2859 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2860 2861 final float[] col = cols[i]; 2862 2863 out[0] = col[0]; 2864 out[1] = col[1]; 2865 out[2] = col[2]; 2866 } 2867 2868 @Override 2869 public Type type() { 2870 return Type.SEQUENTIAL; 2871 } 2872 2873 @Override 2874 public Mode mode() { 2875 return Mode.DISCRETE; 2876 } 2877 }, 2878 2879 /** 2880 * ColorBrewer "OrRd" colour map with 9 colours. See <a 2881 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2882 * information. 2883 */ 2884 OrRd9 { 2885 private final float[][] cols = { { 255f / 265f, 247f / 265f, 236f / 265f }, 2886 { 254f / 265f, 232f / 265f, 200f / 265f }, { 253f / 265f, 212f / 265f, 158f / 265f }, 2887 { 253f / 265f, 187f / 265f, 132f / 265f }, { 252f / 265f, 141f / 265f, 89f / 265f }, 2888 { 239f / 265f, 101f / 265f, 72f / 265f }, { 215f / 265f, 48f / 265f, 31f / 265f }, 2889 { 179f / 265f, 0f / 265f, 0f / 265f }, { 127f / 265f, 0f / 265f, 0f / 265f } }; 2890 2891 @Override 2892 public void apply(float x, float[] out) { 2893 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2894 2895 final float[] col = cols[i]; 2896 2897 out[0] = col[0]; 2898 out[1] = col[1]; 2899 out[2] = col[2]; 2900 } 2901 2902 @Override 2903 public Type type() { 2904 return Type.SEQUENTIAL; 2905 } 2906 2907 @Override 2908 public Mode mode() { 2909 return Mode.DISCRETE; 2910 } 2911 }, 2912 2913 /** 2914 * ColorBrewer "Paired" colour map with 3 colours. See <a 2915 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2916 * information. 2917 */ 2918 Paired3 { 2919 private final float[][] cols = { { 166f / 265f, 206f / 265f, 227f / 265f }, 2920 { 31f / 265f, 120f / 265f, 180f / 265f }, { 178f / 265f, 223f / 265f, 138f / 265f } }; 2921 2922 @Override 2923 public void apply(float x, float[] out) { 2924 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2925 2926 final float[] col = cols[i]; 2927 2928 out[0] = col[0]; 2929 out[1] = col[1]; 2930 out[2] = col[2]; 2931 } 2932 2933 @Override 2934 public Type type() { 2935 return Type.QUALITATIVE; 2936 } 2937 2938 @Override 2939 public Mode mode() { 2940 return Mode.DISCRETE; 2941 } 2942 }, 2943 2944 /** 2945 * ColorBrewer "Paired" colour map with 4 colours. See <a 2946 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2947 * information. 2948 */ 2949 Paired4 { 2950 private final float[][] cols = { { 166f / 265f, 206f / 265f, 227f / 265f }, 2951 { 31f / 265f, 120f / 265f, 180f / 265f }, { 178f / 265f, 223f / 265f, 138f / 265f }, 2952 { 51f / 265f, 160f / 265f, 44f / 265f } }; 2953 2954 @Override 2955 public void apply(float x, float[] out) { 2956 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2957 2958 final float[] col = cols[i]; 2959 2960 out[0] = col[0]; 2961 out[1] = col[1]; 2962 out[2] = col[2]; 2963 } 2964 2965 @Override 2966 public Type type() { 2967 return Type.QUALITATIVE; 2968 } 2969 2970 @Override 2971 public Mode mode() { 2972 return Mode.DISCRETE; 2973 } 2974 }, 2975 2976 /** 2977 * ColorBrewer "Paired" colour map with 5 colours. See <a 2978 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 2979 * information. 2980 */ 2981 Paired5 { 2982 private final float[][] cols = { { 166f / 265f, 206f / 265f, 227f / 265f }, 2983 { 31f / 265f, 120f / 265f, 180f / 265f }, { 178f / 265f, 223f / 265f, 138f / 265f }, 2984 { 51f / 265f, 160f / 265f, 44f / 265f }, { 251f / 265f, 154f / 265f, 153f / 265f } }; 2985 2986 @Override 2987 public void apply(float x, float[] out) { 2988 final int i = Math.min((int) (x * cols.length), cols.length - 1); 2989 2990 final float[] col = cols[i]; 2991 2992 out[0] = col[0]; 2993 out[1] = col[1]; 2994 out[2] = col[2]; 2995 } 2996 2997 @Override 2998 public Type type() { 2999 return Type.QUALITATIVE; 3000 } 3001 3002 @Override 3003 public Mode mode() { 3004 return Mode.DISCRETE; 3005 } 3006 }, 3007 3008 /** 3009 * ColorBrewer "Paired" colour map with 6 colours. See <a 3010 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3011 * information. 3012 */ 3013 Paired6 { 3014 private final float[][] cols = { { 166f / 265f, 206f / 265f, 227f / 265f }, 3015 { 31f / 265f, 120f / 265f, 180f / 265f }, { 178f / 265f, 223f / 265f, 138f / 265f }, 3016 { 51f / 265f, 160f / 265f, 44f / 265f }, { 251f / 265f, 154f / 265f, 153f / 265f }, 3017 { 227f / 265f, 26f / 265f, 28f / 265f } }; 3018 3019 @Override 3020 public void apply(float x, float[] out) { 3021 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3022 3023 final float[] col = cols[i]; 3024 3025 out[0] = col[0]; 3026 out[1] = col[1]; 3027 out[2] = col[2]; 3028 } 3029 3030 @Override 3031 public Type type() { 3032 return Type.QUALITATIVE; 3033 } 3034 3035 @Override 3036 public Mode mode() { 3037 return Mode.DISCRETE; 3038 } 3039 }, 3040 3041 /** 3042 * ColorBrewer "Paired" colour map with 7 colours. See <a 3043 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3044 * information. 3045 */ 3046 Paired7 { 3047 private final float[][] cols = { { 166f / 265f, 206f / 265f, 227f / 265f }, 3048 { 31f / 265f, 120f / 265f, 180f / 265f }, { 178f / 265f, 223f / 265f, 138f / 265f }, 3049 { 51f / 265f, 160f / 265f, 44f / 265f }, { 251f / 265f, 154f / 265f, 153f / 265f }, 3050 { 227f / 265f, 26f / 265f, 28f / 265f }, { 253f / 265f, 191f / 265f, 111f / 265f } }; 3051 3052 @Override 3053 public void apply(float x, float[] out) { 3054 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3055 3056 final float[] col = cols[i]; 3057 3058 out[0] = col[0]; 3059 out[1] = col[1]; 3060 out[2] = col[2]; 3061 } 3062 3063 @Override 3064 public Type type() { 3065 return Type.QUALITATIVE; 3066 } 3067 3068 @Override 3069 public Mode mode() { 3070 return Mode.DISCRETE; 3071 } 3072 }, 3073 3074 /** 3075 * ColorBrewer "Paired" colour map with 8 colours. See <a 3076 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3077 * information. 3078 */ 3079 Paired8 { 3080 private final float[][] cols = { { 166f / 265f, 206f / 265f, 227f / 265f }, 3081 { 31f / 265f, 120f / 265f, 180f / 265f }, { 178f / 265f, 223f / 265f, 138f / 265f }, 3082 { 51f / 265f, 160f / 265f, 44f / 265f }, { 251f / 265f, 154f / 265f, 153f / 265f }, 3083 { 227f / 265f, 26f / 265f, 28f / 265f }, { 253f / 265f, 191f / 265f, 111f / 265f }, 3084 { 255f / 265f, 127f / 265f, 0f / 265f } }; 3085 3086 @Override 3087 public void apply(float x, float[] out) { 3088 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3089 3090 final float[] col = cols[i]; 3091 3092 out[0] = col[0]; 3093 out[1] = col[1]; 3094 out[2] = col[2]; 3095 } 3096 3097 @Override 3098 public Type type() { 3099 return Type.QUALITATIVE; 3100 } 3101 3102 @Override 3103 public Mode mode() { 3104 return Mode.DISCRETE; 3105 } 3106 }, 3107 3108 /** 3109 * ColorBrewer "Paired" colour map with 9 colours. See <a 3110 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3111 * information. 3112 */ 3113 Paired9 { 3114 private final float[][] cols = { { 166f / 265f, 206f / 265f, 227f / 265f }, 3115 { 31f / 265f, 120f / 265f, 180f / 265f }, { 178f / 265f, 223f / 265f, 138f / 265f }, 3116 { 51f / 265f, 160f / 265f, 44f / 265f }, { 251f / 265f, 154f / 265f, 153f / 265f }, 3117 { 227f / 265f, 26f / 265f, 28f / 265f }, { 253f / 265f, 191f / 265f, 111f / 265f }, 3118 { 255f / 265f, 127f / 265f, 0f / 265f }, { 202f / 265f, 178f / 265f, 214f / 265f } }; 3119 3120 @Override 3121 public void apply(float x, float[] out) { 3122 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3123 3124 final float[] col = cols[i]; 3125 3126 out[0] = col[0]; 3127 out[1] = col[1]; 3128 out[2] = col[2]; 3129 } 3130 3131 @Override 3132 public Type type() { 3133 return Type.QUALITATIVE; 3134 } 3135 3136 @Override 3137 public Mode mode() { 3138 return Mode.DISCRETE; 3139 } 3140 }, 3141 3142 /** 3143 * ColorBrewer "Paired" colour map with 10 colours. See <a 3144 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3145 * information. 3146 */ 3147 Paired10 { 3148 private final float[][] cols = { { 166f / 265f, 206f / 265f, 227f / 265f }, 3149 { 31f / 265f, 120f / 265f, 180f / 265f }, { 178f / 265f, 223f / 265f, 138f / 265f }, 3150 { 51f / 265f, 160f / 265f, 44f / 265f }, { 251f / 265f, 154f / 265f, 153f / 265f }, 3151 { 227f / 265f, 26f / 265f, 28f / 265f }, { 253f / 265f, 191f / 265f, 111f / 265f }, 3152 { 255f / 265f, 127f / 265f, 0f / 265f }, { 202f / 265f, 178f / 265f, 214f / 265f }, 3153 { 106f / 265f, 61f / 265f, 154f / 265f } }; 3154 3155 @Override 3156 public void apply(float x, float[] out) { 3157 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3158 3159 final float[] col = cols[i]; 3160 3161 out[0] = col[0]; 3162 out[1] = col[1]; 3163 out[2] = col[2]; 3164 } 3165 3166 @Override 3167 public Type type() { 3168 return Type.QUALITATIVE; 3169 } 3170 3171 @Override 3172 public Mode mode() { 3173 return Mode.DISCRETE; 3174 } 3175 }, 3176 3177 /** 3178 * ColorBrewer "Paired" colour map with 11 colours. See <a 3179 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3180 * information. 3181 */ 3182 Paired11 { 3183 private final float[][] cols = { { 166f / 265f, 206f / 265f, 227f / 265f }, 3184 { 31f / 265f, 120f / 265f, 180f / 265f }, { 178f / 265f, 223f / 265f, 138f / 265f }, 3185 { 51f / 265f, 160f / 265f, 44f / 265f }, { 251f / 265f, 154f / 265f, 153f / 265f }, 3186 { 227f / 265f, 26f / 265f, 28f / 265f }, { 253f / 265f, 191f / 265f, 111f / 265f }, 3187 { 255f / 265f, 127f / 265f, 0f / 265f }, { 202f / 265f, 178f / 265f, 214f / 265f }, 3188 { 106f / 265f, 61f / 265f, 154f / 265f }, { 255f / 265f, 255f / 265f, 153f / 265f } }; 3189 3190 @Override 3191 public void apply(float x, float[] out) { 3192 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3193 3194 final float[] col = cols[i]; 3195 3196 out[0] = col[0]; 3197 out[1] = col[1]; 3198 out[2] = col[2]; 3199 } 3200 3201 @Override 3202 public Type type() { 3203 return Type.QUALITATIVE; 3204 } 3205 3206 @Override 3207 public Mode mode() { 3208 return Mode.DISCRETE; 3209 } 3210 }, 3211 3212 /** 3213 * ColorBrewer "Paired" colour map with 12 colours. See <a 3214 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3215 * information. 3216 */ 3217 Paired12 { 3218 private final float[][] cols = { { 166f / 265f, 206f / 265f, 227f / 265f }, 3219 { 31f / 265f, 120f / 265f, 180f / 265f }, { 178f / 265f, 223f / 265f, 138f / 265f }, 3220 { 51f / 265f, 160f / 265f, 44f / 265f }, { 251f / 265f, 154f / 265f, 153f / 265f }, 3221 { 227f / 265f, 26f / 265f, 28f / 265f }, { 253f / 265f, 191f / 265f, 111f / 265f }, 3222 { 255f / 265f, 127f / 265f, 0f / 265f }, { 202f / 265f, 178f / 265f, 214f / 265f }, 3223 { 106f / 265f, 61f / 265f, 154f / 265f }, { 255f / 265f, 255f / 265f, 153f / 265f }, 3224 { 177f / 265f, 89f / 265f, 40f / 265f } }; 3225 3226 @Override 3227 public void apply(float x, float[] out) { 3228 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3229 3230 final float[] col = cols[i]; 3231 3232 out[0] = col[0]; 3233 out[1] = col[1]; 3234 out[2] = col[2]; 3235 } 3236 3237 @Override 3238 public Type type() { 3239 return Type.QUALITATIVE; 3240 } 3241 3242 @Override 3243 public Mode mode() { 3244 return Mode.DISCRETE; 3245 } 3246 }, 3247 3248 /** 3249 * ColorBrewer "Pastel1" colour map with 3 colours. See <a 3250 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3251 * information. 3252 */ 3253 Pastel13 { 3254 private final float[][] cols = { { 251f / 265f, 180f / 265f, 174f / 265f }, 3255 { 179f / 265f, 205f / 265f, 227f / 265f }, { 204f / 265f, 235f / 265f, 197f / 265f } }; 3256 3257 @Override 3258 public void apply(float x, float[] out) { 3259 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3260 3261 final float[] col = cols[i]; 3262 3263 out[0] = col[0]; 3264 out[1] = col[1]; 3265 out[2] = col[2]; 3266 } 3267 3268 @Override 3269 public Type type() { 3270 return Type.QUALITATIVE; 3271 } 3272 3273 @Override 3274 public Mode mode() { 3275 return Mode.DISCRETE; 3276 } 3277 }, 3278 3279 /** 3280 * ColorBrewer "Pastel1" colour map with 4 colours. See <a 3281 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3282 * information. 3283 */ 3284 Pastel14 { 3285 private final float[][] cols = { { 251f / 265f, 180f / 265f, 174f / 265f }, 3286 { 179f / 265f, 205f / 265f, 227f / 265f }, { 204f / 265f, 235f / 265f, 197f / 265f }, 3287 { 222f / 265f, 203f / 265f, 228f / 265f } }; 3288 3289 @Override 3290 public void apply(float x, float[] out) { 3291 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3292 3293 final float[] col = cols[i]; 3294 3295 out[0] = col[0]; 3296 out[1] = col[1]; 3297 out[2] = col[2]; 3298 } 3299 3300 @Override 3301 public Type type() { 3302 return Type.QUALITATIVE; 3303 } 3304 3305 @Override 3306 public Mode mode() { 3307 return Mode.DISCRETE; 3308 } 3309 }, 3310 3311 /** 3312 * ColorBrewer "Pastel1" colour map with 5 colours. See <a 3313 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3314 * information. 3315 */ 3316 Pastel15 { 3317 private final float[][] cols = { { 251f / 265f, 180f / 265f, 174f / 265f }, 3318 { 179f / 265f, 205f / 265f, 227f / 265f }, { 204f / 265f, 235f / 265f, 197f / 265f }, 3319 { 222f / 265f, 203f / 265f, 228f / 265f }, { 254f / 265f, 217f / 265f, 166f / 265f } }; 3320 3321 @Override 3322 public void apply(float x, float[] out) { 3323 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3324 3325 final float[] col = cols[i]; 3326 3327 out[0] = col[0]; 3328 out[1] = col[1]; 3329 out[2] = col[2]; 3330 } 3331 3332 @Override 3333 public Type type() { 3334 return Type.QUALITATIVE; 3335 } 3336 3337 @Override 3338 public Mode mode() { 3339 return Mode.DISCRETE; 3340 } 3341 }, 3342 3343 /** 3344 * ColorBrewer "Pastel1" colour map with 6 colours. See <a 3345 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3346 * information. 3347 */ 3348 Pastel16 { 3349 private final float[][] cols = { { 251f / 265f, 180f / 265f, 174f / 265f }, 3350 { 179f / 265f, 205f / 265f, 227f / 265f }, { 204f / 265f, 235f / 265f, 197f / 265f }, 3351 { 222f / 265f, 203f / 265f, 228f / 265f }, { 254f / 265f, 217f / 265f, 166f / 265f }, 3352 { 255f / 265f, 255f / 265f, 204f / 265f } }; 3353 3354 @Override 3355 public void apply(float x, float[] out) { 3356 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3357 3358 final float[] col = cols[i]; 3359 3360 out[0] = col[0]; 3361 out[1] = col[1]; 3362 out[2] = col[2]; 3363 } 3364 3365 @Override 3366 public Type type() { 3367 return Type.QUALITATIVE; 3368 } 3369 3370 @Override 3371 public Mode mode() { 3372 return Mode.DISCRETE; 3373 } 3374 }, 3375 3376 /** 3377 * ColorBrewer "Pastel1" colour map with 7 colours. See <a 3378 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3379 * information. 3380 */ 3381 Pastel17 { 3382 private final float[][] cols = { { 251f / 265f, 180f / 265f, 174f / 265f }, 3383 { 179f / 265f, 205f / 265f, 227f / 265f }, { 204f / 265f, 235f / 265f, 197f / 265f }, 3384 { 222f / 265f, 203f / 265f, 228f / 265f }, { 254f / 265f, 217f / 265f, 166f / 265f }, 3385 { 255f / 265f, 255f / 265f, 204f / 265f }, { 229f / 265f, 216f / 265f, 189f / 265f } }; 3386 3387 @Override 3388 public void apply(float x, float[] out) { 3389 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3390 3391 final float[] col = cols[i]; 3392 3393 out[0] = col[0]; 3394 out[1] = col[1]; 3395 out[2] = col[2]; 3396 } 3397 3398 @Override 3399 public Type type() { 3400 return Type.QUALITATIVE; 3401 } 3402 3403 @Override 3404 public Mode mode() { 3405 return Mode.DISCRETE; 3406 } 3407 }, 3408 3409 /** 3410 * ColorBrewer "Pastel1" colour map with 8 colours. See <a 3411 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3412 * information. 3413 */ 3414 Pastel18 { 3415 private final float[][] cols = { { 251f / 265f, 180f / 265f, 174f / 265f }, 3416 { 179f / 265f, 205f / 265f, 227f / 265f }, { 204f / 265f, 235f / 265f, 197f / 265f }, 3417 { 222f / 265f, 203f / 265f, 228f / 265f }, { 254f / 265f, 217f / 265f, 166f / 265f }, 3418 { 255f / 265f, 255f / 265f, 204f / 265f }, { 229f / 265f, 216f / 265f, 189f / 265f }, 3419 { 253f / 265f, 218f / 265f, 236f / 265f } }; 3420 3421 @Override 3422 public void apply(float x, float[] out) { 3423 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3424 3425 final float[] col = cols[i]; 3426 3427 out[0] = col[0]; 3428 out[1] = col[1]; 3429 out[2] = col[2]; 3430 } 3431 3432 @Override 3433 public Type type() { 3434 return Type.QUALITATIVE; 3435 } 3436 3437 @Override 3438 public Mode mode() { 3439 return Mode.DISCRETE; 3440 } 3441 }, 3442 3443 /** 3444 * ColorBrewer "Pastel1" colour map with 9 colours. See <a 3445 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3446 * information. 3447 */ 3448 Pastel19 { 3449 private final float[][] cols = { { 251f / 265f, 180f / 265f, 174f / 265f }, 3450 { 179f / 265f, 205f / 265f, 227f / 265f }, { 204f / 265f, 235f / 265f, 197f / 265f }, 3451 { 222f / 265f, 203f / 265f, 228f / 265f }, { 254f / 265f, 217f / 265f, 166f / 265f }, 3452 { 255f / 265f, 255f / 265f, 204f / 265f }, { 229f / 265f, 216f / 265f, 189f / 265f }, 3453 { 253f / 265f, 218f / 265f, 236f / 265f }, { 242f / 265f, 242f / 265f, 242f / 265f } }; 3454 3455 @Override 3456 public void apply(float x, float[] out) { 3457 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3458 3459 final float[] col = cols[i]; 3460 3461 out[0] = col[0]; 3462 out[1] = col[1]; 3463 out[2] = col[2]; 3464 } 3465 3466 @Override 3467 public Type type() { 3468 return Type.QUALITATIVE; 3469 } 3470 3471 @Override 3472 public Mode mode() { 3473 return Mode.DISCRETE; 3474 } 3475 }, 3476 3477 /** 3478 * ColorBrewer "Pastel2" colour map with 3 colours. See <a 3479 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3480 * information. 3481 */ 3482 Pastel23 { 3483 private final float[][] cols = { { 179f / 265f, 226f / 265f, 205f / 265f }, 3484 { 253f / 265f, 205f / 265f, 172f / 265f }, { 203f / 265f, 213f / 265f, 232f / 265f } }; 3485 3486 @Override 3487 public void apply(float x, float[] out) { 3488 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3489 3490 final float[] col = cols[i]; 3491 3492 out[0] = col[0]; 3493 out[1] = col[1]; 3494 out[2] = col[2]; 3495 } 3496 3497 @Override 3498 public Type type() { 3499 return Type.QUALITATIVE; 3500 } 3501 3502 @Override 3503 public Mode mode() { 3504 return Mode.DISCRETE; 3505 } 3506 }, 3507 3508 /** 3509 * ColorBrewer "Pastel2" colour map with 4 colours. See <a 3510 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3511 * information. 3512 */ 3513 Pastel24 { 3514 private final float[][] cols = { { 179f / 265f, 226f / 265f, 205f / 265f }, 3515 { 253f / 265f, 205f / 265f, 172f / 265f }, { 203f / 265f, 213f / 265f, 232f / 265f }, 3516 { 244f / 265f, 202f / 265f, 228f / 265f } }; 3517 3518 @Override 3519 public void apply(float x, float[] out) { 3520 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3521 3522 final float[] col = cols[i]; 3523 3524 out[0] = col[0]; 3525 out[1] = col[1]; 3526 out[2] = col[2]; 3527 } 3528 3529 @Override 3530 public Type type() { 3531 return Type.QUALITATIVE; 3532 } 3533 3534 @Override 3535 public Mode mode() { 3536 return Mode.DISCRETE; 3537 } 3538 }, 3539 3540 /** 3541 * ColorBrewer "Pastel2" colour map with 5 colours. See <a 3542 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3543 * information. 3544 */ 3545 Pastel25 { 3546 private final float[][] cols = { { 179f / 265f, 226f / 265f, 205f / 265f }, 3547 { 253f / 265f, 205f / 265f, 172f / 265f }, { 203f / 265f, 213f / 265f, 232f / 265f }, 3548 { 244f / 265f, 202f / 265f, 228f / 265f }, { 230f / 265f, 245f / 265f, 201f / 265f } }; 3549 3550 @Override 3551 public void apply(float x, float[] out) { 3552 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3553 3554 final float[] col = cols[i]; 3555 3556 out[0] = col[0]; 3557 out[1] = col[1]; 3558 out[2] = col[2]; 3559 } 3560 3561 @Override 3562 public Type type() { 3563 return Type.QUALITATIVE; 3564 } 3565 3566 @Override 3567 public Mode mode() { 3568 return Mode.DISCRETE; 3569 } 3570 }, 3571 3572 /** 3573 * ColorBrewer "Pastel2" colour map with 6 colours. See <a 3574 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3575 * information. 3576 */ 3577 Pastel26 { 3578 private final float[][] cols = { { 179f / 265f, 226f / 265f, 205f / 265f }, 3579 { 253f / 265f, 205f / 265f, 172f / 265f }, { 203f / 265f, 213f / 265f, 232f / 265f }, 3580 { 244f / 265f, 202f / 265f, 228f / 265f }, { 230f / 265f, 245f / 265f, 201f / 265f }, 3581 { 255f / 265f, 242f / 265f, 174f / 265f } }; 3582 3583 @Override 3584 public void apply(float x, float[] out) { 3585 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3586 3587 final float[] col = cols[i]; 3588 3589 out[0] = col[0]; 3590 out[1] = col[1]; 3591 out[2] = col[2]; 3592 } 3593 3594 @Override 3595 public Type type() { 3596 return Type.QUALITATIVE; 3597 } 3598 3599 @Override 3600 public Mode mode() { 3601 return Mode.DISCRETE; 3602 } 3603 }, 3604 3605 /** 3606 * ColorBrewer "Pastel2" colour map with 7 colours. See <a 3607 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3608 * information. 3609 */ 3610 Pastel27 { 3611 private final float[][] cols = { { 179f / 265f, 226f / 265f, 205f / 265f }, 3612 { 253f / 265f, 205f / 265f, 172f / 265f }, { 203f / 265f, 213f / 265f, 232f / 265f }, 3613 { 244f / 265f, 202f / 265f, 228f / 265f }, { 230f / 265f, 245f / 265f, 201f / 265f }, 3614 { 255f / 265f, 242f / 265f, 174f / 265f }, { 241f / 265f, 226f / 265f, 204f / 265f } }; 3615 3616 @Override 3617 public void apply(float x, float[] out) { 3618 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3619 3620 final float[] col = cols[i]; 3621 3622 out[0] = col[0]; 3623 out[1] = col[1]; 3624 out[2] = col[2]; 3625 } 3626 3627 @Override 3628 public Type type() { 3629 return Type.QUALITATIVE; 3630 } 3631 3632 @Override 3633 public Mode mode() { 3634 return Mode.DISCRETE; 3635 } 3636 }, 3637 3638 /** 3639 * ColorBrewer "Pastel2" colour map with 8 colours. See <a 3640 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3641 * information. 3642 */ 3643 Pastel28 { 3644 private final float[][] cols = { { 179f / 265f, 226f / 265f, 205f / 265f }, 3645 { 253f / 265f, 205f / 265f, 172f / 265f }, { 203f / 265f, 213f / 265f, 232f / 265f }, 3646 { 244f / 265f, 202f / 265f, 228f / 265f }, { 230f / 265f, 245f / 265f, 201f / 265f }, 3647 { 255f / 265f, 242f / 265f, 174f / 265f }, { 241f / 265f, 226f / 265f, 204f / 265f }, 3648 { 204f / 265f, 204f / 265f, 204f / 265f } }; 3649 3650 @Override 3651 public void apply(float x, float[] out) { 3652 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3653 3654 final float[] col = cols[i]; 3655 3656 out[0] = col[0]; 3657 out[1] = col[1]; 3658 out[2] = col[2]; 3659 } 3660 3661 @Override 3662 public Type type() { 3663 return Type.QUALITATIVE; 3664 } 3665 3666 @Override 3667 public Mode mode() { 3668 return Mode.DISCRETE; 3669 } 3670 }, 3671 3672 /** 3673 * ColorBrewer "PiYG" colour map with 3 colours. See <a 3674 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3675 * information. 3676 */ 3677 PiYG3 { 3678 private final float[][] cols = { { 233f / 265f, 163f / 265f, 201f / 265f }, 3679 { 247f / 265f, 247f / 265f, 247f / 265f }, { 161f / 265f, 215f / 265f, 106f / 265f } }; 3680 3681 @Override 3682 public void apply(float x, float[] out) { 3683 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3684 3685 final float[] col = cols[i]; 3686 3687 out[0] = col[0]; 3688 out[1] = col[1]; 3689 out[2] = col[2]; 3690 } 3691 3692 @Override 3693 public Type type() { 3694 return Type.DIVERGING; 3695 } 3696 3697 @Override 3698 public Mode mode() { 3699 return Mode.DISCRETE; 3700 } 3701 }, 3702 3703 /** 3704 * ColorBrewer "PiYG" colour map with 4 colours. See <a 3705 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3706 * information. 3707 */ 3708 PiYG4 { 3709 private final float[][] cols = { { 208f / 265f, 28f / 265f, 139f / 265f }, 3710 { 241f / 265f, 182f / 265f, 218f / 265f }, { 184f / 265f, 225f / 265f, 134f / 265f }, 3711 { 77f / 265f, 172f / 265f, 38f / 265f } }; 3712 3713 @Override 3714 public void apply(float x, float[] out) { 3715 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3716 3717 final float[] col = cols[i]; 3718 3719 out[0] = col[0]; 3720 out[1] = col[1]; 3721 out[2] = col[2]; 3722 } 3723 3724 @Override 3725 public Type type() { 3726 return Type.DIVERGING; 3727 } 3728 3729 @Override 3730 public Mode mode() { 3731 return Mode.DISCRETE; 3732 } 3733 }, 3734 3735 /** 3736 * ColorBrewer "PiYG" colour map with 5 colours. See <a 3737 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3738 * information. 3739 */ 3740 PiYG5 { 3741 private final float[][] cols = { { 208f / 265f, 28f / 265f, 139f / 265f }, 3742 { 241f / 265f, 182f / 265f, 218f / 265f }, { 247f / 265f, 247f / 265f, 247f / 265f }, 3743 { 184f / 265f, 225f / 265f, 134f / 265f }, { 77f / 265f, 172f / 265f, 38f / 265f } }; 3744 3745 @Override 3746 public void apply(float x, float[] out) { 3747 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3748 3749 final float[] col = cols[i]; 3750 3751 out[0] = col[0]; 3752 out[1] = col[1]; 3753 out[2] = col[2]; 3754 } 3755 3756 @Override 3757 public Type type() { 3758 return Type.DIVERGING; 3759 } 3760 3761 @Override 3762 public Mode mode() { 3763 return Mode.DISCRETE; 3764 } 3765 }, 3766 3767 /** 3768 * ColorBrewer "PiYG" colour map with 6 colours. See <a 3769 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3770 * information. 3771 */ 3772 PiYG6 { 3773 private final float[][] cols = { { 197f / 265f, 27f / 265f, 125f / 265f }, 3774 { 233f / 265f, 163f / 265f, 201f / 265f }, { 253f / 265f, 224f / 265f, 239f / 265f }, 3775 { 230f / 265f, 245f / 265f, 208f / 265f }, { 161f / 265f, 215f / 265f, 106f / 265f }, 3776 { 77f / 265f, 146f / 265f, 33f / 265f } }; 3777 3778 @Override 3779 public void apply(float x, float[] out) { 3780 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3781 3782 final float[] col = cols[i]; 3783 3784 out[0] = col[0]; 3785 out[1] = col[1]; 3786 out[2] = col[2]; 3787 } 3788 3789 @Override 3790 public Type type() { 3791 return Type.DIVERGING; 3792 } 3793 3794 @Override 3795 public Mode mode() { 3796 return Mode.DISCRETE; 3797 } 3798 }, 3799 3800 /** 3801 * ColorBrewer "PiYG" colour map with 7 colours. See <a 3802 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3803 * information. 3804 */ 3805 PiYG7 { 3806 private final float[][] cols = { { 197f / 265f, 27f / 265f, 125f / 265f }, 3807 { 233f / 265f, 163f / 265f, 201f / 265f }, { 253f / 265f, 224f / 265f, 239f / 265f }, 3808 { 247f / 265f, 247f / 265f, 247f / 265f }, { 230f / 265f, 245f / 265f, 208f / 265f }, 3809 { 161f / 265f, 215f / 265f, 106f / 265f }, { 77f / 265f, 146f / 265f, 33f / 265f } }; 3810 3811 @Override 3812 public void apply(float x, float[] out) { 3813 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3814 3815 final float[] col = cols[i]; 3816 3817 out[0] = col[0]; 3818 out[1] = col[1]; 3819 out[2] = col[2]; 3820 } 3821 3822 @Override 3823 public Type type() { 3824 return Type.DIVERGING; 3825 } 3826 3827 @Override 3828 public Mode mode() { 3829 return Mode.DISCRETE; 3830 } 3831 }, 3832 3833 /** 3834 * ColorBrewer "PiYG" colour map with 8 colours. See <a 3835 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3836 * information. 3837 */ 3838 PiYG8 { 3839 private final float[][] cols = { { 197f / 265f, 27f / 265f, 125f / 265f }, 3840 { 222f / 265f, 119f / 265f, 174f / 265f }, { 241f / 265f, 182f / 265f, 218f / 265f }, 3841 { 253f / 265f, 224f / 265f, 239f / 265f }, { 230f / 265f, 245f / 265f, 208f / 265f }, 3842 { 184f / 265f, 225f / 265f, 134f / 265f }, { 127f / 265f, 188f / 265f, 65f / 265f }, 3843 { 77f / 265f, 146f / 265f, 33f / 265f } }; 3844 3845 @Override 3846 public void apply(float x, float[] out) { 3847 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3848 3849 final float[] col = cols[i]; 3850 3851 out[0] = col[0]; 3852 out[1] = col[1]; 3853 out[2] = col[2]; 3854 } 3855 3856 @Override 3857 public Type type() { 3858 return Type.DIVERGING; 3859 } 3860 3861 @Override 3862 public Mode mode() { 3863 return Mode.DISCRETE; 3864 } 3865 }, 3866 3867 /** 3868 * ColorBrewer "PiYG" colour map with 9 colours. See <a 3869 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3870 * information. 3871 */ 3872 PiYG9 { 3873 private final float[][] cols = { { 197f / 265f, 27f / 265f, 125f / 265f }, 3874 { 222f / 265f, 119f / 265f, 174f / 265f }, { 241f / 265f, 182f / 265f, 218f / 265f }, 3875 { 253f / 265f, 224f / 265f, 239f / 265f }, { 247f / 265f, 247f / 265f, 247f / 265f }, 3876 { 230f / 265f, 245f / 265f, 208f / 265f }, { 184f / 265f, 225f / 265f, 134f / 265f }, 3877 { 127f / 265f, 188f / 265f, 65f / 265f }, { 77f / 265f, 146f / 265f, 33f / 265f } }; 3878 3879 @Override 3880 public void apply(float x, float[] out) { 3881 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3882 3883 final float[] col = cols[i]; 3884 3885 out[0] = col[0]; 3886 out[1] = col[1]; 3887 out[2] = col[2]; 3888 } 3889 3890 @Override 3891 public Type type() { 3892 return Type.DIVERGING; 3893 } 3894 3895 @Override 3896 public Mode mode() { 3897 return Mode.DISCRETE; 3898 } 3899 }, 3900 3901 /** 3902 * ColorBrewer "PiYG" colour map with 10 colours. See <a 3903 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3904 * information. 3905 */ 3906 PiYG10 { 3907 private final float[][] cols = { { 142f / 265f, 1f / 265f, 82f / 265f }, 3908 { 197f / 265f, 27f / 265f, 125f / 265f }, { 222f / 265f, 119f / 265f, 174f / 265f }, 3909 { 241f / 265f, 182f / 265f, 218f / 265f }, { 253f / 265f, 224f / 265f, 239f / 265f }, 3910 { 230f / 265f, 245f / 265f, 208f / 265f }, { 184f / 265f, 225f / 265f, 134f / 265f }, 3911 { 127f / 265f, 188f / 265f, 65f / 265f }, { 77f / 265f, 146f / 265f, 33f / 265f }, 3912 { 39f / 265f, 100f / 265f, 25f / 265f } }; 3913 3914 @Override 3915 public void apply(float x, float[] out) { 3916 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3917 3918 final float[] col = cols[i]; 3919 3920 out[0] = col[0]; 3921 out[1] = col[1]; 3922 out[2] = col[2]; 3923 } 3924 3925 @Override 3926 public Type type() { 3927 return Type.DIVERGING; 3928 } 3929 3930 @Override 3931 public Mode mode() { 3932 return Mode.DISCRETE; 3933 } 3934 }, 3935 3936 /** 3937 * ColorBrewer "PiYG" colour map with 11 colours. See <a 3938 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3939 * information. 3940 */ 3941 PiYG11 { 3942 private final float[][] cols = { { 142f / 265f, 1f / 265f, 82f / 265f }, 3943 { 197f / 265f, 27f / 265f, 125f / 265f }, { 222f / 265f, 119f / 265f, 174f / 265f }, 3944 { 241f / 265f, 182f / 265f, 218f / 265f }, { 253f / 265f, 224f / 265f, 239f / 265f }, 3945 { 247f / 265f, 247f / 265f, 247f / 265f }, { 230f / 265f, 245f / 265f, 208f / 265f }, 3946 { 184f / 265f, 225f / 265f, 134f / 265f }, { 127f / 265f, 188f / 265f, 65f / 265f }, 3947 { 77f / 265f, 146f / 265f, 33f / 265f }, { 39f / 265f, 100f / 265f, 25f / 265f } }; 3948 3949 @Override 3950 public void apply(float x, float[] out) { 3951 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3952 3953 final float[] col = cols[i]; 3954 3955 out[0] = col[0]; 3956 out[1] = col[1]; 3957 out[2] = col[2]; 3958 } 3959 3960 @Override 3961 public Type type() { 3962 return Type.DIVERGING; 3963 } 3964 3965 @Override 3966 public Mode mode() { 3967 return Mode.DISCRETE; 3968 } 3969 }, 3970 3971 /** 3972 * ColorBrewer "PRGn" colour map with 3 colours. See <a 3973 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 3974 * information. 3975 */ 3976 PRGn3 { 3977 private final float[][] cols = { { 175f / 265f, 141f / 265f, 195f / 265f }, 3978 { 247f / 265f, 247f / 265f, 247f / 265f }, { 127f / 265f, 191f / 265f, 123f / 265f } }; 3979 3980 @Override 3981 public void apply(float x, float[] out) { 3982 final int i = Math.min((int) (x * cols.length), cols.length - 1); 3983 3984 final float[] col = cols[i]; 3985 3986 out[0] = col[0]; 3987 out[1] = col[1]; 3988 out[2] = col[2]; 3989 } 3990 3991 @Override 3992 public Type type() { 3993 return Type.DIVERGING; 3994 } 3995 3996 @Override 3997 public Mode mode() { 3998 return Mode.DISCRETE; 3999 } 4000 }, 4001 4002 /** 4003 * ColorBrewer "PRGn" colour map with 4 colours. See <a 4004 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4005 * information. 4006 */ 4007 PRGn4 { 4008 private final float[][] cols = { { 123f / 265f, 50f / 265f, 148f / 265f }, 4009 { 194f / 265f, 165f / 265f, 207f / 265f }, { 166f / 265f, 219f / 265f, 160f / 265f }, 4010 { 0f / 265f, 136f / 265f, 55f / 265f } }; 4011 4012 @Override 4013 public void apply(float x, float[] out) { 4014 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4015 4016 final float[] col = cols[i]; 4017 4018 out[0] = col[0]; 4019 out[1] = col[1]; 4020 out[2] = col[2]; 4021 } 4022 4023 @Override 4024 public Type type() { 4025 return Type.DIVERGING; 4026 } 4027 4028 @Override 4029 public Mode mode() { 4030 return Mode.DISCRETE; 4031 } 4032 }, 4033 4034 /** 4035 * ColorBrewer "PRGn" colour map with 5 colours. See <a 4036 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4037 * information. 4038 */ 4039 PRGn5 { 4040 private final float[][] cols = { { 123f / 265f, 50f / 265f, 148f / 265f }, 4041 { 194f / 265f, 165f / 265f, 207f / 265f }, { 247f / 265f, 247f / 265f, 247f / 265f }, 4042 { 166f / 265f, 219f / 265f, 160f / 265f }, { 0f / 265f, 136f / 265f, 55f / 265f } }; 4043 4044 @Override 4045 public void apply(float x, float[] out) { 4046 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4047 4048 final float[] col = cols[i]; 4049 4050 out[0] = col[0]; 4051 out[1] = col[1]; 4052 out[2] = col[2]; 4053 } 4054 4055 @Override 4056 public Type type() { 4057 return Type.DIVERGING; 4058 } 4059 4060 @Override 4061 public Mode mode() { 4062 return Mode.DISCRETE; 4063 } 4064 }, 4065 4066 /** 4067 * ColorBrewer "PRGn" colour map with 6 colours. See <a 4068 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4069 * information. 4070 */ 4071 PRGn6 { 4072 private final float[][] cols = { { 118f / 265f, 42f / 265f, 131f / 265f }, 4073 { 175f / 265f, 141f / 265f, 195f / 265f }, { 231f / 265f, 212f / 265f, 232f / 265f }, 4074 { 217f / 265f, 240f / 265f, 211f / 265f }, { 127f / 265f, 191f / 265f, 123f / 265f }, 4075 { 27f / 265f, 120f / 265f, 55f / 265f } }; 4076 4077 @Override 4078 public void apply(float x, float[] out) { 4079 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4080 4081 final float[] col = cols[i]; 4082 4083 out[0] = col[0]; 4084 out[1] = col[1]; 4085 out[2] = col[2]; 4086 } 4087 4088 @Override 4089 public Type type() { 4090 return Type.DIVERGING; 4091 } 4092 4093 @Override 4094 public Mode mode() { 4095 return Mode.DISCRETE; 4096 } 4097 }, 4098 4099 /** 4100 * ColorBrewer "PRGn" colour map with 7 colours. See <a 4101 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4102 * information. 4103 */ 4104 PRGn7 { 4105 private final float[][] cols = { { 118f / 265f, 42f / 265f, 131f / 265f }, 4106 { 175f / 265f, 141f / 265f, 195f / 265f }, { 231f / 265f, 212f / 265f, 232f / 265f }, 4107 { 247f / 265f, 247f / 265f, 247f / 265f }, { 217f / 265f, 240f / 265f, 211f / 265f }, 4108 { 127f / 265f, 191f / 265f, 123f / 265f }, { 27f / 265f, 120f / 265f, 55f / 265f } }; 4109 4110 @Override 4111 public void apply(float x, float[] out) { 4112 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4113 4114 final float[] col = cols[i]; 4115 4116 out[0] = col[0]; 4117 out[1] = col[1]; 4118 out[2] = col[2]; 4119 } 4120 4121 @Override 4122 public Type type() { 4123 return Type.DIVERGING; 4124 } 4125 4126 @Override 4127 public Mode mode() { 4128 return Mode.DISCRETE; 4129 } 4130 }, 4131 4132 /** 4133 * ColorBrewer "PRGn" colour map with 8 colours. See <a 4134 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4135 * information. 4136 */ 4137 PRGn8 { 4138 private final float[][] cols = { { 118f / 265f, 42f / 265f, 131f / 265f }, 4139 { 153f / 265f, 112f / 265f, 171f / 265f }, { 194f / 265f, 165f / 265f, 207f / 265f }, 4140 { 231f / 265f, 212f / 265f, 232f / 265f }, { 217f / 265f, 240f / 265f, 211f / 265f }, 4141 { 166f / 265f, 219f / 265f, 160f / 265f }, { 90f / 265f, 174f / 265f, 97f / 265f }, 4142 { 27f / 265f, 120f / 265f, 55f / 265f } }; 4143 4144 @Override 4145 public void apply(float x, float[] out) { 4146 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4147 4148 final float[] col = cols[i]; 4149 4150 out[0] = col[0]; 4151 out[1] = col[1]; 4152 out[2] = col[2]; 4153 } 4154 4155 @Override 4156 public Type type() { 4157 return Type.DIVERGING; 4158 } 4159 4160 @Override 4161 public Mode mode() { 4162 return Mode.DISCRETE; 4163 } 4164 }, 4165 4166 /** 4167 * ColorBrewer "PRGn" colour map with 9 colours. See <a 4168 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4169 * information. 4170 */ 4171 PRGn9 { 4172 private final float[][] cols = { { 118f / 265f, 42f / 265f, 131f / 265f }, 4173 { 153f / 265f, 112f / 265f, 171f / 265f }, { 194f / 265f, 165f / 265f, 207f / 265f }, 4174 { 231f / 265f, 212f / 265f, 232f / 265f }, { 247f / 265f, 247f / 265f, 247f / 265f }, 4175 { 217f / 265f, 240f / 265f, 211f / 265f }, { 166f / 265f, 219f / 265f, 160f / 265f }, 4176 { 90f / 265f, 174f / 265f, 97f / 265f }, { 27f / 265f, 120f / 265f, 55f / 265f } }; 4177 4178 @Override 4179 public void apply(float x, float[] out) { 4180 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4181 4182 final float[] col = cols[i]; 4183 4184 out[0] = col[0]; 4185 out[1] = col[1]; 4186 out[2] = col[2]; 4187 } 4188 4189 @Override 4190 public Type type() { 4191 return Type.DIVERGING; 4192 } 4193 4194 @Override 4195 public Mode mode() { 4196 return Mode.DISCRETE; 4197 } 4198 }, 4199 4200 /** 4201 * ColorBrewer "PRGn" colour map with 10 colours. See <a 4202 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4203 * information. 4204 */ 4205 PRGn10 { 4206 private final float[][] cols = { { 64f / 265f, 0f / 265f, 75f / 265f }, { 118f / 265f, 42f / 265f, 131f / 265f }, 4207 { 153f / 265f, 112f / 265f, 171f / 265f }, { 194f / 265f, 165f / 265f, 207f / 265f }, 4208 { 231f / 265f, 212f / 265f, 232f / 265f }, { 217f / 265f, 240f / 265f, 211f / 265f }, 4209 { 166f / 265f, 219f / 265f, 160f / 265f }, { 90f / 265f, 174f / 265f, 97f / 265f }, 4210 { 27f / 265f, 120f / 265f, 55f / 265f }, { 0f / 265f, 68f / 265f, 27f / 265f } }; 4211 4212 @Override 4213 public void apply(float x, float[] out) { 4214 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4215 4216 final float[] col = cols[i]; 4217 4218 out[0] = col[0]; 4219 out[1] = col[1]; 4220 out[2] = col[2]; 4221 } 4222 4223 @Override 4224 public Type type() { 4225 return Type.DIVERGING; 4226 } 4227 4228 @Override 4229 public Mode mode() { 4230 return Mode.DISCRETE; 4231 } 4232 }, 4233 4234 /** 4235 * ColorBrewer "PRGn" colour map with 11 colours. See <a 4236 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4237 * information. 4238 */ 4239 PRGn11 { 4240 private final float[][] cols = { { 64f / 265f, 0f / 265f, 75f / 265f }, { 118f / 265f, 42f / 265f, 131f / 265f }, 4241 { 153f / 265f, 112f / 265f, 171f / 265f }, { 194f / 265f, 165f / 265f, 207f / 265f }, 4242 { 231f / 265f, 212f / 265f, 232f / 265f }, { 247f / 265f, 247f / 265f, 247f / 265f }, 4243 { 217f / 265f, 240f / 265f, 211f / 265f }, { 166f / 265f, 219f / 265f, 160f / 265f }, 4244 { 90f / 265f, 174f / 265f, 97f / 265f }, { 27f / 265f, 120f / 265f, 55f / 265f }, 4245 { 0f / 265f, 68f / 265f, 27f / 265f } }; 4246 4247 @Override 4248 public void apply(float x, float[] out) { 4249 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4250 4251 final float[] col = cols[i]; 4252 4253 out[0] = col[0]; 4254 out[1] = col[1]; 4255 out[2] = col[2]; 4256 } 4257 4258 @Override 4259 public Type type() { 4260 return Type.DIVERGING; 4261 } 4262 4263 @Override 4264 public Mode mode() { 4265 return Mode.DISCRETE; 4266 } 4267 }, 4268 4269 /** 4270 * ColorBrewer "PuBu" colour map with 3 colours. See <a 4271 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4272 * information. 4273 */ 4274 PuBu3 { 4275 private final float[][] cols = { { 236f / 265f, 231f / 265f, 242f / 265f }, 4276 { 166f / 265f, 189f / 265f, 219f / 265f }, { 43f / 265f, 140f / 265f, 190f / 265f } }; 4277 4278 @Override 4279 public void apply(float x, float[] out) { 4280 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4281 4282 final float[] col = cols[i]; 4283 4284 out[0] = col[0]; 4285 out[1] = col[1]; 4286 out[2] = col[2]; 4287 } 4288 4289 @Override 4290 public Type type() { 4291 return Type.SEQUENTIAL; 4292 } 4293 4294 @Override 4295 public Mode mode() { 4296 return Mode.DISCRETE; 4297 } 4298 }, 4299 4300 /** 4301 * ColorBrewer "PuBu" colour map with 4 colours. See <a 4302 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4303 * information. 4304 */ 4305 PuBu4 { 4306 private final float[][] cols = { { 241f / 265f, 238f / 265f, 246f / 265f }, 4307 { 189f / 265f, 201f / 265f, 225f / 265f }, { 116f / 265f, 169f / 265f, 207f / 265f }, 4308 { 5f / 265f, 112f / 265f, 176f / 265f } }; 4309 4310 @Override 4311 public void apply(float x, float[] out) { 4312 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4313 4314 final float[] col = cols[i]; 4315 4316 out[0] = col[0]; 4317 out[1] = col[1]; 4318 out[2] = col[2]; 4319 } 4320 4321 @Override 4322 public Type type() { 4323 return Type.SEQUENTIAL; 4324 } 4325 4326 @Override 4327 public Mode mode() { 4328 return Mode.DISCRETE; 4329 } 4330 }, 4331 4332 /** 4333 * ColorBrewer "PuBu" colour map with 5 colours. See <a 4334 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4335 * information. 4336 */ 4337 PuBu5 { 4338 private final float[][] cols = { { 241f / 265f, 238f / 265f, 246f / 265f }, 4339 { 189f / 265f, 201f / 265f, 225f / 265f }, { 116f / 265f, 169f / 265f, 207f / 265f }, 4340 { 43f / 265f, 140f / 265f, 190f / 265f }, { 4f / 265f, 90f / 265f, 141f / 265f } }; 4341 4342 @Override 4343 public void apply(float x, float[] out) { 4344 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4345 4346 final float[] col = cols[i]; 4347 4348 out[0] = col[0]; 4349 out[1] = col[1]; 4350 out[2] = col[2]; 4351 } 4352 4353 @Override 4354 public Type type() { 4355 return Type.SEQUENTIAL; 4356 } 4357 4358 @Override 4359 public Mode mode() { 4360 return Mode.DISCRETE; 4361 } 4362 }, 4363 4364 /** 4365 * ColorBrewer "PuBu" colour map with 6 colours. See <a 4366 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4367 * information. 4368 */ 4369 PuBu6 { 4370 private final float[][] cols = { { 241f / 265f, 238f / 265f, 246f / 265f }, 4371 { 208f / 265f, 209f / 265f, 230f / 265f }, { 166f / 265f, 189f / 265f, 219f / 265f }, 4372 { 116f / 265f, 169f / 265f, 207f / 265f }, { 43f / 265f, 140f / 265f, 190f / 265f }, 4373 { 4f / 265f, 90f / 265f, 141f / 265f } }; 4374 4375 @Override 4376 public void apply(float x, float[] out) { 4377 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4378 4379 final float[] col = cols[i]; 4380 4381 out[0] = col[0]; 4382 out[1] = col[1]; 4383 out[2] = col[2]; 4384 } 4385 4386 @Override 4387 public Type type() { 4388 return Type.SEQUENTIAL; 4389 } 4390 4391 @Override 4392 public Mode mode() { 4393 return Mode.DISCRETE; 4394 } 4395 }, 4396 4397 /** 4398 * ColorBrewer "PuBu" colour map with 7 colours. See <a 4399 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4400 * information. 4401 */ 4402 PuBu7 { 4403 private final float[][] cols = { { 241f / 265f, 238f / 265f, 246f / 265f }, 4404 { 208f / 265f, 209f / 265f, 230f / 265f }, { 166f / 265f, 189f / 265f, 219f / 265f }, 4405 { 116f / 265f, 169f / 265f, 207f / 265f }, { 54f / 265f, 144f / 265f, 192f / 265f }, 4406 { 5f / 265f, 112f / 265f, 176f / 265f }, { 3f / 265f, 78f / 265f, 123f / 265f } }; 4407 4408 @Override 4409 public void apply(float x, float[] out) { 4410 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4411 4412 final float[] col = cols[i]; 4413 4414 out[0] = col[0]; 4415 out[1] = col[1]; 4416 out[2] = col[2]; 4417 } 4418 4419 @Override 4420 public Type type() { 4421 return Type.SEQUENTIAL; 4422 } 4423 4424 @Override 4425 public Mode mode() { 4426 return Mode.DISCRETE; 4427 } 4428 }, 4429 4430 /** 4431 * ColorBrewer "PuBu" colour map with 8 colours. See <a 4432 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4433 * information. 4434 */ 4435 PuBu8 { 4436 private final float[][] cols = { { 255f / 265f, 247f / 265f, 251f / 265f }, 4437 { 236f / 265f, 231f / 265f, 242f / 265f }, { 208f / 265f, 209f / 265f, 230f / 265f }, 4438 { 166f / 265f, 189f / 265f, 219f / 265f }, { 116f / 265f, 169f / 265f, 207f / 265f }, 4439 { 54f / 265f, 144f / 265f, 192f / 265f }, { 5f / 265f, 112f / 265f, 176f / 265f }, 4440 { 3f / 265f, 78f / 265f, 123f / 265f } }; 4441 4442 @Override 4443 public void apply(float x, float[] out) { 4444 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4445 4446 final float[] col = cols[i]; 4447 4448 out[0] = col[0]; 4449 out[1] = col[1]; 4450 out[2] = col[2]; 4451 } 4452 4453 @Override 4454 public Type type() { 4455 return Type.SEQUENTIAL; 4456 } 4457 4458 @Override 4459 public Mode mode() { 4460 return Mode.DISCRETE; 4461 } 4462 }, 4463 4464 /** 4465 * ColorBrewer "PuBu" colour map with 9 colours. See <a 4466 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4467 * information. 4468 */ 4469 PuBu9 { 4470 private final float[][] cols = { { 255f / 265f, 247f / 265f, 251f / 265f }, 4471 { 236f / 265f, 231f / 265f, 242f / 265f }, { 208f / 265f, 209f / 265f, 230f / 265f }, 4472 { 166f / 265f, 189f / 265f, 219f / 265f }, { 116f / 265f, 169f / 265f, 207f / 265f }, 4473 { 54f / 265f, 144f / 265f, 192f / 265f }, { 5f / 265f, 112f / 265f, 176f / 265f }, 4474 { 4f / 265f, 90f / 265f, 141f / 265f }, { 2f / 265f, 56f / 265f, 88f / 265f } }; 4475 4476 @Override 4477 public void apply(float x, float[] out) { 4478 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4479 4480 final float[] col = cols[i]; 4481 4482 out[0] = col[0]; 4483 out[1] = col[1]; 4484 out[2] = col[2]; 4485 } 4486 4487 @Override 4488 public Type type() { 4489 return Type.SEQUENTIAL; 4490 } 4491 4492 @Override 4493 public Mode mode() { 4494 return Mode.DISCRETE; 4495 } 4496 }, 4497 4498 /** 4499 * ColorBrewer "PuBuGn" colour map with 3 colours. See <a 4500 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4501 * information. 4502 */ 4503 PuBuGn3 { 4504 private final float[][] cols = { { 236f / 265f, 226f / 265f, 240f / 265f }, 4505 { 166f / 265f, 189f / 265f, 219f / 265f }, { 28f / 265f, 144f / 265f, 153f / 265f } }; 4506 4507 @Override 4508 public void apply(float x, float[] out) { 4509 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4510 4511 final float[] col = cols[i]; 4512 4513 out[0] = col[0]; 4514 out[1] = col[1]; 4515 out[2] = col[2]; 4516 } 4517 4518 @Override 4519 public Type type() { 4520 return Type.SEQUENTIAL; 4521 } 4522 4523 @Override 4524 public Mode mode() { 4525 return Mode.DISCRETE; 4526 } 4527 }, 4528 4529 /** 4530 * ColorBrewer "PuBuGn" colour map with 4 colours. See <a 4531 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4532 * information. 4533 */ 4534 PuBuGn4 { 4535 private final float[][] cols = { { 246f / 265f, 239f / 265f, 247f / 265f }, 4536 { 189f / 265f, 201f / 265f, 225f / 265f }, { 103f / 265f, 169f / 265f, 207f / 265f }, 4537 { 2f / 265f, 129f / 265f, 138f / 265f } }; 4538 4539 @Override 4540 public void apply(float x, float[] out) { 4541 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4542 4543 final float[] col = cols[i]; 4544 4545 out[0] = col[0]; 4546 out[1] = col[1]; 4547 out[2] = col[2]; 4548 } 4549 4550 @Override 4551 public Type type() { 4552 return Type.SEQUENTIAL; 4553 } 4554 4555 @Override 4556 public Mode mode() { 4557 return Mode.DISCRETE; 4558 } 4559 }, 4560 4561 /** 4562 * ColorBrewer "PuBuGn" colour map with 5 colours. See <a 4563 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4564 * information. 4565 */ 4566 PuBuGn5 { 4567 private final float[][] cols = { { 246f / 265f, 239f / 265f, 247f / 265f }, 4568 { 189f / 265f, 201f / 265f, 225f / 265f }, { 103f / 265f, 169f / 265f, 207f / 265f }, 4569 { 28f / 265f, 144f / 265f, 153f / 265f }, { 1f / 265f, 108f / 265f, 89f / 265f } }; 4570 4571 @Override 4572 public void apply(float x, float[] out) { 4573 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4574 4575 final float[] col = cols[i]; 4576 4577 out[0] = col[0]; 4578 out[1] = col[1]; 4579 out[2] = col[2]; 4580 } 4581 4582 @Override 4583 public Type type() { 4584 return Type.SEQUENTIAL; 4585 } 4586 4587 @Override 4588 public Mode mode() { 4589 return Mode.DISCRETE; 4590 } 4591 }, 4592 4593 /** 4594 * ColorBrewer "PuBuGn" colour map with 6 colours. See <a 4595 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4596 * information. 4597 */ 4598 PuBuGn6 { 4599 private final float[][] cols = { { 246f / 265f, 239f / 265f, 247f / 265f }, 4600 { 208f / 265f, 209f / 265f, 230f / 265f }, { 166f / 265f, 189f / 265f, 219f / 265f }, 4601 { 103f / 265f, 169f / 265f, 207f / 265f }, { 28f / 265f, 144f / 265f, 153f / 265f }, 4602 { 1f / 265f, 108f / 265f, 89f / 265f } }; 4603 4604 @Override 4605 public void apply(float x, float[] out) { 4606 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4607 4608 final float[] col = cols[i]; 4609 4610 out[0] = col[0]; 4611 out[1] = col[1]; 4612 out[2] = col[2]; 4613 } 4614 4615 @Override 4616 public Type type() { 4617 return Type.SEQUENTIAL; 4618 } 4619 4620 @Override 4621 public Mode mode() { 4622 return Mode.DISCRETE; 4623 } 4624 }, 4625 4626 /** 4627 * ColorBrewer "PuBuGn" colour map with 7 colours. See <a 4628 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4629 * information. 4630 */ 4631 PuBuGn7 { 4632 private final float[][] cols = { { 246f / 265f, 239f / 265f, 247f / 265f }, 4633 { 208f / 265f, 209f / 265f, 230f / 265f }, { 166f / 265f, 189f / 265f, 219f / 265f }, 4634 { 103f / 265f, 169f / 265f, 207f / 265f }, { 54f / 265f, 144f / 265f, 192f / 265f }, 4635 { 2f / 265f, 129f / 265f, 138f / 265f }, { 1f / 265f, 100f / 265f, 80f / 265f } }; 4636 4637 @Override 4638 public void apply(float x, float[] out) { 4639 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4640 4641 final float[] col = cols[i]; 4642 4643 out[0] = col[0]; 4644 out[1] = col[1]; 4645 out[2] = col[2]; 4646 } 4647 4648 @Override 4649 public Type type() { 4650 return Type.SEQUENTIAL; 4651 } 4652 4653 @Override 4654 public Mode mode() { 4655 return Mode.DISCRETE; 4656 } 4657 }, 4658 4659 /** 4660 * ColorBrewer "PuBuGn" colour map with 8 colours. See <a 4661 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4662 * information. 4663 */ 4664 PuBuGn8 { 4665 private final float[][] cols = { { 255f / 265f, 247f / 265f, 251f / 265f }, 4666 { 236f / 265f, 226f / 265f, 240f / 265f }, { 208f / 265f, 209f / 265f, 230f / 265f }, 4667 { 166f / 265f, 189f / 265f, 219f / 265f }, { 103f / 265f, 169f / 265f, 207f / 265f }, 4668 { 54f / 265f, 144f / 265f, 192f / 265f }, { 2f / 265f, 129f / 265f, 138f / 265f }, 4669 { 1f / 265f, 100f / 265f, 80f / 265f } }; 4670 4671 @Override 4672 public void apply(float x, float[] out) { 4673 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4674 4675 final float[] col = cols[i]; 4676 4677 out[0] = col[0]; 4678 out[1] = col[1]; 4679 out[2] = col[2]; 4680 } 4681 4682 @Override 4683 public Type type() { 4684 return Type.SEQUENTIAL; 4685 } 4686 4687 @Override 4688 public Mode mode() { 4689 return Mode.DISCRETE; 4690 } 4691 }, 4692 4693 /** 4694 * ColorBrewer "PuBuGn" colour map with 9 colours. See <a 4695 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4696 * information. 4697 */ 4698 PuBuGn9 { 4699 private final float[][] cols = { { 255f / 265f, 247f / 265f, 251f / 265f }, 4700 { 236f / 265f, 226f / 265f, 240f / 265f }, { 208f / 265f, 209f / 265f, 230f / 265f }, 4701 { 166f / 265f, 189f / 265f, 219f / 265f }, { 103f / 265f, 169f / 265f, 207f / 265f }, 4702 { 54f / 265f, 144f / 265f, 192f / 265f }, { 2f / 265f, 129f / 265f, 138f / 265f }, 4703 { 1f / 265f, 108f / 265f, 89f / 265f }, { 1f / 265f, 70f / 265f, 54f / 265f } }; 4704 4705 @Override 4706 public void apply(float x, float[] out) { 4707 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4708 4709 final float[] col = cols[i]; 4710 4711 out[0] = col[0]; 4712 out[1] = col[1]; 4713 out[2] = col[2]; 4714 } 4715 4716 @Override 4717 public Type type() { 4718 return Type.SEQUENTIAL; 4719 } 4720 4721 @Override 4722 public Mode mode() { 4723 return Mode.DISCRETE; 4724 } 4725 }, 4726 4727 /** 4728 * ColorBrewer "PuOr" colour map with 3 colours. See <a 4729 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4730 * information. 4731 */ 4732 PuOr3 { 4733 private final float[][] cols = { { 241f / 265f, 163f / 265f, 64f / 265f }, 4734 { 247f / 265f, 247f / 265f, 247f / 265f }, { 153f / 265f, 142f / 265f, 195f / 265f } }; 4735 4736 @Override 4737 public void apply(float x, float[] out) { 4738 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4739 4740 final float[] col = cols[i]; 4741 4742 out[0] = col[0]; 4743 out[1] = col[1]; 4744 out[2] = col[2]; 4745 } 4746 4747 @Override 4748 public Type type() { 4749 return Type.DIVERGING; 4750 } 4751 4752 @Override 4753 public Mode mode() { 4754 return Mode.DISCRETE; 4755 } 4756 }, 4757 4758 /** 4759 * ColorBrewer "PuOr" colour map with 4 colours. See <a 4760 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4761 * information. 4762 */ 4763 PuOr4 { 4764 private final float[][] cols = { { 230f / 265f, 97f / 265f, 1f / 265f }, 4765 { 253f / 265f, 184f / 265f, 99f / 265f }, { 178f / 265f, 171f / 265f, 210f / 265f }, 4766 { 94f / 265f, 60f / 265f, 153f / 265f } }; 4767 4768 @Override 4769 public void apply(float x, float[] out) { 4770 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4771 4772 final float[] col = cols[i]; 4773 4774 out[0] = col[0]; 4775 out[1] = col[1]; 4776 out[2] = col[2]; 4777 } 4778 4779 @Override 4780 public Type type() { 4781 return Type.DIVERGING; 4782 } 4783 4784 @Override 4785 public Mode mode() { 4786 return Mode.DISCRETE; 4787 } 4788 }, 4789 4790 /** 4791 * ColorBrewer "PuOr" colour map with 5 colours. See <a 4792 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4793 * information. 4794 */ 4795 PuOr5 { 4796 private final float[][] cols = { { 230f / 265f, 97f / 265f, 1f / 265f }, 4797 { 253f / 265f, 184f / 265f, 99f / 265f }, { 247f / 265f, 247f / 265f, 247f / 265f }, 4798 { 178f / 265f, 171f / 265f, 210f / 265f }, { 94f / 265f, 60f / 265f, 153f / 265f } }; 4799 4800 @Override 4801 public void apply(float x, float[] out) { 4802 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4803 4804 final float[] col = cols[i]; 4805 4806 out[0] = col[0]; 4807 out[1] = col[1]; 4808 out[2] = col[2]; 4809 } 4810 4811 @Override 4812 public Type type() { 4813 return Type.DIVERGING; 4814 } 4815 4816 @Override 4817 public Mode mode() { 4818 return Mode.DISCRETE; 4819 } 4820 }, 4821 4822 /** 4823 * ColorBrewer "PuOr" colour map with 6 colours. See <a 4824 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4825 * information. 4826 */ 4827 PuOr6 { 4828 private final float[][] cols = { { 179f / 265f, 88f / 265f, 6f / 265f }, 4829 { 241f / 265f, 163f / 265f, 64f / 265f }, { 254f / 265f, 224f / 265f, 182f / 265f }, 4830 { 216f / 265f, 218f / 265f, 235f / 265f }, { 153f / 265f, 142f / 265f, 195f / 265f }, 4831 { 84f / 265f, 39f / 265f, 136f / 265f } }; 4832 4833 @Override 4834 public void apply(float x, float[] out) { 4835 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4836 4837 final float[] col = cols[i]; 4838 4839 out[0] = col[0]; 4840 out[1] = col[1]; 4841 out[2] = col[2]; 4842 } 4843 4844 @Override 4845 public Type type() { 4846 return Type.DIVERGING; 4847 } 4848 4849 @Override 4850 public Mode mode() { 4851 return Mode.DISCRETE; 4852 } 4853 }, 4854 4855 /** 4856 * ColorBrewer "PuOr" colour map with 7 colours. See <a 4857 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4858 * information. 4859 */ 4860 PuOr7 { 4861 private final float[][] cols = { { 179f / 265f, 88f / 265f, 6f / 265f }, 4862 { 241f / 265f, 163f / 265f, 64f / 265f }, { 254f / 265f, 224f / 265f, 182f / 265f }, 4863 { 247f / 265f, 247f / 265f, 247f / 265f }, { 216f / 265f, 218f / 265f, 235f / 265f }, 4864 { 153f / 265f, 142f / 265f, 195f / 265f }, { 84f / 265f, 39f / 265f, 136f / 265f } }; 4865 4866 @Override 4867 public void apply(float x, float[] out) { 4868 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4869 4870 final float[] col = cols[i]; 4871 4872 out[0] = col[0]; 4873 out[1] = col[1]; 4874 out[2] = col[2]; 4875 } 4876 4877 @Override 4878 public Type type() { 4879 return Type.DIVERGING; 4880 } 4881 4882 @Override 4883 public Mode mode() { 4884 return Mode.DISCRETE; 4885 } 4886 }, 4887 4888 /** 4889 * ColorBrewer "PuOr" colour map with 8 colours. See <a 4890 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4891 * information. 4892 */ 4893 PuOr8 { 4894 private final float[][] cols = { { 179f / 265f, 88f / 265f, 6f / 265f }, 4895 { 224f / 265f, 130f / 265f, 20f / 265f }, { 253f / 265f, 184f / 265f, 99f / 265f }, 4896 { 254f / 265f, 224f / 265f, 182f / 265f }, { 216f / 265f, 218f / 265f, 235f / 265f }, 4897 { 178f / 265f, 171f / 265f, 210f / 265f }, { 128f / 265f, 115f / 265f, 172f / 265f }, 4898 { 84f / 265f, 39f / 265f, 136f / 265f } }; 4899 4900 @Override 4901 public void apply(float x, float[] out) { 4902 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4903 4904 final float[] col = cols[i]; 4905 4906 out[0] = col[0]; 4907 out[1] = col[1]; 4908 out[2] = col[2]; 4909 } 4910 4911 @Override 4912 public Type type() { 4913 return Type.DIVERGING; 4914 } 4915 4916 @Override 4917 public Mode mode() { 4918 return Mode.DISCRETE; 4919 } 4920 }, 4921 4922 /** 4923 * ColorBrewer "PuOr" colour map with 9 colours. See <a 4924 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4925 * information. 4926 */ 4927 PuOr9 { 4928 private final float[][] cols = { { 179f / 265f, 88f / 265f, 6f / 265f }, 4929 { 224f / 265f, 130f / 265f, 20f / 265f }, { 253f / 265f, 184f / 265f, 99f / 265f }, 4930 { 254f / 265f, 224f / 265f, 182f / 265f }, { 247f / 265f, 247f / 265f, 247f / 265f }, 4931 { 216f / 265f, 218f / 265f, 235f / 265f }, { 178f / 265f, 171f / 265f, 210f / 265f }, 4932 { 128f / 265f, 115f / 265f, 172f / 265f }, { 84f / 265f, 39f / 265f, 136f / 265f } }; 4933 4934 @Override 4935 public void apply(float x, float[] out) { 4936 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4937 4938 final float[] col = cols[i]; 4939 4940 out[0] = col[0]; 4941 out[1] = col[1]; 4942 out[2] = col[2]; 4943 } 4944 4945 @Override 4946 public Type type() { 4947 return Type.DIVERGING; 4948 } 4949 4950 @Override 4951 public Mode mode() { 4952 return Mode.DISCRETE; 4953 } 4954 }, 4955 4956 /** 4957 * ColorBrewer "PuOr" colour map with 10 colours. See <a 4958 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4959 * information. 4960 */ 4961 PuOr10 { 4962 private final float[][] cols = { { 127f / 265f, 59f / 265f, 8f / 265f }, { 179f / 265f, 88f / 265f, 6f / 265f }, 4963 { 224f / 265f, 130f / 265f, 20f / 265f }, { 253f / 265f, 184f / 265f, 99f / 265f }, 4964 { 254f / 265f, 224f / 265f, 182f / 265f }, { 216f / 265f, 218f / 265f, 235f / 265f }, 4965 { 178f / 265f, 171f / 265f, 210f / 265f }, { 128f / 265f, 115f / 265f, 172f / 265f }, 4966 { 84f / 265f, 39f / 265f, 136f / 265f }, { 45f / 265f, 0f / 265f, 75f / 265f } }; 4967 4968 @Override 4969 public void apply(float x, float[] out) { 4970 final int i = Math.min((int) (x * cols.length), cols.length - 1); 4971 4972 final float[] col = cols[i]; 4973 4974 out[0] = col[0]; 4975 out[1] = col[1]; 4976 out[2] = col[2]; 4977 } 4978 4979 @Override 4980 public Type type() { 4981 return Type.DIVERGING; 4982 } 4983 4984 @Override 4985 public Mode mode() { 4986 return Mode.DISCRETE; 4987 } 4988 }, 4989 4990 /** 4991 * ColorBrewer "PuOr" colour map with 11 colours. See <a 4992 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 4993 * information. 4994 */ 4995 PuOr11 { 4996 private final float[][] cols = { { 127f / 265f, 59f / 265f, 8f / 265f }, { 179f / 265f, 88f / 265f, 6f / 265f }, 4997 { 224f / 265f, 130f / 265f, 20f / 265f }, { 253f / 265f, 184f / 265f, 99f / 265f }, 4998 { 254f / 265f, 224f / 265f, 182f / 265f }, { 247f / 265f, 247f / 265f, 247f / 265f }, 4999 { 216f / 265f, 218f / 265f, 235f / 265f }, { 178f / 265f, 171f / 265f, 210f / 265f }, 5000 { 128f / 265f, 115f / 265f, 172f / 265f }, { 84f / 265f, 39f / 265f, 136f / 265f }, 5001 { 45f / 265f, 0f / 265f, 75f / 265f } }; 5002 5003 @Override 5004 public void apply(float x, float[] out) { 5005 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5006 5007 final float[] col = cols[i]; 5008 5009 out[0] = col[0]; 5010 out[1] = col[1]; 5011 out[2] = col[2]; 5012 } 5013 5014 @Override 5015 public Type type() { 5016 return Type.DIVERGING; 5017 } 5018 5019 @Override 5020 public Mode mode() { 5021 return Mode.DISCRETE; 5022 } 5023 }, 5024 5025 /** 5026 * ColorBrewer "PuRd" colour map with 3 colours. See <a 5027 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5028 * information. 5029 */ 5030 PuRd3 { 5031 private final float[][] cols = { { 231f / 265f, 225f / 265f, 239f / 265f }, 5032 { 201f / 265f, 148f / 265f, 199f / 265f }, { 221f / 265f, 28f / 265f, 119f / 265f } }; 5033 5034 @Override 5035 public void apply(float x, float[] out) { 5036 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5037 5038 final float[] col = cols[i]; 5039 5040 out[0] = col[0]; 5041 out[1] = col[1]; 5042 out[2] = col[2]; 5043 } 5044 5045 @Override 5046 public Type type() { 5047 return Type.SEQUENTIAL; 5048 } 5049 5050 @Override 5051 public Mode mode() { 5052 return Mode.DISCRETE; 5053 } 5054 }, 5055 5056 /** 5057 * ColorBrewer "PuRd" colour map with 4 colours. See <a 5058 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5059 * information. 5060 */ 5061 PuRd4 { 5062 private final float[][] cols = { { 241f / 265f, 238f / 265f, 246f / 265f }, 5063 { 215f / 265f, 181f / 265f, 216f / 265f }, { 223f / 265f, 101f / 265f, 176f / 265f }, 5064 { 206f / 265f, 18f / 265f, 86f / 265f } }; 5065 5066 @Override 5067 public void apply(float x, float[] out) { 5068 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5069 5070 final float[] col = cols[i]; 5071 5072 out[0] = col[0]; 5073 out[1] = col[1]; 5074 out[2] = col[2]; 5075 } 5076 5077 @Override 5078 public Type type() { 5079 return Type.SEQUENTIAL; 5080 } 5081 5082 @Override 5083 public Mode mode() { 5084 return Mode.DISCRETE; 5085 } 5086 }, 5087 5088 /** 5089 * ColorBrewer "PuRd" colour map with 5 colours. See <a 5090 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5091 * information. 5092 */ 5093 PuRd5 { 5094 private final float[][] cols = { { 241f / 265f, 238f / 265f, 246f / 265f }, 5095 { 215f / 265f, 181f / 265f, 216f / 265f }, { 223f / 265f, 101f / 265f, 176f / 265f }, 5096 { 221f / 265f, 28f / 265f, 119f / 265f }, { 152f / 265f, 0f / 265f, 67f / 265f } }; 5097 5098 @Override 5099 public void apply(float x, float[] out) { 5100 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5101 5102 final float[] col = cols[i]; 5103 5104 out[0] = col[0]; 5105 out[1] = col[1]; 5106 out[2] = col[2]; 5107 } 5108 5109 @Override 5110 public Type type() { 5111 return Type.SEQUENTIAL; 5112 } 5113 5114 @Override 5115 public Mode mode() { 5116 return Mode.DISCRETE; 5117 } 5118 }, 5119 5120 /** 5121 * ColorBrewer "PuRd" colour map with 6 colours. See <a 5122 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5123 * information. 5124 */ 5125 PuRd6 { 5126 private final float[][] cols = { { 241f / 265f, 238f / 265f, 246f / 265f }, 5127 { 212f / 265f, 185f / 265f, 218f / 265f }, { 201f / 265f, 148f / 265f, 199f / 265f }, 5128 { 223f / 265f, 101f / 265f, 176f / 265f }, { 221f / 265f, 28f / 265f, 119f / 265f }, 5129 { 152f / 265f, 0f / 265f, 67f / 265f } }; 5130 5131 @Override 5132 public void apply(float x, float[] out) { 5133 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5134 5135 final float[] col = cols[i]; 5136 5137 out[0] = col[0]; 5138 out[1] = col[1]; 5139 out[2] = col[2]; 5140 } 5141 5142 @Override 5143 public Type type() { 5144 return Type.SEQUENTIAL; 5145 } 5146 5147 @Override 5148 public Mode mode() { 5149 return Mode.DISCRETE; 5150 } 5151 }, 5152 5153 /** 5154 * ColorBrewer "PuRd" colour map with 7 colours. See <a 5155 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5156 * information. 5157 */ 5158 PuRd7 { 5159 private final float[][] cols = { { 241f / 265f, 238f / 265f, 246f / 265f }, 5160 { 212f / 265f, 185f / 265f, 218f / 265f }, { 201f / 265f, 148f / 265f, 199f / 265f }, 5161 { 223f / 265f, 101f / 265f, 176f / 265f }, { 231f / 265f, 41f / 265f, 138f / 265f }, 5162 { 206f / 265f, 18f / 265f, 86f / 265f }, { 145f / 265f, 0f / 265f, 63f / 265f } }; 5163 5164 @Override 5165 public void apply(float x, float[] out) { 5166 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5167 5168 final float[] col = cols[i]; 5169 5170 out[0] = col[0]; 5171 out[1] = col[1]; 5172 out[2] = col[2]; 5173 } 5174 5175 @Override 5176 public Type type() { 5177 return Type.SEQUENTIAL; 5178 } 5179 5180 @Override 5181 public Mode mode() { 5182 return Mode.DISCRETE; 5183 } 5184 }, 5185 5186 /** 5187 * ColorBrewer "PuRd" colour map with 8 colours. See <a 5188 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5189 * information. 5190 */ 5191 PuRd8 { 5192 private final float[][] cols = { { 247f / 265f, 244f / 265f, 249f / 265f }, 5193 { 231f / 265f, 225f / 265f, 239f / 265f }, { 212f / 265f, 185f / 265f, 218f / 265f }, 5194 { 201f / 265f, 148f / 265f, 199f / 265f }, { 223f / 265f, 101f / 265f, 176f / 265f }, 5195 { 231f / 265f, 41f / 265f, 138f / 265f }, { 206f / 265f, 18f / 265f, 86f / 265f }, 5196 { 145f / 265f, 0f / 265f, 63f / 265f } }; 5197 5198 @Override 5199 public void apply(float x, float[] out) { 5200 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5201 5202 final float[] col = cols[i]; 5203 5204 out[0] = col[0]; 5205 out[1] = col[1]; 5206 out[2] = col[2]; 5207 } 5208 5209 @Override 5210 public Type type() { 5211 return Type.SEQUENTIAL; 5212 } 5213 5214 @Override 5215 public Mode mode() { 5216 return Mode.DISCRETE; 5217 } 5218 }, 5219 5220 /** 5221 * ColorBrewer "PuRd" colour map with 9 colours. See <a 5222 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5223 * information. 5224 */ 5225 PuRd9 { 5226 private final float[][] cols = { { 247f / 265f, 244f / 265f, 249f / 265f }, 5227 { 231f / 265f, 225f / 265f, 239f / 265f }, { 212f / 265f, 185f / 265f, 218f / 265f }, 5228 { 201f / 265f, 148f / 265f, 199f / 265f }, { 223f / 265f, 101f / 265f, 176f / 265f }, 5229 { 231f / 265f, 41f / 265f, 138f / 265f }, { 206f / 265f, 18f / 265f, 86f / 265f }, 5230 { 152f / 265f, 0f / 265f, 67f / 265f }, { 103f / 265f, 0f / 265f, 31f / 265f } }; 5231 5232 @Override 5233 public void apply(float x, float[] out) { 5234 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5235 5236 final float[] col = cols[i]; 5237 5238 out[0] = col[0]; 5239 out[1] = col[1]; 5240 out[2] = col[2]; 5241 } 5242 5243 @Override 5244 public Type type() { 5245 return Type.SEQUENTIAL; 5246 } 5247 5248 @Override 5249 public Mode mode() { 5250 return Mode.DISCRETE; 5251 } 5252 }, 5253 5254 /** 5255 * ColorBrewer "Purples" colour map with 3 colours. See <a 5256 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5257 * information. 5258 */ 5259 Purples3 { 5260 private final float[][] cols = { { 239f / 265f, 237f / 265f, 245f / 265f }, 5261 { 188f / 265f, 189f / 265f, 220f / 265f }, { 117f / 265f, 107f / 265f, 177f / 265f } }; 5262 5263 @Override 5264 public void apply(float x, float[] out) { 5265 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5266 5267 final float[] col = cols[i]; 5268 5269 out[0] = col[0]; 5270 out[1] = col[1]; 5271 out[2] = col[2]; 5272 } 5273 5274 @Override 5275 public Type type() { 5276 return Type.SEQUENTIAL; 5277 } 5278 5279 @Override 5280 public Mode mode() { 5281 return Mode.DISCRETE; 5282 } 5283 }, 5284 5285 /** 5286 * ColorBrewer "Purples" colour map with 4 colours. See <a 5287 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5288 * information. 5289 */ 5290 Purples4 { 5291 private final float[][] cols = { { 242f / 265f, 240f / 265f, 247f / 265f }, 5292 { 203f / 265f, 201f / 265f, 226f / 265f }, { 158f / 265f, 154f / 265f, 200f / 265f }, 5293 { 106f / 265f, 81f / 265f, 163f / 265f } }; 5294 5295 @Override 5296 public void apply(float x, float[] out) { 5297 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5298 5299 final float[] col = cols[i]; 5300 5301 out[0] = col[0]; 5302 out[1] = col[1]; 5303 out[2] = col[2]; 5304 } 5305 5306 @Override 5307 public Type type() { 5308 return Type.SEQUENTIAL; 5309 } 5310 5311 @Override 5312 public Mode mode() { 5313 return Mode.DISCRETE; 5314 } 5315 }, 5316 5317 /** 5318 * ColorBrewer "Purples" colour map with 5 colours. See <a 5319 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5320 * information. 5321 */ 5322 Purples5 { 5323 private final float[][] cols = { { 242f / 265f, 240f / 265f, 247f / 265f }, 5324 { 203f / 265f, 201f / 265f, 226f / 265f }, { 158f / 265f, 154f / 265f, 200f / 265f }, 5325 { 117f / 265f, 107f / 265f, 177f / 265f }, { 84f / 265f, 39f / 265f, 143f / 265f } }; 5326 5327 @Override 5328 public void apply(float x, float[] out) { 5329 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5330 5331 final float[] col = cols[i]; 5332 5333 out[0] = col[0]; 5334 out[1] = col[1]; 5335 out[2] = col[2]; 5336 } 5337 5338 @Override 5339 public Type type() { 5340 return Type.SEQUENTIAL; 5341 } 5342 5343 @Override 5344 public Mode mode() { 5345 return Mode.DISCRETE; 5346 } 5347 }, 5348 5349 /** 5350 * ColorBrewer "Purples" colour map with 6 colours. See <a 5351 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5352 * information. 5353 */ 5354 Purples6 { 5355 private final float[][] cols = { { 242f / 265f, 240f / 265f, 247f / 265f }, 5356 { 218f / 265f, 218f / 265f, 235f / 265f }, { 188f / 265f, 189f / 265f, 220f / 265f }, 5357 { 158f / 265f, 154f / 265f, 200f / 265f }, { 117f / 265f, 107f / 265f, 177f / 265f }, 5358 { 84f / 265f, 39f / 265f, 143f / 265f } }; 5359 5360 @Override 5361 public void apply(float x, float[] out) { 5362 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5363 5364 final float[] col = cols[i]; 5365 5366 out[0] = col[0]; 5367 out[1] = col[1]; 5368 out[2] = col[2]; 5369 } 5370 5371 @Override 5372 public Type type() { 5373 return Type.SEQUENTIAL; 5374 } 5375 5376 @Override 5377 public Mode mode() { 5378 return Mode.DISCRETE; 5379 } 5380 }, 5381 5382 /** 5383 * ColorBrewer "Purples" colour map with 7 colours. See <a 5384 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5385 * information. 5386 */ 5387 Purples7 { 5388 private final float[][] cols = { { 242f / 265f, 240f / 265f, 247f / 265f }, 5389 { 218f / 265f, 218f / 265f, 235f / 265f }, { 188f / 265f, 189f / 265f, 220f / 265f }, 5390 { 158f / 265f, 154f / 265f, 200f / 265f }, { 128f / 265f, 125f / 265f, 186f / 265f }, 5391 { 106f / 265f, 81f / 265f, 163f / 265f }, { 74f / 265f, 20f / 265f, 134f / 265f } }; 5392 5393 @Override 5394 public void apply(float x, float[] out) { 5395 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5396 5397 final float[] col = cols[i]; 5398 5399 out[0] = col[0]; 5400 out[1] = col[1]; 5401 out[2] = col[2]; 5402 } 5403 5404 @Override 5405 public Type type() { 5406 return Type.SEQUENTIAL; 5407 } 5408 5409 @Override 5410 public Mode mode() { 5411 return Mode.DISCRETE; 5412 } 5413 }, 5414 5415 /** 5416 * ColorBrewer "Purples" colour map with 8 colours. See <a 5417 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5418 * information. 5419 */ 5420 Purples8 { 5421 private final float[][] cols = { { 252f / 265f, 251f / 265f, 253f / 265f }, 5422 { 239f / 265f, 237f / 265f, 245f / 265f }, { 218f / 265f, 218f / 265f, 235f / 265f }, 5423 { 188f / 265f, 189f / 265f, 220f / 265f }, { 158f / 265f, 154f / 265f, 200f / 265f }, 5424 { 128f / 265f, 125f / 265f, 186f / 265f }, { 106f / 265f, 81f / 265f, 163f / 265f }, 5425 { 74f / 265f, 20f / 265f, 134f / 265f } }; 5426 5427 @Override 5428 public void apply(float x, float[] out) { 5429 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5430 5431 final float[] col = cols[i]; 5432 5433 out[0] = col[0]; 5434 out[1] = col[1]; 5435 out[2] = col[2]; 5436 } 5437 5438 @Override 5439 public Type type() { 5440 return Type.SEQUENTIAL; 5441 } 5442 5443 @Override 5444 public Mode mode() { 5445 return Mode.DISCRETE; 5446 } 5447 }, 5448 5449 /** 5450 * ColorBrewer "Purples" colour map with 9 colours. See <a 5451 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5452 * information. 5453 */ 5454 Purples9 { 5455 private final float[][] cols = { { 252f / 265f, 251f / 265f, 253f / 265f }, 5456 { 239f / 265f, 237f / 265f, 245f / 265f }, { 218f / 265f, 218f / 265f, 235f / 265f }, 5457 { 188f / 265f, 189f / 265f, 220f / 265f }, { 158f / 265f, 154f / 265f, 200f / 265f }, 5458 { 128f / 265f, 125f / 265f, 186f / 265f }, { 106f / 265f, 81f / 265f, 163f / 265f }, 5459 { 84f / 265f, 39f / 265f, 143f / 265f }, { 63f / 265f, 0f / 265f, 125f / 265f } }; 5460 5461 @Override 5462 public void apply(float x, float[] out) { 5463 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5464 5465 final float[] col = cols[i]; 5466 5467 out[0] = col[0]; 5468 out[1] = col[1]; 5469 out[2] = col[2]; 5470 } 5471 5472 @Override 5473 public Type type() { 5474 return Type.SEQUENTIAL; 5475 } 5476 5477 @Override 5478 public Mode mode() { 5479 return Mode.DISCRETE; 5480 } 5481 }, 5482 5483 /** 5484 * ColorBrewer "RdBu" colour map with 3 colours. See <a 5485 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5486 * information. 5487 */ 5488 RdBu3 { 5489 private final float[][] cols = { { 239f / 265f, 138f / 265f, 98f / 265f }, 5490 { 247f / 265f, 247f / 265f, 247f / 265f }, { 103f / 265f, 169f / 265f, 207f / 265f } }; 5491 5492 @Override 5493 public void apply(float x, float[] out) { 5494 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5495 5496 final float[] col = cols[i]; 5497 5498 out[0] = col[0]; 5499 out[1] = col[1]; 5500 out[2] = col[2]; 5501 } 5502 5503 @Override 5504 public Type type() { 5505 return Type.DIVERGING; 5506 } 5507 5508 @Override 5509 public Mode mode() { 5510 return Mode.DISCRETE; 5511 } 5512 }, 5513 5514 /** 5515 * ColorBrewer "RdBu" colour map with 4 colours. See <a 5516 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5517 * information. 5518 */ 5519 RdBu4 { 5520 private final float[][] cols = { { 202f / 265f, 0f / 265f, 32f / 265f }, 5521 { 244f / 265f, 165f / 265f, 130f / 265f }, { 146f / 265f, 197f / 265f, 222f / 265f }, 5522 { 5f / 265f, 113f / 265f, 176f / 265f } }; 5523 5524 @Override 5525 public void apply(float x, float[] out) { 5526 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5527 5528 final float[] col = cols[i]; 5529 5530 out[0] = col[0]; 5531 out[1] = col[1]; 5532 out[2] = col[2]; 5533 } 5534 5535 @Override 5536 public Type type() { 5537 return Type.DIVERGING; 5538 } 5539 5540 @Override 5541 public Mode mode() { 5542 return Mode.DISCRETE; 5543 } 5544 }, 5545 5546 /** 5547 * ColorBrewer "RdBu" colour map with 5 colours. See <a 5548 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5549 * information. 5550 */ 5551 RdBu5 { 5552 private final float[][] cols = { { 202f / 265f, 0f / 265f, 32f / 265f }, 5553 { 244f / 265f, 165f / 265f, 130f / 265f }, { 247f / 265f, 247f / 265f, 247f / 265f }, 5554 { 146f / 265f, 197f / 265f, 222f / 265f }, { 5f / 265f, 113f / 265f, 176f / 265f } }; 5555 5556 @Override 5557 public void apply(float x, float[] out) { 5558 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5559 5560 final float[] col = cols[i]; 5561 5562 out[0] = col[0]; 5563 out[1] = col[1]; 5564 out[2] = col[2]; 5565 } 5566 5567 @Override 5568 public Type type() { 5569 return Type.DIVERGING; 5570 } 5571 5572 @Override 5573 public Mode mode() { 5574 return Mode.DISCRETE; 5575 } 5576 }, 5577 5578 /** 5579 * ColorBrewer "RdBu" colour map with 6 colours. See <a 5580 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5581 * information. 5582 */ 5583 RdBu6 { 5584 private final float[][] cols = { { 178f / 265f, 24f / 265f, 43f / 265f }, 5585 { 239f / 265f, 138f / 265f, 98f / 265f }, { 253f / 265f, 219f / 265f, 199f / 265f }, 5586 { 209f / 265f, 229f / 265f, 240f / 265f }, { 103f / 265f, 169f / 265f, 207f / 265f }, 5587 { 33f / 265f, 102f / 265f, 172f / 265f } }; 5588 5589 @Override 5590 public void apply(float x, float[] out) { 5591 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5592 5593 final float[] col = cols[i]; 5594 5595 out[0] = col[0]; 5596 out[1] = col[1]; 5597 out[2] = col[2]; 5598 } 5599 5600 @Override 5601 public Type type() { 5602 return Type.DIVERGING; 5603 } 5604 5605 @Override 5606 public Mode mode() { 5607 return Mode.DISCRETE; 5608 } 5609 }, 5610 5611 /** 5612 * ColorBrewer "RdBu" colour map with 7 colours. See <a 5613 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5614 * information. 5615 */ 5616 RdBu7 { 5617 private final float[][] cols = { { 178f / 265f, 24f / 265f, 43f / 265f }, 5618 { 239f / 265f, 138f / 265f, 98f / 265f }, { 253f / 265f, 219f / 265f, 199f / 265f }, 5619 { 247f / 265f, 247f / 265f, 247f / 265f }, { 209f / 265f, 229f / 265f, 240f / 265f }, 5620 { 103f / 265f, 169f / 265f, 207f / 265f }, { 33f / 265f, 102f / 265f, 172f / 265f } }; 5621 5622 @Override 5623 public void apply(float x, float[] out) { 5624 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5625 5626 final float[] col = cols[i]; 5627 5628 out[0] = col[0]; 5629 out[1] = col[1]; 5630 out[2] = col[2]; 5631 } 5632 5633 @Override 5634 public Type type() { 5635 return Type.DIVERGING; 5636 } 5637 5638 @Override 5639 public Mode mode() { 5640 return Mode.DISCRETE; 5641 } 5642 }, 5643 5644 /** 5645 * ColorBrewer "RdBu" colour map with 8 colours. See <a 5646 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5647 * information. 5648 */ 5649 RdBu8 { 5650 private final float[][] cols = { { 178f / 265f, 24f / 265f, 43f / 265f }, 5651 { 214f / 265f, 96f / 265f, 77f / 265f }, { 244f / 265f, 165f / 265f, 130f / 265f }, 5652 { 253f / 265f, 219f / 265f, 199f / 265f }, { 209f / 265f, 229f / 265f, 240f / 265f }, 5653 { 146f / 265f, 197f / 265f, 222f / 265f }, { 67f / 265f, 147f / 265f, 195f / 265f }, 5654 { 33f / 265f, 102f / 265f, 172f / 265f } }; 5655 5656 @Override 5657 public void apply(float x, float[] out) { 5658 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5659 5660 final float[] col = cols[i]; 5661 5662 out[0] = col[0]; 5663 out[1] = col[1]; 5664 out[2] = col[2]; 5665 } 5666 5667 @Override 5668 public Type type() { 5669 return Type.DIVERGING; 5670 } 5671 5672 @Override 5673 public Mode mode() { 5674 return Mode.DISCRETE; 5675 } 5676 }, 5677 5678 /** 5679 * ColorBrewer "RdBu" colour map with 9 colours. See <a 5680 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5681 * information. 5682 */ 5683 RdBu9 { 5684 private final float[][] cols = { { 178f / 265f, 24f / 265f, 43f / 265f }, 5685 { 214f / 265f, 96f / 265f, 77f / 265f }, { 244f / 265f, 165f / 265f, 130f / 265f }, 5686 { 253f / 265f, 219f / 265f, 199f / 265f }, { 247f / 265f, 247f / 265f, 247f / 265f }, 5687 { 209f / 265f, 229f / 265f, 240f / 265f }, { 146f / 265f, 197f / 265f, 222f / 265f }, 5688 { 67f / 265f, 147f / 265f, 195f / 265f }, { 33f / 265f, 102f / 265f, 172f / 265f } }; 5689 5690 @Override 5691 public void apply(float x, float[] out) { 5692 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5693 5694 final float[] col = cols[i]; 5695 5696 out[0] = col[0]; 5697 out[1] = col[1]; 5698 out[2] = col[2]; 5699 } 5700 5701 @Override 5702 public Type type() { 5703 return Type.DIVERGING; 5704 } 5705 5706 @Override 5707 public Mode mode() { 5708 return Mode.DISCRETE; 5709 } 5710 }, 5711 5712 /** 5713 * ColorBrewer "RdBu" colour map with 10 colours. See <a 5714 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5715 * information. 5716 */ 5717 RdBu10 { 5718 private final float[][] cols = { { 103f / 265f, 0f / 265f, 31f / 265f }, { 178f / 265f, 24f / 265f, 43f / 265f }, 5719 { 214f / 265f, 96f / 265f, 77f / 265f }, { 244f / 265f, 165f / 265f, 130f / 265f }, 5720 { 253f / 265f, 219f / 265f, 199f / 265f }, { 209f / 265f, 229f / 265f, 240f / 265f }, 5721 { 146f / 265f, 197f / 265f, 222f / 265f }, { 67f / 265f, 147f / 265f, 195f / 265f }, 5722 { 33f / 265f, 102f / 265f, 172f / 265f }, { 5f / 265f, 48f / 265f, 97f / 265f } }; 5723 5724 @Override 5725 public void apply(float x, float[] out) { 5726 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5727 5728 final float[] col = cols[i]; 5729 5730 out[0] = col[0]; 5731 out[1] = col[1]; 5732 out[2] = col[2]; 5733 } 5734 5735 @Override 5736 public Type type() { 5737 return Type.DIVERGING; 5738 } 5739 5740 @Override 5741 public Mode mode() { 5742 return Mode.DISCRETE; 5743 } 5744 }, 5745 5746 /** 5747 * ColorBrewer "RdBu" colour map with 11 colours. See <a 5748 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5749 * information. 5750 */ 5751 RdBu11 { 5752 private final float[][] cols = { { 103f / 265f, 0f / 265f, 31f / 265f }, { 178f / 265f, 24f / 265f, 43f / 265f }, 5753 { 214f / 265f, 96f / 265f, 77f / 265f }, { 244f / 265f, 165f / 265f, 130f / 265f }, 5754 { 253f / 265f, 219f / 265f, 199f / 265f }, { 247f / 265f, 247f / 265f, 247f / 265f }, 5755 { 209f / 265f, 229f / 265f, 240f / 265f }, { 146f / 265f, 197f / 265f, 222f / 265f }, 5756 { 67f / 265f, 147f / 265f, 195f / 265f }, { 33f / 265f, 102f / 265f, 172f / 265f }, 5757 { 5f / 265f, 48f / 265f, 97f / 265f } }; 5758 5759 @Override 5760 public void apply(float x, float[] out) { 5761 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5762 5763 final float[] col = cols[i]; 5764 5765 out[0] = col[0]; 5766 out[1] = col[1]; 5767 out[2] = col[2]; 5768 } 5769 5770 @Override 5771 public Type type() { 5772 return Type.DIVERGING; 5773 } 5774 5775 @Override 5776 public Mode mode() { 5777 return Mode.DISCRETE; 5778 } 5779 }, 5780 5781 /** 5782 * ColorBrewer "RdGy" colour map with 3 colours. See <a 5783 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5784 * information. 5785 */ 5786 RdGy3 { 5787 private final float[][] cols = { { 239f / 265f, 138f / 265f, 98f / 265f }, 5788 { 255f / 265f, 255f / 265f, 255f / 265f }, { 153f / 265f, 153f / 265f, 153f / 265f } }; 5789 5790 @Override 5791 public void apply(float x, float[] out) { 5792 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5793 5794 final float[] col = cols[i]; 5795 5796 out[0] = col[0]; 5797 out[1] = col[1]; 5798 out[2] = col[2]; 5799 } 5800 5801 @Override 5802 public Type type() { 5803 return Type.DIVERGING; 5804 } 5805 5806 @Override 5807 public Mode mode() { 5808 return Mode.DISCRETE; 5809 } 5810 }, 5811 5812 /** 5813 * ColorBrewer "RdGy" colour map with 4 colours. See <a 5814 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5815 * information. 5816 */ 5817 RdGy4 { 5818 private final float[][] cols = { { 202f / 265f, 0f / 265f, 32f / 265f }, 5819 { 244f / 265f, 165f / 265f, 130f / 265f }, { 186f / 265f, 186f / 265f, 186f / 265f }, 5820 { 64f / 265f, 64f / 265f, 64f / 265f } }; 5821 5822 @Override 5823 public void apply(float x, float[] out) { 5824 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5825 5826 final float[] col = cols[i]; 5827 5828 out[0] = col[0]; 5829 out[1] = col[1]; 5830 out[2] = col[2]; 5831 } 5832 5833 @Override 5834 public Type type() { 5835 return Type.DIVERGING; 5836 } 5837 5838 @Override 5839 public Mode mode() { 5840 return Mode.DISCRETE; 5841 } 5842 }, 5843 5844 /** 5845 * ColorBrewer "RdGy" colour map with 5 colours. See <a 5846 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5847 * information. 5848 */ 5849 RdGy5 { 5850 private final float[][] cols = { { 202f / 265f, 0f / 265f, 32f / 265f }, 5851 { 244f / 265f, 165f / 265f, 130f / 265f }, { 255f / 265f, 255f / 265f, 255f / 265f }, 5852 { 186f / 265f, 186f / 265f, 186f / 265f }, { 64f / 265f, 64f / 265f, 64f / 265f } }; 5853 5854 @Override 5855 public void apply(float x, float[] out) { 5856 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5857 5858 final float[] col = cols[i]; 5859 5860 out[0] = col[0]; 5861 out[1] = col[1]; 5862 out[2] = col[2]; 5863 } 5864 5865 @Override 5866 public Type type() { 5867 return Type.DIVERGING; 5868 } 5869 5870 @Override 5871 public Mode mode() { 5872 return Mode.DISCRETE; 5873 } 5874 }, 5875 5876 /** 5877 * ColorBrewer "RdGy" colour map with 6 colours. See <a 5878 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5879 * information. 5880 */ 5881 RdGy6 { 5882 private final float[][] cols = { { 178f / 265f, 24f / 265f, 43f / 265f }, 5883 { 239f / 265f, 138f / 265f, 98f / 265f }, { 253f / 265f, 219f / 265f, 199f / 265f }, 5884 { 224f / 265f, 224f / 265f, 224f / 265f }, { 153f / 265f, 153f / 265f, 153f / 265f }, 5885 { 77f / 265f, 77f / 265f, 77f / 265f } }; 5886 5887 @Override 5888 public void apply(float x, float[] out) { 5889 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5890 5891 final float[] col = cols[i]; 5892 5893 out[0] = col[0]; 5894 out[1] = col[1]; 5895 out[2] = col[2]; 5896 } 5897 5898 @Override 5899 public Type type() { 5900 return Type.DIVERGING; 5901 } 5902 5903 @Override 5904 public Mode mode() { 5905 return Mode.DISCRETE; 5906 } 5907 }, 5908 5909 /** 5910 * ColorBrewer "RdGy" colour map with 7 colours. See <a 5911 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5912 * information. 5913 */ 5914 RdGy7 { 5915 private final float[][] cols = { { 178f / 265f, 24f / 265f, 43f / 265f }, 5916 { 239f / 265f, 138f / 265f, 98f / 265f }, { 253f / 265f, 219f / 265f, 199f / 265f }, 5917 { 255f / 265f, 255f / 265f, 255f / 265f }, { 224f / 265f, 224f / 265f, 224f / 265f }, 5918 { 153f / 265f, 153f / 265f, 153f / 265f }, { 77f / 265f, 77f / 265f, 77f / 265f } }; 5919 5920 @Override 5921 public void apply(float x, float[] out) { 5922 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5923 5924 final float[] col = cols[i]; 5925 5926 out[0] = col[0]; 5927 out[1] = col[1]; 5928 out[2] = col[2]; 5929 } 5930 5931 @Override 5932 public Type type() { 5933 return Type.DIVERGING; 5934 } 5935 5936 @Override 5937 public Mode mode() { 5938 return Mode.DISCRETE; 5939 } 5940 }, 5941 5942 /** 5943 * ColorBrewer "RdGy" colour map with 8 colours. See <a 5944 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5945 * information. 5946 */ 5947 RdGy8 { 5948 private final float[][] cols = { { 178f / 265f, 24f / 265f, 43f / 265f }, 5949 { 214f / 265f, 96f / 265f, 77f / 265f }, { 244f / 265f, 165f / 265f, 130f / 265f }, 5950 { 253f / 265f, 219f / 265f, 199f / 265f }, { 224f / 265f, 224f / 265f, 224f / 265f }, 5951 { 186f / 265f, 186f / 265f, 186f / 265f }, { 135f / 265f, 135f / 265f, 135f / 265f }, 5952 { 77f / 265f, 77f / 265f, 77f / 265f } }; 5953 5954 @Override 5955 public void apply(float x, float[] out) { 5956 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5957 5958 final float[] col = cols[i]; 5959 5960 out[0] = col[0]; 5961 out[1] = col[1]; 5962 out[2] = col[2]; 5963 } 5964 5965 @Override 5966 public Type type() { 5967 return Type.DIVERGING; 5968 } 5969 5970 @Override 5971 public Mode mode() { 5972 return Mode.DISCRETE; 5973 } 5974 }, 5975 5976 /** 5977 * ColorBrewer "RdGy" colour map with 9 colours. See <a 5978 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 5979 * information. 5980 */ 5981 RdGy9 { 5982 private final float[][] cols = { { 178f / 265f, 24f / 265f, 43f / 265f }, 5983 { 214f / 265f, 96f / 265f, 77f / 265f }, { 244f / 265f, 165f / 265f, 130f / 265f }, 5984 { 253f / 265f, 219f / 265f, 199f / 265f }, { 255f / 265f, 255f / 265f, 255f / 265f }, 5985 { 224f / 265f, 224f / 265f, 224f / 265f }, { 186f / 265f, 186f / 265f, 186f / 265f }, 5986 { 135f / 265f, 135f / 265f, 135f / 265f }, { 77f / 265f, 77f / 265f, 77f / 265f } }; 5987 5988 @Override 5989 public void apply(float x, float[] out) { 5990 final int i = Math.min((int) (x * cols.length), cols.length - 1); 5991 5992 final float[] col = cols[i]; 5993 5994 out[0] = col[0]; 5995 out[1] = col[1]; 5996 out[2] = col[2]; 5997 } 5998 5999 @Override 6000 public Type type() { 6001 return Type.DIVERGING; 6002 } 6003 6004 @Override 6005 public Mode mode() { 6006 return Mode.DISCRETE; 6007 } 6008 }, 6009 6010 /** 6011 * ColorBrewer "RdGy" colour map with 10 colours. See <a 6012 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6013 * information. 6014 */ 6015 RdGy10 { 6016 private final float[][] cols = { { 103f / 265f, 0f / 265f, 31f / 265f }, { 178f / 265f, 24f / 265f, 43f / 265f }, 6017 { 214f / 265f, 96f / 265f, 77f / 265f }, { 244f / 265f, 165f / 265f, 130f / 265f }, 6018 { 253f / 265f, 219f / 265f, 199f / 265f }, { 224f / 265f, 224f / 265f, 224f / 265f }, 6019 { 186f / 265f, 186f / 265f, 186f / 265f }, { 135f / 265f, 135f / 265f, 135f / 265f }, 6020 { 77f / 265f, 77f / 265f, 77f / 265f }, { 26f / 265f, 26f / 265f, 26f / 265f } }; 6021 6022 @Override 6023 public void apply(float x, float[] out) { 6024 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6025 6026 final float[] col = cols[i]; 6027 6028 out[0] = col[0]; 6029 out[1] = col[1]; 6030 out[2] = col[2]; 6031 } 6032 6033 @Override 6034 public Type type() { 6035 return Type.DIVERGING; 6036 } 6037 6038 @Override 6039 public Mode mode() { 6040 return Mode.DISCRETE; 6041 } 6042 }, 6043 6044 /** 6045 * ColorBrewer "RdGy" colour map with 11 colours. See <a 6046 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6047 * information. 6048 */ 6049 RdGy11 { 6050 private final float[][] cols = { { 103f / 265f, 0f / 265f, 31f / 265f }, { 178f / 265f, 24f / 265f, 43f / 265f }, 6051 { 214f / 265f, 96f / 265f, 77f / 265f }, { 244f / 265f, 165f / 265f, 130f / 265f }, 6052 { 253f / 265f, 219f / 265f, 199f / 265f }, { 255f / 265f, 255f / 265f, 255f / 265f }, 6053 { 224f / 265f, 224f / 265f, 224f / 265f }, { 186f / 265f, 186f / 265f, 186f / 265f }, 6054 { 135f / 265f, 135f / 265f, 135f / 265f }, { 77f / 265f, 77f / 265f, 77f / 265f }, 6055 { 26f / 265f, 26f / 265f, 26f / 265f } }; 6056 6057 @Override 6058 public void apply(float x, float[] out) { 6059 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6060 6061 final float[] col = cols[i]; 6062 6063 out[0] = col[0]; 6064 out[1] = col[1]; 6065 out[2] = col[2]; 6066 } 6067 6068 @Override 6069 public Type type() { 6070 return Type.DIVERGING; 6071 } 6072 6073 @Override 6074 public Mode mode() { 6075 return Mode.DISCRETE; 6076 } 6077 }, 6078 6079 /** 6080 * ColorBrewer "RdPu" colour map with 3 colours. See <a 6081 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6082 * information. 6083 */ 6084 RdPu3 { 6085 private final float[][] cols = { { 253f / 265f, 224f / 265f, 221f / 265f }, 6086 { 250f / 265f, 159f / 265f, 181f / 265f }, { 197f / 265f, 27f / 265f, 138f / 265f } }; 6087 6088 @Override 6089 public void apply(float x, float[] out) { 6090 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6091 6092 final float[] col = cols[i]; 6093 6094 out[0] = col[0]; 6095 out[1] = col[1]; 6096 out[2] = col[2]; 6097 } 6098 6099 @Override 6100 public Type type() { 6101 return Type.SEQUENTIAL; 6102 } 6103 6104 @Override 6105 public Mode mode() { 6106 return Mode.DISCRETE; 6107 } 6108 }, 6109 6110 /** 6111 * ColorBrewer "RdPu" colour map with 4 colours. See <a 6112 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6113 * information. 6114 */ 6115 RdPu4 { 6116 private final float[][] cols = { { 254f / 265f, 235f / 265f, 226f / 265f }, 6117 { 251f / 265f, 180f / 265f, 185f / 265f }, { 247f / 265f, 104f / 265f, 161f / 265f }, 6118 { 174f / 265f, 1f / 265f, 126f / 265f } }; 6119 6120 @Override 6121 public void apply(float x, float[] out) { 6122 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6123 6124 final float[] col = cols[i]; 6125 6126 out[0] = col[0]; 6127 out[1] = col[1]; 6128 out[2] = col[2]; 6129 } 6130 6131 @Override 6132 public Type type() { 6133 return Type.SEQUENTIAL; 6134 } 6135 6136 @Override 6137 public Mode mode() { 6138 return Mode.DISCRETE; 6139 } 6140 }, 6141 6142 /** 6143 * ColorBrewer "RdPu" colour map with 5 colours. See <a 6144 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6145 * information. 6146 */ 6147 RdPu5 { 6148 private final float[][] cols = { { 254f / 265f, 235f / 265f, 226f / 265f }, 6149 { 251f / 265f, 180f / 265f, 185f / 265f }, { 247f / 265f, 104f / 265f, 161f / 265f }, 6150 { 197f / 265f, 27f / 265f, 138f / 265f }, { 122f / 265f, 1f / 265f, 119f / 265f } }; 6151 6152 @Override 6153 public void apply(float x, float[] out) { 6154 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6155 6156 final float[] col = cols[i]; 6157 6158 out[0] = col[0]; 6159 out[1] = col[1]; 6160 out[2] = col[2]; 6161 } 6162 6163 @Override 6164 public Type type() { 6165 return Type.SEQUENTIAL; 6166 } 6167 6168 @Override 6169 public Mode mode() { 6170 return Mode.DISCRETE; 6171 } 6172 }, 6173 6174 /** 6175 * ColorBrewer "RdPu" colour map with 6 colours. See <a 6176 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6177 * information. 6178 */ 6179 RdPu6 { 6180 private final float[][] cols = { { 254f / 265f, 235f / 265f, 226f / 265f }, 6181 { 252f / 265f, 197f / 265f, 192f / 265f }, { 250f / 265f, 159f / 265f, 181f / 265f }, 6182 { 247f / 265f, 104f / 265f, 161f / 265f }, { 197f / 265f, 27f / 265f, 138f / 265f }, 6183 { 122f / 265f, 1f / 265f, 119f / 265f } }; 6184 6185 @Override 6186 public void apply(float x, float[] out) { 6187 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6188 6189 final float[] col = cols[i]; 6190 6191 out[0] = col[0]; 6192 out[1] = col[1]; 6193 out[2] = col[2]; 6194 } 6195 6196 @Override 6197 public Type type() { 6198 return Type.SEQUENTIAL; 6199 } 6200 6201 @Override 6202 public Mode mode() { 6203 return Mode.DISCRETE; 6204 } 6205 }, 6206 6207 /** 6208 * ColorBrewer "RdPu" colour map with 7 colours. See <a 6209 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6210 * information. 6211 */ 6212 RdPu7 { 6213 private final float[][] cols = { { 254f / 265f, 235f / 265f, 226f / 265f }, 6214 { 252f / 265f, 197f / 265f, 192f / 265f }, { 250f / 265f, 159f / 265f, 181f / 265f }, 6215 { 247f / 265f, 104f / 265f, 161f / 265f }, { 221f / 265f, 52f / 265f, 151f / 265f }, 6216 { 174f / 265f, 1f / 265f, 126f / 265f }, { 122f / 265f, 1f / 265f, 119f / 265f } }; 6217 6218 @Override 6219 public void apply(float x, float[] out) { 6220 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6221 6222 final float[] col = cols[i]; 6223 6224 out[0] = col[0]; 6225 out[1] = col[1]; 6226 out[2] = col[2]; 6227 } 6228 6229 @Override 6230 public Type type() { 6231 return Type.SEQUENTIAL; 6232 } 6233 6234 @Override 6235 public Mode mode() { 6236 return Mode.DISCRETE; 6237 } 6238 }, 6239 6240 /** 6241 * ColorBrewer "RdPu" colour map with 8 colours. See <a 6242 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6243 * information. 6244 */ 6245 RdPu8 { 6246 private final float[][] cols = { { 255f / 265f, 247f / 265f, 243f / 265f }, 6247 { 253f / 265f, 224f / 265f, 221f / 265f }, { 252f / 265f, 197f / 265f, 192f / 265f }, 6248 { 250f / 265f, 159f / 265f, 181f / 265f }, { 247f / 265f, 104f / 265f, 161f / 265f }, 6249 { 221f / 265f, 52f / 265f, 151f / 265f }, { 174f / 265f, 1f / 265f, 126f / 265f }, 6250 { 122f / 265f, 1f / 265f, 119f / 265f } }; 6251 6252 @Override 6253 public void apply(float x, float[] out) { 6254 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6255 6256 final float[] col = cols[i]; 6257 6258 out[0] = col[0]; 6259 out[1] = col[1]; 6260 out[2] = col[2]; 6261 } 6262 6263 @Override 6264 public Type type() { 6265 return Type.SEQUENTIAL; 6266 } 6267 6268 @Override 6269 public Mode mode() { 6270 return Mode.DISCRETE; 6271 } 6272 }, 6273 6274 /** 6275 * ColorBrewer "RdPu" colour map with 9 colours. See <a 6276 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6277 * information. 6278 */ 6279 RdPu9 { 6280 private final float[][] cols = { { 255f / 265f, 247f / 265f, 243f / 265f }, 6281 { 253f / 265f, 224f / 265f, 221f / 265f }, { 252f / 265f, 197f / 265f, 192f / 265f }, 6282 { 250f / 265f, 159f / 265f, 181f / 265f }, { 247f / 265f, 104f / 265f, 161f / 265f }, 6283 { 221f / 265f, 52f / 265f, 151f / 265f }, { 174f / 265f, 1f / 265f, 126f / 265f }, 6284 { 122f / 265f, 1f / 265f, 119f / 265f }, { 73f / 265f, 0f / 265f, 106f / 265f } }; 6285 6286 @Override 6287 public void apply(float x, float[] out) { 6288 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6289 6290 final float[] col = cols[i]; 6291 6292 out[0] = col[0]; 6293 out[1] = col[1]; 6294 out[2] = col[2]; 6295 } 6296 6297 @Override 6298 public Type type() { 6299 return Type.SEQUENTIAL; 6300 } 6301 6302 @Override 6303 public Mode mode() { 6304 return Mode.DISCRETE; 6305 } 6306 }, 6307 6308 /** 6309 * ColorBrewer "Reds" colour map with 3 colours. See <a 6310 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6311 * information. 6312 */ 6313 Reds3 { 6314 private final float[][] cols = { { 254f / 265f, 224f / 265f, 210f / 265f }, 6315 { 252f / 265f, 146f / 265f, 114f / 265f }, { 222f / 265f, 45f / 265f, 38f / 265f } }; 6316 6317 @Override 6318 public void apply(float x, float[] out) { 6319 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6320 6321 final float[] col = cols[i]; 6322 6323 out[0] = col[0]; 6324 out[1] = col[1]; 6325 out[2] = col[2]; 6326 } 6327 6328 @Override 6329 public Type type() { 6330 return Type.SEQUENTIAL; 6331 } 6332 6333 @Override 6334 public Mode mode() { 6335 return Mode.DISCRETE; 6336 } 6337 }, 6338 6339 /** 6340 * ColorBrewer "Reds" colour map with 4 colours. See <a 6341 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6342 * information. 6343 */ 6344 Reds4 { 6345 private final float[][] cols = { { 254f / 265f, 229f / 265f, 217f / 265f }, 6346 { 252f / 265f, 174f / 265f, 145f / 265f }, { 251f / 265f, 106f / 265f, 74f / 265f }, 6347 { 203f / 265f, 24f / 265f, 29f / 265f } }; 6348 6349 @Override 6350 public void apply(float x, float[] out) { 6351 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6352 6353 final float[] col = cols[i]; 6354 6355 out[0] = col[0]; 6356 out[1] = col[1]; 6357 out[2] = col[2]; 6358 } 6359 6360 @Override 6361 public Type type() { 6362 return Type.SEQUENTIAL; 6363 } 6364 6365 @Override 6366 public Mode mode() { 6367 return Mode.DISCRETE; 6368 } 6369 }, 6370 6371 /** 6372 * ColorBrewer "Reds" colour map with 5 colours. See <a 6373 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6374 * information. 6375 */ 6376 Reds5 { 6377 private final float[][] cols = { { 254f / 265f, 229f / 265f, 217f / 265f }, 6378 { 252f / 265f, 174f / 265f, 145f / 265f }, { 251f / 265f, 106f / 265f, 74f / 265f }, 6379 { 222f / 265f, 45f / 265f, 38f / 265f }, { 165f / 265f, 15f / 265f, 21f / 265f } }; 6380 6381 @Override 6382 public void apply(float x, float[] out) { 6383 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6384 6385 final float[] col = cols[i]; 6386 6387 out[0] = col[0]; 6388 out[1] = col[1]; 6389 out[2] = col[2]; 6390 } 6391 6392 @Override 6393 public Type type() { 6394 return Type.SEQUENTIAL; 6395 } 6396 6397 @Override 6398 public Mode mode() { 6399 return Mode.DISCRETE; 6400 } 6401 }, 6402 6403 /** 6404 * ColorBrewer "Reds" colour map with 6 colours. See <a 6405 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6406 * information. 6407 */ 6408 Reds6 { 6409 private final float[][] cols = { { 254f / 265f, 229f / 265f, 217f / 265f }, 6410 { 252f / 265f, 187f / 265f, 161f / 265f }, { 252f / 265f, 146f / 265f, 114f / 265f }, 6411 { 251f / 265f, 106f / 265f, 74f / 265f }, { 222f / 265f, 45f / 265f, 38f / 265f }, 6412 { 165f / 265f, 15f / 265f, 21f / 265f } }; 6413 6414 @Override 6415 public void apply(float x, float[] out) { 6416 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6417 6418 final float[] col = cols[i]; 6419 6420 out[0] = col[0]; 6421 out[1] = col[1]; 6422 out[2] = col[2]; 6423 } 6424 6425 @Override 6426 public Type type() { 6427 return Type.SEQUENTIAL; 6428 } 6429 6430 @Override 6431 public Mode mode() { 6432 return Mode.DISCRETE; 6433 } 6434 }, 6435 6436 /** 6437 * ColorBrewer "Reds" colour map with 7 colours. See <a 6438 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6439 * information. 6440 */ 6441 Reds7 { 6442 private final float[][] cols = { { 254f / 265f, 229f / 265f, 217f / 265f }, 6443 { 252f / 265f, 187f / 265f, 161f / 265f }, { 252f / 265f, 146f / 265f, 114f / 265f }, 6444 { 251f / 265f, 106f / 265f, 74f / 265f }, { 239f / 265f, 59f / 265f, 44f / 265f }, 6445 { 203f / 265f, 24f / 265f, 29f / 265f }, { 153f / 265f, 0f / 265f, 13f / 265f } }; 6446 6447 @Override 6448 public void apply(float x, float[] out) { 6449 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6450 6451 final float[] col = cols[i]; 6452 6453 out[0] = col[0]; 6454 out[1] = col[1]; 6455 out[2] = col[2]; 6456 } 6457 6458 @Override 6459 public Type type() { 6460 return Type.SEQUENTIAL; 6461 } 6462 6463 @Override 6464 public Mode mode() { 6465 return Mode.DISCRETE; 6466 } 6467 }, 6468 6469 /** 6470 * ColorBrewer "Reds" colour map with 8 colours. See <a 6471 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6472 * information. 6473 */ 6474 Reds8 { 6475 private final float[][] cols = { { 255f / 265f, 245f / 265f, 240f / 265f }, 6476 { 254f / 265f, 224f / 265f, 210f / 265f }, { 252f / 265f, 187f / 265f, 161f / 265f }, 6477 { 252f / 265f, 146f / 265f, 114f / 265f }, { 251f / 265f, 106f / 265f, 74f / 265f }, 6478 { 239f / 265f, 59f / 265f, 44f / 265f }, { 203f / 265f, 24f / 265f, 29f / 265f }, 6479 { 153f / 265f, 0f / 265f, 13f / 265f } }; 6480 6481 @Override 6482 public void apply(float x, float[] out) { 6483 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6484 6485 final float[] col = cols[i]; 6486 6487 out[0] = col[0]; 6488 out[1] = col[1]; 6489 out[2] = col[2]; 6490 } 6491 6492 @Override 6493 public Type type() { 6494 return Type.SEQUENTIAL; 6495 } 6496 6497 @Override 6498 public Mode mode() { 6499 return Mode.DISCRETE; 6500 } 6501 }, 6502 6503 /** 6504 * ColorBrewer "Reds" colour map with 9 colours. See <a 6505 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6506 * information. 6507 */ 6508 Reds9 { 6509 private final float[][] cols = { { 255f / 265f, 245f / 265f, 240f / 265f }, 6510 { 254f / 265f, 224f / 265f, 210f / 265f }, { 252f / 265f, 187f / 265f, 161f / 265f }, 6511 { 252f / 265f, 146f / 265f, 114f / 265f }, { 251f / 265f, 106f / 265f, 74f / 265f }, 6512 { 239f / 265f, 59f / 265f, 44f / 265f }, { 203f / 265f, 24f / 265f, 29f / 265f }, 6513 { 165f / 265f, 15f / 265f, 21f / 265f }, { 103f / 265f, 0f / 265f, 13f / 265f } }; 6514 6515 @Override 6516 public void apply(float x, float[] out) { 6517 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6518 6519 final float[] col = cols[i]; 6520 6521 out[0] = col[0]; 6522 out[1] = col[1]; 6523 out[2] = col[2]; 6524 } 6525 6526 @Override 6527 public Type type() { 6528 return Type.SEQUENTIAL; 6529 } 6530 6531 @Override 6532 public Mode mode() { 6533 return Mode.DISCRETE; 6534 } 6535 }, 6536 6537 /** 6538 * ColorBrewer "RdYlBu" colour map with 3 colours. See <a 6539 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6540 * information. 6541 */ 6542 RdYlBu3 { 6543 private final float[][] cols = { { 252f / 265f, 141f / 265f, 89f / 265f }, 6544 { 255f / 265f, 255f / 265f, 191f / 265f }, { 145f / 265f, 191f / 265f, 219f / 265f } }; 6545 6546 @Override 6547 public void apply(float x, float[] out) { 6548 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6549 6550 final float[] col = cols[i]; 6551 6552 out[0] = col[0]; 6553 out[1] = col[1]; 6554 out[2] = col[2]; 6555 } 6556 6557 @Override 6558 public Type type() { 6559 return Type.DIVERGING; 6560 } 6561 6562 @Override 6563 public Mode mode() { 6564 return Mode.DISCRETE; 6565 } 6566 }, 6567 6568 /** 6569 * ColorBrewer "RdYlBu" colour map with 4 colours. See <a 6570 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6571 * information. 6572 */ 6573 RdYlBu4 { 6574 private final float[][] cols = { { 215f / 265f, 25f / 265f, 28f / 265f }, 6575 { 253f / 265f, 174f / 265f, 97f / 265f }, { 171f / 265f, 217f / 265f, 233f / 265f }, 6576 { 44f / 265f, 123f / 265f, 182f / 265f } }; 6577 6578 @Override 6579 public void apply(float x, float[] out) { 6580 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6581 6582 final float[] col = cols[i]; 6583 6584 out[0] = col[0]; 6585 out[1] = col[1]; 6586 out[2] = col[2]; 6587 } 6588 6589 @Override 6590 public Type type() { 6591 return Type.DIVERGING; 6592 } 6593 6594 @Override 6595 public Mode mode() { 6596 return Mode.DISCRETE; 6597 } 6598 }, 6599 6600 /** 6601 * ColorBrewer "RdYlBu" colour map with 5 colours. See <a 6602 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6603 * information. 6604 */ 6605 RdYlBu5 { 6606 private final float[][] cols = { { 215f / 265f, 25f / 265f, 28f / 265f }, 6607 { 253f / 265f, 174f / 265f, 97f / 265f }, { 255f / 265f, 255f / 265f, 191f / 265f }, 6608 { 171f / 265f, 217f / 265f, 233f / 265f }, { 44f / 265f, 123f / 265f, 182f / 265f } }; 6609 6610 @Override 6611 public void apply(float x, float[] out) { 6612 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6613 6614 final float[] col = cols[i]; 6615 6616 out[0] = col[0]; 6617 out[1] = col[1]; 6618 out[2] = col[2]; 6619 } 6620 6621 @Override 6622 public Type type() { 6623 return Type.DIVERGING; 6624 } 6625 6626 @Override 6627 public Mode mode() { 6628 return Mode.DISCRETE; 6629 } 6630 }, 6631 6632 /** 6633 * ColorBrewer "RdYlBu" colour map with 6 colours. See <a 6634 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6635 * information. 6636 */ 6637 RdYlBu6 { 6638 private final float[][] cols = { { 215f / 265f, 48f / 265f, 39f / 265f }, 6639 { 252f / 265f, 141f / 265f, 89f / 265f }, { 254f / 265f, 224f / 265f, 144f / 265f }, 6640 { 224f / 265f, 243f / 265f, 248f / 265f }, { 145f / 265f, 191f / 265f, 219f / 265f }, 6641 { 69f / 265f, 117f / 265f, 180f / 265f } }; 6642 6643 @Override 6644 public void apply(float x, float[] out) { 6645 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6646 6647 final float[] col = cols[i]; 6648 6649 out[0] = col[0]; 6650 out[1] = col[1]; 6651 out[2] = col[2]; 6652 } 6653 6654 @Override 6655 public Type type() { 6656 return Type.DIVERGING; 6657 } 6658 6659 @Override 6660 public Mode mode() { 6661 return Mode.DISCRETE; 6662 } 6663 }, 6664 6665 /** 6666 * ColorBrewer "RdYlBu" colour map with 7 colours. See <a 6667 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6668 * information. 6669 */ 6670 RdYlBu7 { 6671 private final float[][] cols = { { 215f / 265f, 48f / 265f, 39f / 265f }, 6672 { 252f / 265f, 141f / 265f, 89f / 265f }, { 254f / 265f, 224f / 265f, 144f / 265f }, 6673 { 255f / 265f, 255f / 265f, 191f / 265f }, { 224f / 265f, 243f / 265f, 248f / 265f }, 6674 { 145f / 265f, 191f / 265f, 219f / 265f }, { 69f / 265f, 117f / 265f, 180f / 265f } }; 6675 6676 @Override 6677 public void apply(float x, float[] out) { 6678 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6679 6680 final float[] col = cols[i]; 6681 6682 out[0] = col[0]; 6683 out[1] = col[1]; 6684 out[2] = col[2]; 6685 } 6686 6687 @Override 6688 public Type type() { 6689 return Type.DIVERGING; 6690 } 6691 6692 @Override 6693 public Mode mode() { 6694 return Mode.DISCRETE; 6695 } 6696 }, 6697 6698 /** 6699 * ColorBrewer "RdYlBu" colour map with 8 colours. See <a 6700 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6701 * information. 6702 */ 6703 RdYlBu8 { 6704 private final float[][] cols = { { 215f / 265f, 48f / 265f, 39f / 265f }, 6705 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 6706 { 254f / 265f, 224f / 265f, 144f / 265f }, { 224f / 265f, 243f / 265f, 248f / 265f }, 6707 { 171f / 265f, 217f / 265f, 233f / 265f }, { 116f / 265f, 173f / 265f, 209f / 265f }, 6708 { 69f / 265f, 117f / 265f, 180f / 265f } }; 6709 6710 @Override 6711 public void apply(float x, float[] out) { 6712 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6713 6714 final float[] col = cols[i]; 6715 6716 out[0] = col[0]; 6717 out[1] = col[1]; 6718 out[2] = col[2]; 6719 } 6720 6721 @Override 6722 public Type type() { 6723 return Type.DIVERGING; 6724 } 6725 6726 @Override 6727 public Mode mode() { 6728 return Mode.DISCRETE; 6729 } 6730 }, 6731 6732 /** 6733 * ColorBrewer "RdYlBu" colour map with 9 colours. See <a 6734 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6735 * information. 6736 */ 6737 RdYlBu9 { 6738 private final float[][] cols = { { 215f / 265f, 48f / 265f, 39f / 265f }, 6739 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 6740 { 254f / 265f, 224f / 265f, 144f / 265f }, { 255f / 265f, 255f / 265f, 191f / 265f }, 6741 { 224f / 265f, 243f / 265f, 248f / 265f }, { 171f / 265f, 217f / 265f, 233f / 265f }, 6742 { 116f / 265f, 173f / 265f, 209f / 265f }, { 69f / 265f, 117f / 265f, 180f / 265f } }; 6743 6744 @Override 6745 public void apply(float x, float[] out) { 6746 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6747 6748 final float[] col = cols[i]; 6749 6750 out[0] = col[0]; 6751 out[1] = col[1]; 6752 out[2] = col[2]; 6753 } 6754 6755 @Override 6756 public Type type() { 6757 return Type.DIVERGING; 6758 } 6759 6760 @Override 6761 public Mode mode() { 6762 return Mode.DISCRETE; 6763 } 6764 }, 6765 6766 /** 6767 * ColorBrewer "RdYlBu" colour map with 10 colours. See <a 6768 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6769 * information. 6770 */ 6771 RdYlBu10 { 6772 private final float[][] cols = { { 165f / 265f, 0f / 265f, 38f / 265f }, { 215f / 265f, 48f / 265f, 39f / 265f }, 6773 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 6774 { 254f / 265f, 224f / 265f, 144f / 265f }, { 224f / 265f, 243f / 265f, 248f / 265f }, 6775 { 171f / 265f, 217f / 265f, 233f / 265f }, { 116f / 265f, 173f / 265f, 209f / 265f }, 6776 { 69f / 265f, 117f / 265f, 180f / 265f }, { 49f / 265f, 54f / 265f, 149f / 265f } }; 6777 6778 @Override 6779 public void apply(float x, float[] out) { 6780 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6781 6782 final float[] col = cols[i]; 6783 6784 out[0] = col[0]; 6785 out[1] = col[1]; 6786 out[2] = col[2]; 6787 } 6788 6789 @Override 6790 public Type type() { 6791 return Type.DIVERGING; 6792 } 6793 6794 @Override 6795 public Mode mode() { 6796 return Mode.DISCRETE; 6797 } 6798 }, 6799 6800 /** 6801 * ColorBrewer "RdYlBu" colour map with 11 colours. See <a 6802 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6803 * information. 6804 */ 6805 RdYlBu11 { 6806 private final float[][] cols = { { 165f / 265f, 0f / 265f, 38f / 265f }, { 215f / 265f, 48f / 265f, 39f / 265f }, 6807 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 6808 { 254f / 265f, 224f / 265f, 144f / 265f }, { 255f / 265f, 255f / 265f, 191f / 265f }, 6809 { 224f / 265f, 243f / 265f, 248f / 265f }, { 171f / 265f, 217f / 265f, 233f / 265f }, 6810 { 116f / 265f, 173f / 265f, 209f / 265f }, { 69f / 265f, 117f / 265f, 180f / 265f }, 6811 { 49f / 265f, 54f / 265f, 149f / 265f } }; 6812 6813 @Override 6814 public void apply(float x, float[] out) { 6815 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6816 6817 final float[] col = cols[i]; 6818 6819 out[0] = col[0]; 6820 out[1] = col[1]; 6821 out[2] = col[2]; 6822 } 6823 6824 @Override 6825 public Type type() { 6826 return Type.DIVERGING; 6827 } 6828 6829 @Override 6830 public Mode mode() { 6831 return Mode.DISCRETE; 6832 } 6833 }, 6834 6835 /** 6836 * ColorBrewer "RdYlGn" colour map with 3 colours. See <a 6837 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6838 * information. 6839 */ 6840 RdYlGn3 { 6841 private final float[][] cols = { { 252f / 265f, 141f / 265f, 89f / 265f }, 6842 { 255f / 265f, 255f / 265f, 191f / 265f }, { 145f / 265f, 207f / 265f, 96f / 265f } }; 6843 6844 @Override 6845 public void apply(float x, float[] out) { 6846 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6847 6848 final float[] col = cols[i]; 6849 6850 out[0] = col[0]; 6851 out[1] = col[1]; 6852 out[2] = col[2]; 6853 } 6854 6855 @Override 6856 public Type type() { 6857 return Type.DIVERGING; 6858 } 6859 6860 @Override 6861 public Mode mode() { 6862 return Mode.DISCRETE; 6863 } 6864 }, 6865 6866 /** 6867 * ColorBrewer "RdYlGn" colour map with 4 colours. See <a 6868 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6869 * information. 6870 */ 6871 RdYlGn4 { 6872 private final float[][] cols = { { 215f / 265f, 25f / 265f, 28f / 265f }, 6873 { 253f / 265f, 174f / 265f, 97f / 265f }, { 166f / 265f, 217f / 265f, 106f / 265f }, 6874 { 26f / 265f, 150f / 265f, 65f / 265f } }; 6875 6876 @Override 6877 public void apply(float x, float[] out) { 6878 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6879 6880 final float[] col = cols[i]; 6881 6882 out[0] = col[0]; 6883 out[1] = col[1]; 6884 out[2] = col[2]; 6885 } 6886 6887 @Override 6888 public Type type() { 6889 return Type.DIVERGING; 6890 } 6891 6892 @Override 6893 public Mode mode() { 6894 return Mode.DISCRETE; 6895 } 6896 }, 6897 6898 /** 6899 * ColorBrewer "RdYlGn" colour map with 5 colours. See <a 6900 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6901 * information. 6902 */ 6903 RdYlGn5 { 6904 private final float[][] cols = { { 215f / 265f, 25f / 265f, 28f / 265f }, 6905 { 253f / 265f, 174f / 265f, 97f / 265f }, { 255f / 265f, 255f / 265f, 191f / 265f }, 6906 { 166f / 265f, 217f / 265f, 106f / 265f }, { 26f / 265f, 150f / 265f, 65f / 265f } }; 6907 6908 @Override 6909 public void apply(float x, float[] out) { 6910 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6911 6912 final float[] col = cols[i]; 6913 6914 out[0] = col[0]; 6915 out[1] = col[1]; 6916 out[2] = col[2]; 6917 } 6918 6919 @Override 6920 public Type type() { 6921 return Type.DIVERGING; 6922 } 6923 6924 @Override 6925 public Mode mode() { 6926 return Mode.DISCRETE; 6927 } 6928 }, 6929 6930 /** 6931 * ColorBrewer "RdYlGn" colour map with 6 colours. See <a 6932 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6933 * information. 6934 */ 6935 RdYlGn6 { 6936 private final float[][] cols = { { 215f / 265f, 48f / 265f, 39f / 265f }, 6937 { 252f / 265f, 141f / 265f, 89f / 265f }, { 254f / 265f, 224f / 265f, 139f / 265f }, 6938 { 217f / 265f, 239f / 265f, 139f / 265f }, { 145f / 265f, 207f / 265f, 96f / 265f }, 6939 { 26f / 265f, 152f / 265f, 80f / 265f } }; 6940 6941 @Override 6942 public void apply(float x, float[] out) { 6943 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6944 6945 final float[] col = cols[i]; 6946 6947 out[0] = col[0]; 6948 out[1] = col[1]; 6949 out[2] = col[2]; 6950 } 6951 6952 @Override 6953 public Type type() { 6954 return Type.DIVERGING; 6955 } 6956 6957 @Override 6958 public Mode mode() { 6959 return Mode.DISCRETE; 6960 } 6961 }, 6962 6963 /** 6964 * ColorBrewer "RdYlGn" colour map with 7 colours. See <a 6965 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6966 * information. 6967 */ 6968 RdYlGn7 { 6969 private final float[][] cols = { { 215f / 265f, 48f / 265f, 39f / 265f }, 6970 { 252f / 265f, 141f / 265f, 89f / 265f }, { 254f / 265f, 224f / 265f, 139f / 265f }, 6971 { 255f / 265f, 255f / 265f, 191f / 265f }, { 217f / 265f, 239f / 265f, 139f / 265f }, 6972 { 145f / 265f, 207f / 265f, 96f / 265f }, { 26f / 265f, 152f / 265f, 80f / 265f } }; 6973 6974 @Override 6975 public void apply(float x, float[] out) { 6976 final int i = Math.min((int) (x * cols.length), cols.length - 1); 6977 6978 final float[] col = cols[i]; 6979 6980 out[0] = col[0]; 6981 out[1] = col[1]; 6982 out[2] = col[2]; 6983 } 6984 6985 @Override 6986 public Type type() { 6987 return Type.DIVERGING; 6988 } 6989 6990 @Override 6991 public Mode mode() { 6992 return Mode.DISCRETE; 6993 } 6994 }, 6995 6996 /** 6997 * ColorBrewer "RdYlGn" colour map with 8 colours. See <a 6998 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 6999 * information. 7000 */ 7001 RdYlGn8 { 7002 private final float[][] cols = { { 215f / 265f, 48f / 265f, 39f / 265f }, 7003 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 7004 { 254f / 265f, 224f / 265f, 139f / 265f }, { 217f / 265f, 239f / 265f, 139f / 265f }, 7005 { 166f / 265f, 217f / 265f, 106f / 265f }, { 102f / 265f, 189f / 265f, 99f / 265f }, 7006 { 26f / 265f, 152f / 265f, 80f / 265f } }; 7007 7008 @Override 7009 public void apply(float x, float[] out) { 7010 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7011 7012 final float[] col = cols[i]; 7013 7014 out[0] = col[0]; 7015 out[1] = col[1]; 7016 out[2] = col[2]; 7017 } 7018 7019 @Override 7020 public Type type() { 7021 return Type.DIVERGING; 7022 } 7023 7024 @Override 7025 public Mode mode() { 7026 return Mode.DISCRETE; 7027 } 7028 }, 7029 7030 /** 7031 * ColorBrewer "RdYlGn" colour map with 9 colours. See <a 7032 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7033 * information. 7034 */ 7035 RdYlGn9 { 7036 private final float[][] cols = { { 215f / 265f, 48f / 265f, 39f / 265f }, 7037 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 7038 { 254f / 265f, 224f / 265f, 139f / 265f }, { 255f / 265f, 255f / 265f, 191f / 265f }, 7039 { 217f / 265f, 239f / 265f, 139f / 265f }, { 166f / 265f, 217f / 265f, 106f / 265f }, 7040 { 102f / 265f, 189f / 265f, 99f / 265f }, { 26f / 265f, 152f / 265f, 80f / 265f } }; 7041 7042 @Override 7043 public void apply(float x, float[] out) { 7044 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7045 7046 final float[] col = cols[i]; 7047 7048 out[0] = col[0]; 7049 out[1] = col[1]; 7050 out[2] = col[2]; 7051 } 7052 7053 @Override 7054 public Type type() { 7055 return Type.DIVERGING; 7056 } 7057 7058 @Override 7059 public Mode mode() { 7060 return Mode.DISCRETE; 7061 } 7062 }, 7063 7064 /** 7065 * ColorBrewer "RdYlGn" colour map with 10 colours. See <a 7066 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7067 * information. 7068 */ 7069 RdYlGn10 { 7070 private final float[][] cols = { { 165f / 265f, 0f / 265f, 38f / 265f }, { 215f / 265f, 48f / 265f, 39f / 265f }, 7071 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 7072 { 254f / 265f, 224f / 265f, 139f / 265f }, { 217f / 265f, 239f / 265f, 139f / 265f }, 7073 { 166f / 265f, 217f / 265f, 106f / 265f }, { 102f / 265f, 189f / 265f, 99f / 265f }, 7074 { 26f / 265f, 152f / 265f, 80f / 265f }, { 0f / 265f, 104f / 265f, 55f / 265f } }; 7075 7076 @Override 7077 public void apply(float x, float[] out) { 7078 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7079 7080 final float[] col = cols[i]; 7081 7082 out[0] = col[0]; 7083 out[1] = col[1]; 7084 out[2] = col[2]; 7085 } 7086 7087 @Override 7088 public Type type() { 7089 return Type.DIVERGING; 7090 } 7091 7092 @Override 7093 public Mode mode() { 7094 return Mode.DISCRETE; 7095 } 7096 }, 7097 7098 /** 7099 * ColorBrewer "RdYlGn" colour map with 11 colours. See <a 7100 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7101 * information. 7102 */ 7103 RdYlGn11 { 7104 private final float[][] cols = { { 165f / 265f, 0f / 265f, 38f / 265f }, { 215f / 265f, 48f / 265f, 39f / 265f }, 7105 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 7106 { 254f / 265f, 224f / 265f, 139f / 265f }, { 255f / 265f, 255f / 265f, 191f / 265f }, 7107 { 217f / 265f, 239f / 265f, 139f / 265f }, { 166f / 265f, 217f / 265f, 106f / 265f }, 7108 { 102f / 265f, 189f / 265f, 99f / 265f }, { 26f / 265f, 152f / 265f, 80f / 265f }, 7109 { 0f / 265f, 104f / 265f, 55f / 265f } }; 7110 7111 @Override 7112 public void apply(float x, float[] out) { 7113 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7114 7115 final float[] col = cols[i]; 7116 7117 out[0] = col[0]; 7118 out[1] = col[1]; 7119 out[2] = col[2]; 7120 } 7121 7122 @Override 7123 public Type type() { 7124 return Type.DIVERGING; 7125 } 7126 7127 @Override 7128 public Mode mode() { 7129 return Mode.DISCRETE; 7130 } 7131 }, 7132 7133 /** 7134 * ColorBrewer "Set1" colour map with 3 colours. See <a 7135 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7136 * information. 7137 */ 7138 Set13 { 7139 private final float[][] cols = { { 228f / 265f, 26f / 265f, 28f / 265f }, 7140 { 55f / 265f, 126f / 265f, 184f / 265f }, { 77f / 265f, 175f / 265f, 74f / 265f } }; 7141 7142 @Override 7143 public void apply(float x, float[] out) { 7144 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7145 7146 final float[] col = cols[i]; 7147 7148 out[0] = col[0]; 7149 out[1] = col[1]; 7150 out[2] = col[2]; 7151 } 7152 7153 @Override 7154 public Type type() { 7155 return Type.QUALITATIVE; 7156 } 7157 7158 @Override 7159 public Mode mode() { 7160 return Mode.DISCRETE; 7161 } 7162 }, 7163 7164 /** 7165 * ColorBrewer "Set1" colour map with 4 colours. See <a 7166 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7167 * information. 7168 */ 7169 Set14 { 7170 private final float[][] cols = { { 228f / 265f, 26f / 265f, 28f / 265f }, 7171 { 55f / 265f, 126f / 265f, 184f / 265f }, { 77f / 265f, 175f / 265f, 74f / 265f }, 7172 { 152f / 265f, 78f / 265f, 163f / 265f } }; 7173 7174 @Override 7175 public void apply(float x, float[] out) { 7176 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7177 7178 final float[] col = cols[i]; 7179 7180 out[0] = col[0]; 7181 out[1] = col[1]; 7182 out[2] = col[2]; 7183 } 7184 7185 @Override 7186 public Type type() { 7187 return Type.QUALITATIVE; 7188 } 7189 7190 @Override 7191 public Mode mode() { 7192 return Mode.DISCRETE; 7193 } 7194 }, 7195 7196 /** 7197 * ColorBrewer "Set1" colour map with 5 colours. See <a 7198 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7199 * information. 7200 */ 7201 Set15 { 7202 private final float[][] cols = { { 228f / 265f, 26f / 265f, 28f / 265f }, 7203 { 55f / 265f, 126f / 265f, 184f / 265f }, { 77f / 265f, 175f / 265f, 74f / 265f }, 7204 { 152f / 265f, 78f / 265f, 163f / 265f }, { 255f / 265f, 127f / 265f, 0f / 265f } }; 7205 7206 @Override 7207 public void apply(float x, float[] out) { 7208 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7209 7210 final float[] col = cols[i]; 7211 7212 out[0] = col[0]; 7213 out[1] = col[1]; 7214 out[2] = col[2]; 7215 } 7216 7217 @Override 7218 public Type type() { 7219 return Type.QUALITATIVE; 7220 } 7221 7222 @Override 7223 public Mode mode() { 7224 return Mode.DISCRETE; 7225 } 7226 }, 7227 7228 /** 7229 * ColorBrewer "Set1" colour map with 6 colours. See <a 7230 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7231 * information. 7232 */ 7233 Set16 { 7234 private final float[][] cols = { { 228f / 265f, 26f / 265f, 28f / 265f }, 7235 { 55f / 265f, 126f / 265f, 184f / 265f }, { 77f / 265f, 175f / 265f, 74f / 265f }, 7236 { 152f / 265f, 78f / 265f, 163f / 265f }, { 255f / 265f, 127f / 265f, 0f / 265f }, 7237 { 255f / 265f, 255f / 265f, 51f / 265f } }; 7238 7239 @Override 7240 public void apply(float x, float[] out) { 7241 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7242 7243 final float[] col = cols[i]; 7244 7245 out[0] = col[0]; 7246 out[1] = col[1]; 7247 out[2] = col[2]; 7248 } 7249 7250 @Override 7251 public Type type() { 7252 return Type.QUALITATIVE; 7253 } 7254 7255 @Override 7256 public Mode mode() { 7257 return Mode.DISCRETE; 7258 } 7259 }, 7260 7261 /** 7262 * ColorBrewer "Set1" colour map with 7 colours. See <a 7263 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7264 * information. 7265 */ 7266 Set17 { 7267 private final float[][] cols = { { 228f / 265f, 26f / 265f, 28f / 265f }, 7268 { 55f / 265f, 126f / 265f, 184f / 265f }, { 77f / 265f, 175f / 265f, 74f / 265f }, 7269 { 152f / 265f, 78f / 265f, 163f / 265f }, { 255f / 265f, 127f / 265f, 0f / 265f }, 7270 { 255f / 265f, 255f / 265f, 51f / 265f }, { 166f / 265f, 86f / 265f, 40f / 265f } }; 7271 7272 @Override 7273 public void apply(float x, float[] out) { 7274 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7275 7276 final float[] col = cols[i]; 7277 7278 out[0] = col[0]; 7279 out[1] = col[1]; 7280 out[2] = col[2]; 7281 } 7282 7283 @Override 7284 public Type type() { 7285 return Type.QUALITATIVE; 7286 } 7287 7288 @Override 7289 public Mode mode() { 7290 return Mode.DISCRETE; 7291 } 7292 }, 7293 7294 /** 7295 * ColorBrewer "Set1" colour map with 8 colours. See <a 7296 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7297 * information. 7298 */ 7299 Set18 { 7300 private final float[][] cols = { { 228f / 265f, 26f / 265f, 28f / 265f }, 7301 { 55f / 265f, 126f / 265f, 184f / 265f }, { 77f / 265f, 175f / 265f, 74f / 265f }, 7302 { 152f / 265f, 78f / 265f, 163f / 265f }, { 255f / 265f, 127f / 265f, 0f / 265f }, 7303 { 255f / 265f, 255f / 265f, 51f / 265f }, { 166f / 265f, 86f / 265f, 40f / 265f }, 7304 { 247f / 265f, 129f / 265f, 191f / 265f } }; 7305 7306 @Override 7307 public void apply(float x, float[] out) { 7308 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7309 7310 final float[] col = cols[i]; 7311 7312 out[0] = col[0]; 7313 out[1] = col[1]; 7314 out[2] = col[2]; 7315 } 7316 7317 @Override 7318 public Type type() { 7319 return Type.QUALITATIVE; 7320 } 7321 7322 @Override 7323 public Mode mode() { 7324 return Mode.DISCRETE; 7325 } 7326 }, 7327 7328 /** 7329 * ColorBrewer "Set1" colour map with 9 colours. See <a 7330 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7331 * information. 7332 */ 7333 Set19 { 7334 private final float[][] cols = { { 228f / 265f, 26f / 265f, 28f / 265f }, 7335 { 55f / 265f, 126f / 265f, 184f / 265f }, { 77f / 265f, 175f / 265f, 74f / 265f }, 7336 { 152f / 265f, 78f / 265f, 163f / 265f }, { 255f / 265f, 127f / 265f, 0f / 265f }, 7337 { 255f / 265f, 255f / 265f, 51f / 265f }, { 166f / 265f, 86f / 265f, 40f / 265f }, 7338 { 247f / 265f, 129f / 265f, 191f / 265f }, { 153f / 265f, 153f / 265f, 153f / 265f } }; 7339 7340 @Override 7341 public void apply(float x, float[] out) { 7342 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7343 7344 final float[] col = cols[i]; 7345 7346 out[0] = col[0]; 7347 out[1] = col[1]; 7348 out[2] = col[2]; 7349 } 7350 7351 @Override 7352 public Type type() { 7353 return Type.QUALITATIVE; 7354 } 7355 7356 @Override 7357 public Mode mode() { 7358 return Mode.DISCRETE; 7359 } 7360 }, 7361 7362 /** 7363 * ColorBrewer "Set2" colour map with 3 colours. See <a 7364 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7365 * information. 7366 */ 7367 Set23 { 7368 private final float[][] cols = { { 102f / 265f, 194f / 265f, 165f / 265f }, 7369 { 252f / 265f, 141f / 265f, 98f / 265f }, { 141f / 265f, 160f / 265f, 203f / 265f } }; 7370 7371 @Override 7372 public void apply(float x, float[] out) { 7373 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7374 7375 final float[] col = cols[i]; 7376 7377 out[0] = col[0]; 7378 out[1] = col[1]; 7379 out[2] = col[2]; 7380 } 7381 7382 @Override 7383 public Type type() { 7384 return Type.QUALITATIVE; 7385 } 7386 7387 @Override 7388 public Mode mode() { 7389 return Mode.DISCRETE; 7390 } 7391 }, 7392 7393 /** 7394 * ColorBrewer "Set2" colour map with 4 colours. See <a 7395 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7396 * information. 7397 */ 7398 Set24 { 7399 private final float[][] cols = { { 102f / 265f, 194f / 265f, 165f / 265f }, 7400 { 252f / 265f, 141f / 265f, 98f / 265f }, { 141f / 265f, 160f / 265f, 203f / 265f }, 7401 { 231f / 265f, 138f / 265f, 195f / 265f } }; 7402 7403 @Override 7404 public void apply(float x, float[] out) { 7405 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7406 7407 final float[] col = cols[i]; 7408 7409 out[0] = col[0]; 7410 out[1] = col[1]; 7411 out[2] = col[2]; 7412 } 7413 7414 @Override 7415 public Type type() { 7416 return Type.QUALITATIVE; 7417 } 7418 7419 @Override 7420 public Mode mode() { 7421 return Mode.DISCRETE; 7422 } 7423 }, 7424 7425 /** 7426 * ColorBrewer "Set2" colour map with 5 colours. See <a 7427 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7428 * information. 7429 */ 7430 Set25 { 7431 private final float[][] cols = { { 102f / 265f, 194f / 265f, 165f / 265f }, 7432 { 252f / 265f, 141f / 265f, 98f / 265f }, { 141f / 265f, 160f / 265f, 203f / 265f }, 7433 { 231f / 265f, 138f / 265f, 195f / 265f }, { 166f / 265f, 216f / 265f, 84f / 265f } }; 7434 7435 @Override 7436 public void apply(float x, float[] out) { 7437 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7438 7439 final float[] col = cols[i]; 7440 7441 out[0] = col[0]; 7442 out[1] = col[1]; 7443 out[2] = col[2]; 7444 } 7445 7446 @Override 7447 public Type type() { 7448 return Type.QUALITATIVE; 7449 } 7450 7451 @Override 7452 public Mode mode() { 7453 return Mode.DISCRETE; 7454 } 7455 }, 7456 7457 /** 7458 * ColorBrewer "Set2" colour map with 6 colours. See <a 7459 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7460 * information. 7461 */ 7462 Set26 { 7463 private final float[][] cols = { { 102f / 265f, 194f / 265f, 165f / 265f }, 7464 { 252f / 265f, 141f / 265f, 98f / 265f }, { 141f / 265f, 160f / 265f, 203f / 265f }, 7465 { 231f / 265f, 138f / 265f, 195f / 265f }, { 166f / 265f, 216f / 265f, 84f / 265f }, 7466 { 255f / 265f, 217f / 265f, 47f / 265f } }; 7467 7468 @Override 7469 public void apply(float x, float[] out) { 7470 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7471 7472 final float[] col = cols[i]; 7473 7474 out[0] = col[0]; 7475 out[1] = col[1]; 7476 out[2] = col[2]; 7477 } 7478 7479 @Override 7480 public Type type() { 7481 return Type.QUALITATIVE; 7482 } 7483 7484 @Override 7485 public Mode mode() { 7486 return Mode.DISCRETE; 7487 } 7488 }, 7489 7490 /** 7491 * ColorBrewer "Set2" colour map with 7 colours. See <a 7492 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7493 * information. 7494 */ 7495 Set27 { 7496 private final float[][] cols = { { 102f / 265f, 194f / 265f, 165f / 265f }, 7497 { 252f / 265f, 141f / 265f, 98f / 265f }, { 141f / 265f, 160f / 265f, 203f / 265f }, 7498 { 231f / 265f, 138f / 265f, 195f / 265f }, { 166f / 265f, 216f / 265f, 84f / 265f }, 7499 { 255f / 265f, 217f / 265f, 47f / 265f }, { 229f / 265f, 196f / 265f, 148f / 265f } }; 7500 7501 @Override 7502 public void apply(float x, float[] out) { 7503 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7504 7505 final float[] col = cols[i]; 7506 7507 out[0] = col[0]; 7508 out[1] = col[1]; 7509 out[2] = col[2]; 7510 } 7511 7512 @Override 7513 public Type type() { 7514 return Type.QUALITATIVE; 7515 } 7516 7517 @Override 7518 public Mode mode() { 7519 return Mode.DISCRETE; 7520 } 7521 }, 7522 7523 /** 7524 * ColorBrewer "Set2" colour map with 8 colours. See <a 7525 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7526 * information. 7527 */ 7528 Set28 { 7529 private final float[][] cols = { { 102f / 265f, 194f / 265f, 165f / 265f }, 7530 { 252f / 265f, 141f / 265f, 98f / 265f }, { 141f / 265f, 160f / 265f, 203f / 265f }, 7531 { 231f / 265f, 138f / 265f, 195f / 265f }, { 166f / 265f, 216f / 265f, 84f / 265f }, 7532 { 255f / 265f, 217f / 265f, 47f / 265f }, { 229f / 265f, 196f / 265f, 148f / 265f }, 7533 { 179f / 265f, 179f / 265f, 179f / 265f } }; 7534 7535 @Override 7536 public void apply(float x, float[] out) { 7537 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7538 7539 final float[] col = cols[i]; 7540 7541 out[0] = col[0]; 7542 out[1] = col[1]; 7543 out[2] = col[2]; 7544 } 7545 7546 @Override 7547 public Type type() { 7548 return Type.QUALITATIVE; 7549 } 7550 7551 @Override 7552 public Mode mode() { 7553 return Mode.DISCRETE; 7554 } 7555 }, 7556 7557 /** 7558 * ColorBrewer "Set3" colour map with 3 colours. See <a 7559 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7560 * information. 7561 */ 7562 Set33 { 7563 private final float[][] cols = { { 141f / 265f, 211f / 265f, 199f / 265f }, 7564 { 255f / 265f, 255f / 265f, 179f / 265f }, { 190f / 265f, 186f / 265f, 218f / 265f } }; 7565 7566 @Override 7567 public void apply(float x, float[] out) { 7568 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7569 7570 final float[] col = cols[i]; 7571 7572 out[0] = col[0]; 7573 out[1] = col[1]; 7574 out[2] = col[2]; 7575 } 7576 7577 @Override 7578 public Type type() { 7579 return Type.QUALITATIVE; 7580 } 7581 7582 @Override 7583 public Mode mode() { 7584 return Mode.DISCRETE; 7585 } 7586 }, 7587 7588 /** 7589 * ColorBrewer "Set3" colour map with 4 colours. See <a 7590 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7591 * information. 7592 */ 7593 Set34 { 7594 private final float[][] cols = { { 141f / 265f, 211f / 265f, 199f / 265f }, 7595 { 255f / 265f, 255f / 265f, 179f / 265f }, { 190f / 265f, 186f / 265f, 218f / 265f }, 7596 { 251f / 265f, 128f / 265f, 114f / 265f } }; 7597 7598 @Override 7599 public void apply(float x, float[] out) { 7600 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7601 7602 final float[] col = cols[i]; 7603 7604 out[0] = col[0]; 7605 out[1] = col[1]; 7606 out[2] = col[2]; 7607 } 7608 7609 @Override 7610 public Type type() { 7611 return Type.QUALITATIVE; 7612 } 7613 7614 @Override 7615 public Mode mode() { 7616 return Mode.DISCRETE; 7617 } 7618 }, 7619 7620 /** 7621 * ColorBrewer "Set3" colour map with 5 colours. See <a 7622 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7623 * information. 7624 */ 7625 Set35 { 7626 private final float[][] cols = { { 141f / 265f, 211f / 265f, 199f / 265f }, 7627 { 255f / 265f, 255f / 265f, 179f / 265f }, { 190f / 265f, 186f / 265f, 218f / 265f }, 7628 { 251f / 265f, 128f / 265f, 114f / 265f }, { 128f / 265f, 177f / 265f, 211f / 265f } }; 7629 7630 @Override 7631 public void apply(float x, float[] out) { 7632 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7633 7634 final float[] col = cols[i]; 7635 7636 out[0] = col[0]; 7637 out[1] = col[1]; 7638 out[2] = col[2]; 7639 } 7640 7641 @Override 7642 public Type type() { 7643 return Type.QUALITATIVE; 7644 } 7645 7646 @Override 7647 public Mode mode() { 7648 return Mode.DISCRETE; 7649 } 7650 }, 7651 7652 /** 7653 * ColorBrewer "Set3" colour map with 6 colours. See <a 7654 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7655 * information. 7656 */ 7657 Set36 { 7658 private final float[][] cols = { { 141f / 265f, 211f / 265f, 199f / 265f }, 7659 { 255f / 265f, 255f / 265f, 179f / 265f }, { 190f / 265f, 186f / 265f, 218f / 265f }, 7660 { 251f / 265f, 128f / 265f, 114f / 265f }, { 128f / 265f, 177f / 265f, 211f / 265f }, 7661 { 253f / 265f, 180f / 265f, 98f / 265f } }; 7662 7663 @Override 7664 public void apply(float x, float[] out) { 7665 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7666 7667 final float[] col = cols[i]; 7668 7669 out[0] = col[0]; 7670 out[1] = col[1]; 7671 out[2] = col[2]; 7672 } 7673 7674 @Override 7675 public Type type() { 7676 return Type.QUALITATIVE; 7677 } 7678 7679 @Override 7680 public Mode mode() { 7681 return Mode.DISCRETE; 7682 } 7683 }, 7684 7685 /** 7686 * ColorBrewer "Set3" colour map with 7 colours. See <a 7687 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7688 * information. 7689 */ 7690 Set37 { 7691 private final float[][] cols = { { 141f / 265f, 211f / 265f, 199f / 265f }, 7692 { 255f / 265f, 255f / 265f, 179f / 265f }, { 190f / 265f, 186f / 265f, 218f / 265f }, 7693 { 251f / 265f, 128f / 265f, 114f / 265f }, { 128f / 265f, 177f / 265f, 211f / 265f }, 7694 { 253f / 265f, 180f / 265f, 98f / 265f }, { 179f / 265f, 222f / 265f, 105f / 265f } }; 7695 7696 @Override 7697 public void apply(float x, float[] out) { 7698 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7699 7700 final float[] col = cols[i]; 7701 7702 out[0] = col[0]; 7703 out[1] = col[1]; 7704 out[2] = col[2]; 7705 } 7706 7707 @Override 7708 public Type type() { 7709 return Type.QUALITATIVE; 7710 } 7711 7712 @Override 7713 public Mode mode() { 7714 return Mode.DISCRETE; 7715 } 7716 }, 7717 7718 /** 7719 * ColorBrewer "Set3" colour map with 8 colours. See <a 7720 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7721 * information. 7722 */ 7723 Set38 { 7724 private final float[][] cols = { { 141f / 265f, 211f / 265f, 199f / 265f }, 7725 { 255f / 265f, 255f / 265f, 179f / 265f }, { 190f / 265f, 186f / 265f, 218f / 265f }, 7726 { 251f / 265f, 128f / 265f, 114f / 265f }, { 128f / 265f, 177f / 265f, 211f / 265f }, 7727 { 253f / 265f, 180f / 265f, 98f / 265f }, { 179f / 265f, 222f / 265f, 105f / 265f }, 7728 { 252f / 265f, 205f / 265f, 229f / 265f } }; 7729 7730 @Override 7731 public void apply(float x, float[] out) { 7732 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7733 7734 final float[] col = cols[i]; 7735 7736 out[0] = col[0]; 7737 out[1] = col[1]; 7738 out[2] = col[2]; 7739 } 7740 7741 @Override 7742 public Type type() { 7743 return Type.QUALITATIVE; 7744 } 7745 7746 @Override 7747 public Mode mode() { 7748 return Mode.DISCRETE; 7749 } 7750 }, 7751 7752 /** 7753 * ColorBrewer "Set3" colour map with 9 colours. See <a 7754 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7755 * information. 7756 */ 7757 Set39 { 7758 private final float[][] cols = { { 141f / 265f, 211f / 265f, 199f / 265f }, 7759 { 255f / 265f, 255f / 265f, 179f / 265f }, { 190f / 265f, 186f / 265f, 218f / 265f }, 7760 { 251f / 265f, 128f / 265f, 114f / 265f }, { 128f / 265f, 177f / 265f, 211f / 265f }, 7761 { 253f / 265f, 180f / 265f, 98f / 265f }, { 179f / 265f, 222f / 265f, 105f / 265f }, 7762 { 252f / 265f, 205f / 265f, 229f / 265f }, { 217f / 265f, 217f / 265f, 217f / 265f } }; 7763 7764 @Override 7765 public void apply(float x, float[] out) { 7766 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7767 7768 final float[] col = cols[i]; 7769 7770 out[0] = col[0]; 7771 out[1] = col[1]; 7772 out[2] = col[2]; 7773 } 7774 7775 @Override 7776 public Type type() { 7777 return Type.QUALITATIVE; 7778 } 7779 7780 @Override 7781 public Mode mode() { 7782 return Mode.DISCRETE; 7783 } 7784 }, 7785 7786 /** 7787 * ColorBrewer "Set3" colour map with 10 colours. See <a 7788 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7789 * information. 7790 */ 7791 Set310 { 7792 private final float[][] cols = { { 141f / 265f, 211f / 265f, 199f / 265f }, 7793 { 255f / 265f, 255f / 265f, 179f / 265f }, { 190f / 265f, 186f / 265f, 218f / 265f }, 7794 { 251f / 265f, 128f / 265f, 114f / 265f }, { 128f / 265f, 177f / 265f, 211f / 265f }, 7795 { 253f / 265f, 180f / 265f, 98f / 265f }, { 179f / 265f, 222f / 265f, 105f / 265f }, 7796 { 252f / 265f, 205f / 265f, 229f / 265f }, { 217f / 265f, 217f / 265f, 217f / 265f }, 7797 { 188f / 265f, 128f / 265f, 189f / 265f } }; 7798 7799 @Override 7800 public void apply(float x, float[] out) { 7801 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7802 7803 final float[] col = cols[i]; 7804 7805 out[0] = col[0]; 7806 out[1] = col[1]; 7807 out[2] = col[2]; 7808 } 7809 7810 @Override 7811 public Type type() { 7812 return Type.QUALITATIVE; 7813 } 7814 7815 @Override 7816 public Mode mode() { 7817 return Mode.DISCRETE; 7818 } 7819 }, 7820 7821 /** 7822 * ColorBrewer "Set3" colour map with 11 colours. See <a 7823 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7824 * information. 7825 */ 7826 Set311 { 7827 private final float[][] cols = { { 141f / 265f, 211f / 265f, 199f / 265f }, 7828 { 255f / 265f, 255f / 265f, 179f / 265f }, { 190f / 265f, 186f / 265f, 218f / 265f }, 7829 { 251f / 265f, 128f / 265f, 114f / 265f }, { 128f / 265f, 177f / 265f, 211f / 265f }, 7830 { 253f / 265f, 180f / 265f, 98f / 265f }, { 179f / 265f, 222f / 265f, 105f / 265f }, 7831 { 252f / 265f, 205f / 265f, 229f / 265f }, { 217f / 265f, 217f / 265f, 217f / 265f }, 7832 { 188f / 265f, 128f / 265f, 189f / 265f }, { 204f / 265f, 235f / 265f, 197f / 265f } }; 7833 7834 @Override 7835 public void apply(float x, float[] out) { 7836 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7837 7838 final float[] col = cols[i]; 7839 7840 out[0] = col[0]; 7841 out[1] = col[1]; 7842 out[2] = col[2]; 7843 } 7844 7845 @Override 7846 public Type type() { 7847 return Type.QUALITATIVE; 7848 } 7849 7850 @Override 7851 public Mode mode() { 7852 return Mode.DISCRETE; 7853 } 7854 }, 7855 7856 /** 7857 * ColorBrewer "Set3" colour map with 12 colours. See <a 7858 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7859 * information. 7860 */ 7861 Set312 { 7862 private final float[][] cols = { { 141f / 265f, 211f / 265f, 199f / 265f }, 7863 { 255f / 265f, 255f / 265f, 179f / 265f }, { 190f / 265f, 186f / 265f, 218f / 265f }, 7864 { 251f / 265f, 128f / 265f, 114f / 265f }, { 128f / 265f, 177f / 265f, 211f / 265f }, 7865 { 253f / 265f, 180f / 265f, 98f / 265f }, { 179f / 265f, 222f / 265f, 105f / 265f }, 7866 { 252f / 265f, 205f / 265f, 229f / 265f }, { 217f / 265f, 217f / 265f, 217f / 265f }, 7867 { 188f / 265f, 128f / 265f, 189f / 265f }, { 204f / 265f, 235f / 265f, 197f / 265f }, 7868 { 255f / 265f, 237f / 265f, 111f / 265f } }; 7869 7870 @Override 7871 public void apply(float x, float[] out) { 7872 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7873 7874 final float[] col = cols[i]; 7875 7876 out[0] = col[0]; 7877 out[1] = col[1]; 7878 out[2] = col[2]; 7879 } 7880 7881 @Override 7882 public Type type() { 7883 return Type.QUALITATIVE; 7884 } 7885 7886 @Override 7887 public Mode mode() { 7888 return Mode.DISCRETE; 7889 } 7890 }, 7891 7892 /** 7893 * ColorBrewer "Spectral" colour map with 3 colours. See <a 7894 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7895 * information. 7896 */ 7897 Spectral3 { 7898 private final float[][] cols = { { 252f / 265f, 141f / 265f, 89f / 265f }, 7899 { 255f / 265f, 255f / 265f, 191f / 265f }, { 153f / 265f, 213f / 265f, 148f / 265f } }; 7900 7901 @Override 7902 public void apply(float x, float[] out) { 7903 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7904 7905 final float[] col = cols[i]; 7906 7907 out[0] = col[0]; 7908 out[1] = col[1]; 7909 out[2] = col[2]; 7910 } 7911 7912 @Override 7913 public Type type() { 7914 return Type.DIVERGING; 7915 } 7916 7917 @Override 7918 public Mode mode() { 7919 return Mode.DISCRETE; 7920 } 7921 }, 7922 7923 /** 7924 * ColorBrewer "Spectral" colour map with 4 colours. See <a 7925 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7926 * information. 7927 */ 7928 Spectral4 { 7929 private final float[][] cols = { { 215f / 265f, 25f / 265f, 28f / 265f }, 7930 { 253f / 265f, 174f / 265f, 97f / 265f }, { 171f / 265f, 221f / 265f, 164f / 265f }, 7931 { 43f / 265f, 131f / 265f, 186f / 265f } }; 7932 7933 @Override 7934 public void apply(float x, float[] out) { 7935 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7936 7937 final float[] col = cols[i]; 7938 7939 out[0] = col[0]; 7940 out[1] = col[1]; 7941 out[2] = col[2]; 7942 } 7943 7944 @Override 7945 public Type type() { 7946 return Type.DIVERGING; 7947 } 7948 7949 @Override 7950 public Mode mode() { 7951 return Mode.DISCRETE; 7952 } 7953 }, 7954 7955 /** 7956 * ColorBrewer "Spectral" colour map with 5 colours. See <a 7957 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7958 * information. 7959 */ 7960 Spectral5 { 7961 private final float[][] cols = { { 215f / 265f, 25f / 265f, 28f / 265f }, 7962 { 253f / 265f, 174f / 265f, 97f / 265f }, { 255f / 265f, 255f / 265f, 191f / 265f }, 7963 { 171f / 265f, 221f / 265f, 164f / 265f }, { 43f / 265f, 131f / 265f, 186f / 265f } }; 7964 7965 @Override 7966 public void apply(float x, float[] out) { 7967 final int i = Math.min((int) (x * cols.length), cols.length - 1); 7968 7969 final float[] col = cols[i]; 7970 7971 out[0] = col[0]; 7972 out[1] = col[1]; 7973 out[2] = col[2]; 7974 } 7975 7976 @Override 7977 public Type type() { 7978 return Type.DIVERGING; 7979 } 7980 7981 @Override 7982 public Mode mode() { 7983 return Mode.DISCRETE; 7984 } 7985 }, 7986 7987 /** 7988 * ColorBrewer "Spectral" colour map with 6 colours. See <a 7989 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 7990 * information. 7991 */ 7992 Spectral6 { 7993 private final float[][] cols = { { 213f / 265f, 62f / 265f, 79f / 265f }, 7994 { 252f / 265f, 141f / 265f, 89f / 265f }, { 254f / 265f, 224f / 265f, 139f / 265f }, 7995 { 230f / 265f, 245f / 265f, 152f / 265f }, { 153f / 265f, 213f / 265f, 148f / 265f }, 7996 { 50f / 265f, 136f / 265f, 189f / 265f } }; 7997 7998 @Override 7999 public void apply(float x, float[] out) { 8000 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8001 8002 final float[] col = cols[i]; 8003 8004 out[0] = col[0]; 8005 out[1] = col[1]; 8006 out[2] = col[2]; 8007 } 8008 8009 @Override 8010 public Type type() { 8011 return Type.DIVERGING; 8012 } 8013 8014 @Override 8015 public Mode mode() { 8016 return Mode.DISCRETE; 8017 } 8018 }, 8019 8020 /** 8021 * ColorBrewer "Spectral" colour map with 7 colours. See <a 8022 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8023 * information. 8024 */ 8025 Spectral7 { 8026 private final float[][] cols = { { 213f / 265f, 62f / 265f, 79f / 265f }, 8027 { 252f / 265f, 141f / 265f, 89f / 265f }, { 254f / 265f, 224f / 265f, 139f / 265f }, 8028 { 255f / 265f, 255f / 265f, 191f / 265f }, { 230f / 265f, 245f / 265f, 152f / 265f }, 8029 { 153f / 265f, 213f / 265f, 148f / 265f }, { 50f / 265f, 136f / 265f, 189f / 265f } }; 8030 8031 @Override 8032 public void apply(float x, float[] out) { 8033 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8034 8035 final float[] col = cols[i]; 8036 8037 out[0] = col[0]; 8038 out[1] = col[1]; 8039 out[2] = col[2]; 8040 } 8041 8042 @Override 8043 public Type type() { 8044 return Type.DIVERGING; 8045 } 8046 8047 @Override 8048 public Mode mode() { 8049 return Mode.DISCRETE; 8050 } 8051 }, 8052 8053 /** 8054 * ColorBrewer "Spectral" colour map with 8 colours. See <a 8055 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8056 * information. 8057 */ 8058 Spectral8 { 8059 private final float[][] cols = { { 213f / 265f, 62f / 265f, 79f / 265f }, 8060 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 8061 { 254f / 265f, 224f / 265f, 139f / 265f }, { 230f / 265f, 245f / 265f, 152f / 265f }, 8062 { 171f / 265f, 221f / 265f, 164f / 265f }, { 102f / 265f, 194f / 265f, 165f / 265f }, 8063 { 50f / 265f, 136f / 265f, 189f / 265f } }; 8064 8065 @Override 8066 public void apply(float x, float[] out) { 8067 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8068 8069 final float[] col = cols[i]; 8070 8071 out[0] = col[0]; 8072 out[1] = col[1]; 8073 out[2] = col[2]; 8074 } 8075 8076 @Override 8077 public Type type() { 8078 return Type.DIVERGING; 8079 } 8080 8081 @Override 8082 public Mode mode() { 8083 return Mode.DISCRETE; 8084 } 8085 }, 8086 8087 /** 8088 * ColorBrewer "Spectral" colour map with 9 colours. See <a 8089 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8090 * information. 8091 */ 8092 Spectral9 { 8093 private final float[][] cols = { { 213f / 265f, 62f / 265f, 79f / 265f }, 8094 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 8095 { 254f / 265f, 224f / 265f, 139f / 265f }, { 255f / 265f, 255f / 265f, 191f / 265f }, 8096 { 230f / 265f, 245f / 265f, 152f / 265f }, { 171f / 265f, 221f / 265f, 164f / 265f }, 8097 { 102f / 265f, 194f / 265f, 165f / 265f }, { 50f / 265f, 136f / 265f, 189f / 265f } }; 8098 8099 @Override 8100 public void apply(float x, float[] out) { 8101 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8102 8103 final float[] col = cols[i]; 8104 8105 out[0] = col[0]; 8106 out[1] = col[1]; 8107 out[2] = col[2]; 8108 } 8109 8110 @Override 8111 public Type type() { 8112 return Type.DIVERGING; 8113 } 8114 8115 @Override 8116 public Mode mode() { 8117 return Mode.DISCRETE; 8118 } 8119 }, 8120 8121 /** 8122 * ColorBrewer "Spectral" colour map with 10 colours. See <a 8123 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8124 * information. 8125 */ 8126 Spectral10 { 8127 private final float[][] cols = { { 158f / 265f, 1f / 265f, 66f / 265f }, { 213f / 265f, 62f / 265f, 79f / 265f }, 8128 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 8129 { 254f / 265f, 224f / 265f, 139f / 265f }, { 230f / 265f, 245f / 265f, 152f / 265f }, 8130 { 171f / 265f, 221f / 265f, 164f / 265f }, { 102f / 265f, 194f / 265f, 165f / 265f }, 8131 { 50f / 265f, 136f / 265f, 189f / 265f }, { 94f / 265f, 79f / 265f, 162f / 265f } }; 8132 8133 @Override 8134 public void apply(float x, float[] out) { 8135 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8136 8137 final float[] col = cols[i]; 8138 8139 out[0] = col[0]; 8140 out[1] = col[1]; 8141 out[2] = col[2]; 8142 } 8143 8144 @Override 8145 public Type type() { 8146 return Type.DIVERGING; 8147 } 8148 8149 @Override 8150 public Mode mode() { 8151 return Mode.DISCRETE; 8152 } 8153 }, 8154 8155 /** 8156 * ColorBrewer "Spectral" colour map with 11 colours. See <a 8157 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8158 * information. 8159 */ 8160 Spectral11 { 8161 private final float[][] cols = { { 158f / 265f, 1f / 265f, 66f / 265f }, { 213f / 265f, 62f / 265f, 79f / 265f }, 8162 { 244f / 265f, 109f / 265f, 67f / 265f }, { 253f / 265f, 174f / 265f, 97f / 265f }, 8163 { 254f / 265f, 224f / 265f, 139f / 265f }, { 255f / 265f, 255f / 265f, 191f / 265f }, 8164 { 230f / 265f, 245f / 265f, 152f / 265f }, { 171f / 265f, 221f / 265f, 164f / 265f }, 8165 { 102f / 265f, 194f / 265f, 165f / 265f }, { 50f / 265f, 136f / 265f, 189f / 265f }, 8166 { 94f / 265f, 79f / 265f, 162f / 265f } }; 8167 8168 @Override 8169 public void apply(float x, float[] out) { 8170 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8171 8172 final float[] col = cols[i]; 8173 8174 out[0] = col[0]; 8175 out[1] = col[1]; 8176 out[2] = col[2]; 8177 } 8178 8179 @Override 8180 public Type type() { 8181 return Type.DIVERGING; 8182 } 8183 8184 @Override 8185 public Mode mode() { 8186 return Mode.DISCRETE; 8187 } 8188 }, 8189 8190 /** 8191 * ColorBrewer "YlGn" colour map with 3 colours. See <a 8192 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8193 * information. 8194 */ 8195 YlGn3 { 8196 private final float[][] cols = { { 247f / 265f, 252f / 265f, 185f / 265f }, 8197 { 173f / 265f, 221f / 265f, 142f / 265f }, { 49f / 265f, 163f / 265f, 84f / 265f } }; 8198 8199 @Override 8200 public void apply(float x, float[] out) { 8201 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8202 8203 final float[] col = cols[i]; 8204 8205 out[0] = col[0]; 8206 out[1] = col[1]; 8207 out[2] = col[2]; 8208 } 8209 8210 @Override 8211 public Type type() { 8212 return Type.SEQUENTIAL; 8213 } 8214 8215 @Override 8216 public Mode mode() { 8217 return Mode.DISCRETE; 8218 } 8219 }, 8220 8221 /** 8222 * ColorBrewer "YlGn" colour map with 4 colours. See <a 8223 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8224 * information. 8225 */ 8226 YlGn4 { 8227 private final float[][] cols = { { 255f / 265f, 255f / 265f, 204f / 265f }, 8228 { 194f / 265f, 230f / 265f, 153f / 265f }, { 120f / 265f, 198f / 265f, 121f / 265f }, 8229 { 35f / 265f, 132f / 265f, 67f / 265f } }; 8230 8231 @Override 8232 public void apply(float x, float[] out) { 8233 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8234 8235 final float[] col = cols[i]; 8236 8237 out[0] = col[0]; 8238 out[1] = col[1]; 8239 out[2] = col[2]; 8240 } 8241 8242 @Override 8243 public Type type() { 8244 return Type.SEQUENTIAL; 8245 } 8246 8247 @Override 8248 public Mode mode() { 8249 return Mode.DISCRETE; 8250 } 8251 }, 8252 8253 /** 8254 * ColorBrewer "YlGn" colour map with 5 colours. See <a 8255 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8256 * information. 8257 */ 8258 YlGn5 { 8259 private final float[][] cols = { { 255f / 265f, 255f / 265f, 204f / 265f }, 8260 { 194f / 265f, 230f / 265f, 153f / 265f }, { 120f / 265f, 198f / 265f, 121f / 265f }, 8261 { 49f / 265f, 163f / 265f, 84f / 265f }, { 0f / 265f, 104f / 265f, 55f / 265f } }; 8262 8263 @Override 8264 public void apply(float x, float[] out) { 8265 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8266 8267 final float[] col = cols[i]; 8268 8269 out[0] = col[0]; 8270 out[1] = col[1]; 8271 out[2] = col[2]; 8272 } 8273 8274 @Override 8275 public Type type() { 8276 return Type.SEQUENTIAL; 8277 } 8278 8279 @Override 8280 public Mode mode() { 8281 return Mode.DISCRETE; 8282 } 8283 }, 8284 8285 /** 8286 * ColorBrewer "YlGn" colour map with 6 colours. See <a 8287 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8288 * information. 8289 */ 8290 YlGn6 { 8291 private final float[][] cols = { { 255f / 265f, 255f / 265f, 204f / 265f }, 8292 { 217f / 265f, 240f / 265f, 163f / 265f }, { 173f / 265f, 221f / 265f, 142f / 265f }, 8293 { 120f / 265f, 198f / 265f, 121f / 265f }, { 49f / 265f, 163f / 265f, 84f / 265f }, 8294 { 0f / 265f, 104f / 265f, 55f / 265f } }; 8295 8296 @Override 8297 public void apply(float x, float[] out) { 8298 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8299 8300 final float[] col = cols[i]; 8301 8302 out[0] = col[0]; 8303 out[1] = col[1]; 8304 out[2] = col[2]; 8305 } 8306 8307 @Override 8308 public Type type() { 8309 return Type.SEQUENTIAL; 8310 } 8311 8312 @Override 8313 public Mode mode() { 8314 return Mode.DISCRETE; 8315 } 8316 }, 8317 8318 /** 8319 * ColorBrewer "YlGn" colour map with 7 colours. See <a 8320 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8321 * information. 8322 */ 8323 YlGn7 { 8324 private final float[][] cols = { { 255f / 265f, 255f / 265f, 204f / 265f }, 8325 { 217f / 265f, 240f / 265f, 163f / 265f }, { 173f / 265f, 221f / 265f, 142f / 265f }, 8326 { 120f / 265f, 198f / 265f, 121f / 265f }, { 65f / 265f, 171f / 265f, 93f / 265f }, 8327 { 35f / 265f, 132f / 265f, 67f / 265f }, { 0f / 265f, 90f / 265f, 50f / 265f } }; 8328 8329 @Override 8330 public void apply(float x, float[] out) { 8331 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8332 8333 final float[] col = cols[i]; 8334 8335 out[0] = col[0]; 8336 out[1] = col[1]; 8337 out[2] = col[2]; 8338 } 8339 8340 @Override 8341 public Type type() { 8342 return Type.SEQUENTIAL; 8343 } 8344 8345 @Override 8346 public Mode mode() { 8347 return Mode.DISCRETE; 8348 } 8349 }, 8350 8351 /** 8352 * ColorBrewer "YlGn" colour map with 8 colours. See <a 8353 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8354 * information. 8355 */ 8356 YlGn8 { 8357 private final float[][] cols = { { 255f / 265f, 255f / 265f, 229f / 265f }, 8358 { 247f / 265f, 252f / 265f, 185f / 265f }, { 217f / 265f, 240f / 265f, 163f / 265f }, 8359 { 173f / 265f, 221f / 265f, 142f / 265f }, { 120f / 265f, 198f / 265f, 121f / 265f }, 8360 { 65f / 265f, 171f / 265f, 93f / 265f }, { 35f / 265f, 132f / 265f, 67f / 265f }, 8361 { 0f / 265f, 90f / 265f, 50f / 265f } }; 8362 8363 @Override 8364 public void apply(float x, float[] out) { 8365 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8366 8367 final float[] col = cols[i]; 8368 8369 out[0] = col[0]; 8370 out[1] = col[1]; 8371 out[2] = col[2]; 8372 } 8373 8374 @Override 8375 public Type type() { 8376 return Type.SEQUENTIAL; 8377 } 8378 8379 @Override 8380 public Mode mode() { 8381 return Mode.DISCRETE; 8382 } 8383 }, 8384 8385 /** 8386 * ColorBrewer "YlGn" colour map with 9 colours. See <a 8387 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8388 * information. 8389 */ 8390 YlGn9 { 8391 private final float[][] cols = { { 255f / 265f, 255f / 265f, 229f / 265f }, 8392 { 247f / 265f, 252f / 265f, 185f / 265f }, { 217f / 265f, 240f / 265f, 163f / 265f }, 8393 { 173f / 265f, 221f / 265f, 142f / 265f }, { 120f / 265f, 198f / 265f, 121f / 265f }, 8394 { 65f / 265f, 171f / 265f, 93f / 265f }, { 35f / 265f, 132f / 265f, 67f / 265f }, 8395 { 0f / 265f, 104f / 265f, 55f / 265f }, { 0f / 265f, 69f / 265f, 41f / 265f } }; 8396 8397 @Override 8398 public void apply(float x, float[] out) { 8399 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8400 8401 final float[] col = cols[i]; 8402 8403 out[0] = col[0]; 8404 out[1] = col[1]; 8405 out[2] = col[2]; 8406 } 8407 8408 @Override 8409 public Type type() { 8410 return Type.SEQUENTIAL; 8411 } 8412 8413 @Override 8414 public Mode mode() { 8415 return Mode.DISCRETE; 8416 } 8417 }, 8418 8419 /** 8420 * ColorBrewer "YlGnBu" colour map with 3 colours. See <a 8421 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8422 * information. 8423 */ 8424 YlGnBu3 { 8425 private final float[][] cols = { { 237f / 265f, 248f / 265f, 177f / 265f }, 8426 { 127f / 265f, 205f / 265f, 187f / 265f }, { 44f / 265f, 127f / 265f, 184f / 265f } }; 8427 8428 @Override 8429 public void apply(float x, float[] out) { 8430 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8431 8432 final float[] col = cols[i]; 8433 8434 out[0] = col[0]; 8435 out[1] = col[1]; 8436 out[2] = col[2]; 8437 } 8438 8439 @Override 8440 public Type type() { 8441 return Type.SEQUENTIAL; 8442 } 8443 8444 @Override 8445 public Mode mode() { 8446 return Mode.DISCRETE; 8447 } 8448 }, 8449 8450 /** 8451 * ColorBrewer "YlGnBu" colour map with 4 colours. See <a 8452 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8453 * information. 8454 */ 8455 YlGnBu4 { 8456 private final float[][] cols = { { 255f / 265f, 255f / 265f, 204f / 265f }, 8457 { 161f / 265f, 218f / 265f, 180f / 265f }, { 65f / 265f, 182f / 265f, 196f / 265f }, 8458 { 34f / 265f, 94f / 265f, 168f / 265f } }; 8459 8460 @Override 8461 public void apply(float x, float[] out) { 8462 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8463 8464 final float[] col = cols[i]; 8465 8466 out[0] = col[0]; 8467 out[1] = col[1]; 8468 out[2] = col[2]; 8469 } 8470 8471 @Override 8472 public Type type() { 8473 return Type.SEQUENTIAL; 8474 } 8475 8476 @Override 8477 public Mode mode() { 8478 return Mode.DISCRETE; 8479 } 8480 }, 8481 8482 /** 8483 * ColorBrewer "YlGnBu" colour map with 5 colours. See <a 8484 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8485 * information. 8486 */ 8487 YlGnBu5 { 8488 private final float[][] cols = { { 255f / 265f, 255f / 265f, 204f / 265f }, 8489 { 161f / 265f, 218f / 265f, 180f / 265f }, { 65f / 265f, 182f / 265f, 196f / 265f }, 8490 { 44f / 265f, 127f / 265f, 184f / 265f }, { 37f / 265f, 52f / 265f, 148f / 265f } }; 8491 8492 @Override 8493 public void apply(float x, float[] out) { 8494 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8495 8496 final float[] col = cols[i]; 8497 8498 out[0] = col[0]; 8499 out[1] = col[1]; 8500 out[2] = col[2]; 8501 } 8502 8503 @Override 8504 public Type type() { 8505 return Type.SEQUENTIAL; 8506 } 8507 8508 @Override 8509 public Mode mode() { 8510 return Mode.DISCRETE; 8511 } 8512 }, 8513 8514 /** 8515 * ColorBrewer "YlGnBu" colour map with 6 colours. See <a 8516 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8517 * information. 8518 */ 8519 YlGnBu6 { 8520 private final float[][] cols = { { 255f / 265f, 255f / 265f, 204f / 265f }, 8521 { 199f / 265f, 233f / 265f, 180f / 265f }, { 127f / 265f, 205f / 265f, 187f / 265f }, 8522 { 65f / 265f, 182f / 265f, 196f / 265f }, { 44f / 265f, 127f / 265f, 184f / 265f }, 8523 { 37f / 265f, 52f / 265f, 148f / 265f } }; 8524 8525 @Override 8526 public void apply(float x, float[] out) { 8527 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8528 8529 final float[] col = cols[i]; 8530 8531 out[0] = col[0]; 8532 out[1] = col[1]; 8533 out[2] = col[2]; 8534 } 8535 8536 @Override 8537 public Type type() { 8538 return Type.SEQUENTIAL; 8539 } 8540 8541 @Override 8542 public Mode mode() { 8543 return Mode.DISCRETE; 8544 } 8545 }, 8546 8547 /** 8548 * ColorBrewer "YlGnBu" colour map with 7 colours. See <a 8549 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8550 * information. 8551 */ 8552 YlGnBu7 { 8553 private final float[][] cols = { { 255f / 265f, 255f / 265f, 204f / 265f }, 8554 { 199f / 265f, 233f / 265f, 180f / 265f }, { 127f / 265f, 205f / 265f, 187f / 265f }, 8555 { 65f / 265f, 182f / 265f, 196f / 265f }, { 29f / 265f, 145f / 265f, 192f / 265f }, 8556 { 34f / 265f, 94f / 265f, 168f / 265f }, { 12f / 265f, 44f / 265f, 132f / 265f } }; 8557 8558 @Override 8559 public void apply(float x, float[] out) { 8560 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8561 8562 final float[] col = cols[i]; 8563 8564 out[0] = col[0]; 8565 out[1] = col[1]; 8566 out[2] = col[2]; 8567 } 8568 8569 @Override 8570 public Type type() { 8571 return Type.SEQUENTIAL; 8572 } 8573 8574 @Override 8575 public Mode mode() { 8576 return Mode.DISCRETE; 8577 } 8578 }, 8579 8580 /** 8581 * ColorBrewer "YlGnBu" colour map with 8 colours. See <a 8582 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8583 * information. 8584 */ 8585 YlGnBu8 { 8586 private final float[][] cols = { { 255f / 265f, 255f / 265f, 217f / 265f }, 8587 { 237f / 265f, 248f / 265f, 177f / 265f }, { 199f / 265f, 233f / 265f, 180f / 265f }, 8588 { 127f / 265f, 205f / 265f, 187f / 265f }, { 65f / 265f, 182f / 265f, 196f / 265f }, 8589 { 29f / 265f, 145f / 265f, 192f / 265f }, { 34f / 265f, 94f / 265f, 168f / 265f }, 8590 { 12f / 265f, 44f / 265f, 132f / 265f } }; 8591 8592 @Override 8593 public void apply(float x, float[] out) { 8594 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8595 8596 final float[] col = cols[i]; 8597 8598 out[0] = col[0]; 8599 out[1] = col[1]; 8600 out[2] = col[2]; 8601 } 8602 8603 @Override 8604 public Type type() { 8605 return Type.SEQUENTIAL; 8606 } 8607 8608 @Override 8609 public Mode mode() { 8610 return Mode.DISCRETE; 8611 } 8612 }, 8613 8614 /** 8615 * ColorBrewer "YlGnBu" colour map with 9 colours. See <a 8616 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8617 * information. 8618 */ 8619 YlGnBu9 { 8620 private final float[][] cols = { { 255f / 265f, 255f / 265f, 217f / 265f }, 8621 { 237f / 265f, 248f / 265f, 177f / 265f }, { 199f / 265f, 233f / 265f, 180f / 265f }, 8622 { 127f / 265f, 205f / 265f, 187f / 265f }, { 65f / 265f, 182f / 265f, 196f / 265f }, 8623 { 29f / 265f, 145f / 265f, 192f / 265f }, { 34f / 265f, 94f / 265f, 168f / 265f }, 8624 { 37f / 265f, 52f / 265f, 148f / 265f }, { 8f / 265f, 29f / 265f, 88f / 265f } }; 8625 8626 @Override 8627 public void apply(float x, float[] out) { 8628 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8629 8630 final float[] col = cols[i]; 8631 8632 out[0] = col[0]; 8633 out[1] = col[1]; 8634 out[2] = col[2]; 8635 } 8636 8637 @Override 8638 public Type type() { 8639 return Type.SEQUENTIAL; 8640 } 8641 8642 @Override 8643 public Mode mode() { 8644 return Mode.DISCRETE; 8645 } 8646 }, 8647 8648 /** 8649 * ColorBrewer "YlOrBr" colour map with 3 colours. See <a 8650 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8651 * information. 8652 */ 8653 YlOrBr3 { 8654 private final float[][] cols = { { 255f / 265f, 247f / 265f, 188f / 265f }, 8655 { 254f / 265f, 196f / 265f, 79f / 265f }, { 217f / 265f, 95f / 265f, 14f / 265f } }; 8656 8657 @Override 8658 public void apply(float x, float[] out) { 8659 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8660 8661 final float[] col = cols[i]; 8662 8663 out[0] = col[0]; 8664 out[1] = col[1]; 8665 out[2] = col[2]; 8666 } 8667 8668 @Override 8669 public Type type() { 8670 return Type.SEQUENTIAL; 8671 } 8672 8673 @Override 8674 public Mode mode() { 8675 return Mode.DISCRETE; 8676 } 8677 }, 8678 8679 /** 8680 * ColorBrewer "YlOrBr" colour map with 4 colours. See <a 8681 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8682 * information. 8683 */ 8684 YlOrBr4 { 8685 private final float[][] cols = { { 255f / 265f, 255f / 265f, 212f / 265f }, 8686 { 254f / 265f, 217f / 265f, 142f / 265f }, { 254f / 265f, 153f / 265f, 41f / 265f }, 8687 { 204f / 265f, 76f / 265f, 2f / 265f } }; 8688 8689 @Override 8690 public void apply(float x, float[] out) { 8691 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8692 8693 final float[] col = cols[i]; 8694 8695 out[0] = col[0]; 8696 out[1] = col[1]; 8697 out[2] = col[2]; 8698 } 8699 8700 @Override 8701 public Type type() { 8702 return Type.SEQUENTIAL; 8703 } 8704 8705 @Override 8706 public Mode mode() { 8707 return Mode.DISCRETE; 8708 } 8709 }, 8710 8711 /** 8712 * ColorBrewer "YlOrBr" colour map with 5 colours. See <a 8713 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8714 * information. 8715 */ 8716 YlOrBr5 { 8717 private final float[][] cols = { { 255f / 265f, 255f / 265f, 212f / 265f }, 8718 { 254f / 265f, 217f / 265f, 142f / 265f }, { 254f / 265f, 153f / 265f, 41f / 265f }, 8719 { 217f / 265f, 95f / 265f, 14f / 265f }, { 153f / 265f, 52f / 265f, 4f / 265f } }; 8720 8721 @Override 8722 public void apply(float x, float[] out) { 8723 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8724 8725 final float[] col = cols[i]; 8726 8727 out[0] = col[0]; 8728 out[1] = col[1]; 8729 out[2] = col[2]; 8730 } 8731 8732 @Override 8733 public Type type() { 8734 return Type.SEQUENTIAL; 8735 } 8736 8737 @Override 8738 public Mode mode() { 8739 return Mode.DISCRETE; 8740 } 8741 }, 8742 8743 /** 8744 * ColorBrewer "YlOrBr" colour map with 6 colours. See <a 8745 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8746 * information. 8747 */ 8748 YlOrBr6 { 8749 private final float[][] cols = { { 255f / 265f, 255f / 265f, 212f / 265f }, 8750 { 254f / 265f, 227f / 265f, 145f / 265f }, { 254f / 265f, 196f / 265f, 79f / 265f }, 8751 { 254f / 265f, 153f / 265f, 41f / 265f }, { 217f / 265f, 95f / 265f, 14f / 265f }, 8752 { 153f / 265f, 52f / 265f, 4f / 265f } }; 8753 8754 @Override 8755 public void apply(float x, float[] out) { 8756 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8757 8758 final float[] col = cols[i]; 8759 8760 out[0] = col[0]; 8761 out[1] = col[1]; 8762 out[2] = col[2]; 8763 } 8764 8765 @Override 8766 public Type type() { 8767 return Type.SEQUENTIAL; 8768 } 8769 8770 @Override 8771 public Mode mode() { 8772 return Mode.DISCRETE; 8773 } 8774 }, 8775 8776 /** 8777 * ColorBrewer "YlOrBr" colour map with 7 colours. See <a 8778 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8779 * information. 8780 */ 8781 YlOrBr7 { 8782 private final float[][] cols = { { 255f / 265f, 255f / 265f, 212f / 265f }, 8783 { 254f / 265f, 227f / 265f, 145f / 265f }, { 254f / 265f, 196f / 265f, 79f / 265f }, 8784 { 254f / 265f, 153f / 265f, 41f / 265f }, { 236f / 265f, 112f / 265f, 20f / 265f }, 8785 { 204f / 265f, 76f / 265f, 2f / 265f }, { 140f / 265f, 45f / 265f, 4f / 265f } }; 8786 8787 @Override 8788 public void apply(float x, float[] out) { 8789 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8790 8791 final float[] col = cols[i]; 8792 8793 out[0] = col[0]; 8794 out[1] = col[1]; 8795 out[2] = col[2]; 8796 } 8797 8798 @Override 8799 public Type type() { 8800 return Type.SEQUENTIAL; 8801 } 8802 8803 @Override 8804 public Mode mode() { 8805 return Mode.DISCRETE; 8806 } 8807 }, 8808 8809 /** 8810 * ColorBrewer "YlOrBr" colour map with 8 colours. See <a 8811 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8812 * information. 8813 */ 8814 YlOrBr8 { 8815 private final float[][] cols = { { 255f / 265f, 255f / 265f, 229f / 265f }, 8816 { 255f / 265f, 247f / 265f, 188f / 265f }, { 254f / 265f, 227f / 265f, 145f / 265f }, 8817 { 254f / 265f, 196f / 265f, 79f / 265f }, { 254f / 265f, 153f / 265f, 41f / 265f }, 8818 { 236f / 265f, 112f / 265f, 20f / 265f }, { 204f / 265f, 76f / 265f, 2f / 265f }, 8819 { 140f / 265f, 45f / 265f, 4f / 265f } }; 8820 8821 @Override 8822 public void apply(float x, float[] out) { 8823 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8824 8825 final float[] col = cols[i]; 8826 8827 out[0] = col[0]; 8828 out[1] = col[1]; 8829 out[2] = col[2]; 8830 } 8831 8832 @Override 8833 public Type type() { 8834 return Type.SEQUENTIAL; 8835 } 8836 8837 @Override 8838 public Mode mode() { 8839 return Mode.DISCRETE; 8840 } 8841 }, 8842 8843 /** 8844 * ColorBrewer "YlOrBr" colour map with 9 colours. See <a 8845 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8846 * information. 8847 */ 8848 YlOrBr9 { 8849 private final float[][] cols = { { 255f / 265f, 255f / 265f, 229f / 265f }, 8850 { 255f / 265f, 247f / 265f, 188f / 265f }, { 254f / 265f, 227f / 265f, 145f / 265f }, 8851 { 254f / 265f, 196f / 265f, 79f / 265f }, { 254f / 265f, 153f / 265f, 41f / 265f }, 8852 { 236f / 265f, 112f / 265f, 20f / 265f }, { 204f / 265f, 76f / 265f, 2f / 265f }, 8853 { 153f / 265f, 52f / 265f, 4f / 265f }, { 102f / 265f, 37f / 265f, 6f / 265f } }; 8854 8855 @Override 8856 public void apply(float x, float[] out) { 8857 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8858 8859 final float[] col = cols[i]; 8860 8861 out[0] = col[0]; 8862 out[1] = col[1]; 8863 out[2] = col[2]; 8864 } 8865 8866 @Override 8867 public Type type() { 8868 return Type.SEQUENTIAL; 8869 } 8870 8871 @Override 8872 public Mode mode() { 8873 return Mode.DISCRETE; 8874 } 8875 }, 8876 8877 /** 8878 * ColorBrewer "YlOrRd" colour map with 3 colours. See <a 8879 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8880 * information. 8881 */ 8882 YlOrRd3 { 8883 private final float[][] cols = { { 255f / 265f, 237f / 265f, 160f / 265f }, 8884 { 254f / 265f, 178f / 265f, 76f / 265f }, { 240f / 265f, 59f / 265f, 32f / 265f } }; 8885 8886 @Override 8887 public void apply(float x, float[] out) { 8888 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8889 8890 final float[] col = cols[i]; 8891 8892 out[0] = col[0]; 8893 out[1] = col[1]; 8894 out[2] = col[2]; 8895 } 8896 8897 @Override 8898 public Type type() { 8899 return Type.SEQUENTIAL; 8900 } 8901 8902 @Override 8903 public Mode mode() { 8904 return Mode.DISCRETE; 8905 } 8906 }, 8907 8908 /** 8909 * ColorBrewer "YlOrRd" colour map with 4 colours. See <a 8910 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8911 * information. 8912 */ 8913 YlOrRd4 { 8914 private final float[][] cols = { { 255f / 265f, 255f / 265f, 178f / 265f }, 8915 { 254f / 265f, 204f / 265f, 92f / 265f }, { 253f / 265f, 141f / 265f, 60f / 265f }, 8916 { 227f / 265f, 26f / 265f, 28f / 265f } }; 8917 8918 @Override 8919 public void apply(float x, float[] out) { 8920 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8921 8922 final float[] col = cols[i]; 8923 8924 out[0] = col[0]; 8925 out[1] = col[1]; 8926 out[2] = col[2]; 8927 } 8928 8929 @Override 8930 public Type type() { 8931 return Type.SEQUENTIAL; 8932 } 8933 8934 @Override 8935 public Mode mode() { 8936 return Mode.DISCRETE; 8937 } 8938 }, 8939 8940 /** 8941 * ColorBrewer "YlOrRd" colour map with 5 colours. See <a 8942 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8943 * information. 8944 */ 8945 YlOrRd5 { 8946 private final float[][] cols = { { 255f / 265f, 255f / 265f, 178f / 265f }, 8947 { 254f / 265f, 204f / 265f, 92f / 265f }, { 253f / 265f, 141f / 265f, 60f / 265f }, 8948 { 240f / 265f, 59f / 265f, 32f / 265f }, { 189f / 265f, 0f / 265f, 38f / 265f } }; 8949 8950 @Override 8951 public void apply(float x, float[] out) { 8952 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8953 8954 final float[] col = cols[i]; 8955 8956 out[0] = col[0]; 8957 out[1] = col[1]; 8958 out[2] = col[2]; 8959 } 8960 8961 @Override 8962 public Type type() { 8963 return Type.SEQUENTIAL; 8964 } 8965 8966 @Override 8967 public Mode mode() { 8968 return Mode.DISCRETE; 8969 } 8970 }, 8971 8972 /** 8973 * ColorBrewer "YlOrRd" colour map with 6 colours. See <a 8974 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 8975 * information. 8976 */ 8977 YlOrRd6 { 8978 private final float[][] cols = { { 255f / 265f, 255f / 265f, 178f / 265f }, 8979 { 254f / 265f, 217f / 265f, 118f / 265f }, { 254f / 265f, 178f / 265f, 76f / 265f }, 8980 { 253f / 265f, 141f / 265f, 60f / 265f }, { 240f / 265f, 59f / 265f, 32f / 265f }, 8981 { 189f / 265f, 0f / 265f, 38f / 265f } }; 8982 8983 @Override 8984 public void apply(float x, float[] out) { 8985 final int i = Math.min((int) (x * cols.length), cols.length - 1); 8986 8987 final float[] col = cols[i]; 8988 8989 out[0] = col[0]; 8990 out[1] = col[1]; 8991 out[2] = col[2]; 8992 } 8993 8994 @Override 8995 public Type type() { 8996 return Type.SEQUENTIAL; 8997 } 8998 8999 @Override 9000 public Mode mode() { 9001 return Mode.DISCRETE; 9002 } 9003 }, 9004 9005 /** 9006 * ColorBrewer "YlOrRd" colour map with 7 colours. See <a 9007 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 9008 * information. 9009 */ 9010 YlOrRd7 { 9011 private final float[][] cols = { { 255f / 265f, 255f / 265f, 178f / 265f }, 9012 { 254f / 265f, 217f / 265f, 118f / 265f }, { 254f / 265f, 178f / 265f, 76f / 265f }, 9013 { 253f / 265f, 141f / 265f, 60f / 265f }, { 252f / 265f, 78f / 265f, 42f / 265f }, 9014 { 227f / 265f, 26f / 265f, 28f / 265f }, { 177f / 265f, 0f / 265f, 38f / 265f } }; 9015 9016 @Override 9017 public void apply(float x, float[] out) { 9018 final int i = Math.min((int) (x * cols.length), cols.length - 1); 9019 9020 final float[] col = cols[i]; 9021 9022 out[0] = col[0]; 9023 out[1] = col[1]; 9024 out[2] = col[2]; 9025 } 9026 9027 @Override 9028 public Type type() { 9029 return Type.SEQUENTIAL; 9030 } 9031 9032 @Override 9033 public Mode mode() { 9034 return Mode.DISCRETE; 9035 } 9036 }, 9037 9038 /** 9039 * ColorBrewer "YlOrRd" colour map with 8 colours. See <a 9040 * href="http://colorbrewer2.org">the colorbrewer website</a> for more 9041 * information. 9042 */ 9043 YlOrRd8 { 9044 private final float[][] cols = { { 255f / 265f, 255f / 265f, 204f / 265f }, 9045 { 255f / 265f, 237f / 265f, 160f / 265f }, { 254f / 265f, 217f / 265f, 118f / 265f }, 9046 { 254f / 265f, 178f / 265f, 76f / 265f }, { 253f / 265f, 141f / 265f, 60f / 265f }, 9047 { 252f / 265f, 78f / 265f, 42f / 265f }, { 227f / 265f, 26f / 265f, 28f / 265f }, 9048 { 177f / 265f, 0f / 265f, 38f / 265f } }; 9049 9050 @Override 9051 public void apply(float x, float[] out) { 9052 final int i = Math.min((int) (x * cols.length), cols.length - 1); 9053 9054 final float[] col = cols[i]; 9055 9056 out[0] = col[0]; 9057 out[1] = col[1]; 9058 out[2] = col[2]; 9059 } 9060 9061 @Override 9062 public Type type() { 9063 return Type.SEQUENTIAL; 9064 } 9065 9066 @Override 9067 public Mode mode() { 9068 return Mode.DISCRETE; 9069 } 9070 }; 9071 9072 /** 9073 * Apply a colourmap to a single pixel 9074 * 9075 * @param val 9076 * the pixel value 9077 * @param out 9078 * the mapped colour 9079 */ 9080 public abstract void apply(float val, float[] out); 9081 9082 /** 9083 * Apply a colourmap to a single pixel 9084 * 9085 * @param val 9086 * the pixel value 9087 * @return the mapped colour 9088 */ 9089 public Float[] apply(float val) { 9090 final float[] out = new float[3]; 9091 apply(val, out); 9092 return new Float[] { out[0], out[1], out[2] }; 9093 } 9094 9095 /** 9096 * Apply a colourmap to an image 9097 * 9098 * @param img 9099 * the image to map 9100 * @return the mapped image 9101 */ 9102 public MBFImage apply(FImage img) { 9103 final float[] pixOut = new float[3]; 9104 9105 final int width = img.width; 9106 final int height = img.height; 9107 final float[][] pix = img.pixels; 9108 9109 final MBFImage out = new MBFImage(width, height, ColourSpace.RGB); 9110 final float[][] r = out.getBand(0).pixels; 9111 final float[][] g = out.getBand(1).pixels; 9112 final float[][] b = out.getBand(2).pixels; 9113 9114 for (int y = 0; y < height; y++) { 9115 for (int x = 0; x < width; x++) { 9116 apply(pix[y][x], pixOut); 9117 9118 r[y][x] = pixOut[0]; 9119 g[y][x] = pixOut[1]; 9120 b[y][x] = pixOut[2]; 9121 } 9122 } 9123 9124 return out; 9125 } 9126 9127 /** 9128 * @return the type of colour map 9129 */ 9130 public abstract Type type(); 9131 9132 /** 9133 * @return the mapping mode 9134 */ 9135 public abstract Mode mode(); 9136 9137 /** 9138 * Generate an image to visualise the color map. The image shows vertical 9139 * bands with increasing values from 0 on the left to 1.0 on the right. 9140 * 9141 * @param width 9142 * the width of the visualisation image in pixels 9143 * @param height 9144 * the height of the visualisation image in pixels 9145 * @return the visualisation of the color map 9146 */ 9147 public MBFImage visualise(int width, int height) { 9148 final FImage f = new FImage(width, height); 9149 9150 for (int y = 0; y < height; y++) { 9151 for (int x = 0; x < width; x++) { 9152 f.pixels[y][x] = (float) x / (float) width; 9153 } 9154 } 9155 9156 return this.apply(f); 9157 } 9158 9159 /** 9160 * Generate an image to visualise the color map. The image shows vertical 9161 * bands with increasing values from 0 on the left to 1.0 on the right. The 9162 * generated image is 256*100 pixels. 9163 * 9164 * @return the visualisation of the color map 9165 */ 9166 public MBFImage visualise() { 9167 return this.visualise(256, 100); 9168 } 9169 9170 /** 9171 * Generate a list of colours using a colour map 9172 * 9173 * @param ncolours 9174 * the number of colours to generate 9175 * @return the colours 9176 */ 9177 public Float[][] generateColours(int ncolours) { 9178 final Float[][] cm = new Float[ncolours][]; 9179 9180 // if the colourmap is cyclic, we don't want the generated colours to 9181 // wrap 9182 cm[0] = this.apply(0); 9183 cm[ncolours - 1] = this.apply(1); 9184 9185 boolean same = false; 9186 for (int i = 0; i < cm[0].length; i++) { 9187 if (Math.abs(cm[0][i] - cm[ncolours - 1][i]) < 0.00001) { 9188 same = true; 9189 break; 9190 } 9191 } 9192 9193 if (same) { 9194 for (int i = 1; i < ncolours; i++) { 9195 cm[i] = this.apply(i / (float) (ncolours)); 9196 } 9197 } else { 9198 for (int i = 1; i < ncolours - 1; i++) { 9199 cm[i] = this.apply(i / (float) (ncolours - 1)); 9200 } 9201 } 9202 return cm; 9203 } 9204 9205 /** 9206 * Types of colour map. 9207 * <p> 9208 * The descriptions of the different types are taken from <a 9209 * href="http://colorbrewer2.org">the colorbrewer website</a> 9210 */ 9211 public static enum Type { 9212 /** 9213 * Sequential maps are suited to ordered data that progresses from low 9214 * to high. The maps use light colors for low values and darker colors 9215 * for higher values. 9216 */ 9217 SEQUENTIAL, 9218 /** 9219 * Qualitative maps do not imply magnitude differences between classes. 9220 * Hues are used to create the primary visual differences between 9221 * classes. Qualitative schemes are best suited to representing nominal 9222 * or categorical data. 9223 */ 9224 QUALITATIVE, 9225 /** 9226 * Diverging schemes put equal emphasis on mid-range critical values and 9227 * extremes at both ends of the data range. The critical class or break 9228 * in the middle of the legend is emphasized with light colors and low 9229 * and high extremes are emphasized with dark colors that have 9230 * contrasting hues. 9231 */ 9232 DIVERGING 9233 } 9234 9235 /** 9236 * Colour map modes. Maps produce either interpolated colours or discrete 9237 * colours. 9238 * 9239 * @author Jonathon Hare (jsh2@ecs.soton.ac.uk) 9240 */ 9241 public static enum Mode { 9242 /** 9243 * Interpolated colour map 9244 */ 9245 INTERPOLATED, 9246 /** 9247 * Discrete colour map 9248 */ 9249 DISCRETE 9250 } 9251 9252 // Generate the colorbrewer maps from a CSV file 9253 // public static void main(String[] args) throws IOException { 9254 // List<String> lines = FileUtils.readLines(new 9255 // File("/Users/jon/Desktop/ColorBrewer_all_schemes_RGBonly3.csv")); 9256 // 9257 // //ColorName,NumOfColors,Type,CritVal,ColorNum,ColorLetter,R,G,B,SchemeType 9258 // 9259 // String currentName = null; 9260 // String currentMode = null; 9261 // int currNum = 0; 9262 // List<int[]> currentColStack = null; 9263 // 9264 // for (String line : lines) { 9265 // String[] split = line.split(","); 9266 // 9267 // if (split[0].length() > 0) { 9268 // if (currentColStack != null) { 9269 // String fmt = 9270 // " /**" + "\n" + 9271 // " * ColorBrewer \"%s\" colour map with %d colours." + "\n" + 9272 // " * See <a href=\"http://colorbrewer2.org\">the colorbrewer website</a> for more information." 9273 // + "\n" + 9274 // " */" + "\n" + 9275 // " %s {" + "\n" + 9276 // " private final float[][] cols = {%s};" + "\n" + 9277 // " " + "\n" + 9278 // " @Override" + "\n" + 9279 // " public void apply(float x, float[] out) {" + "\n" + 9280 // " int i = Math.min((int) (x * cols.length), cols.length-1);" + "\n" + 9281 // " " + "\n" + 9282 // " float[] col = cols[i];" + "\n" + 9283 // " " + "\n" + 9284 // " out[0] = col[0];" + "\n" + 9285 // " out[1] = col[1];" + "\n" + 9286 // " out[2] = col[2];" + "\n" + 9287 // " }" + "\n" + 9288 // "" + "\n" + 9289 // " @Override" + "\n" + 9290 // " public Type type() {" + "\n" + 9291 // " return Type.%s;" + "\n" + 9292 // " }" + "\n" + 9293 // "" + "\n" + 9294 // " @Override" + "\n" + 9295 // " public Mode mode() {" + "\n" + 9296 // " return Mode.DISCRETE;" + "\n" + 9297 // " }" + "\n" + 9298 // " }," + "\n"; 9299 // 9300 // String name = currentName+currNum; 9301 // String type = currentMode.equals("qual") ? "QUALITATIVE" : 9302 // currentMode.equals("seq") ? "SEQUENTIAL" : "DIVERGING"; 9303 // 9304 // String cols = ""; 9305 // for (int i=0; i<currNum-1; i++) { 9306 // cols += "{" + currentColStack.get(i)[0] + "f/265f, " + 9307 // currentColStack.get(i)[1] + "f/265f, " + currentColStack.get(i)[2] + 9308 // "f/265f}, "; 9309 // } 9310 // cols += "{" + currentColStack.get(currNum-1)[0] + "f/265f, " + 9311 // currentColStack.get(currNum-1)[1] + "f/265f, " + 9312 // currentColStack.get(currNum-1)[2] + "f/265f}"; 9313 // 9314 // 9315 // System.out.println(String.format(fmt, currentName, currNum, name, cols, 9316 // type)); 9317 // } 9318 // 9319 // currentColStack = new ArrayList<int[]>(); 9320 // currNum = Integer.parseInt(split[1]); 9321 // currentName = split[0]; 9322 // currentMode = split[2]; 9323 // } 9324 // 9325 // int [] col = {Integer.parseInt(split[6]), Integer.parseInt(split[7]), 9326 // Integer.parseInt(split[8])}; 9327 // currentColStack.add(col); 9328 // } 9329 // } 9330}