1 43 44 package org.jfree.chart.plot; 45 46 import java.io.Serializable ; 47 48 49 57 public class RainbowPalette extends ColorPalette implements Serializable { 58 59 60 private static final long serialVersionUID = -1906707320728242478L; 61 62 63 private int[] red = {255, 0, 120, 115, 111, 106, 102, 97, 64 93, 88, 84, 79, 75, 70, 66, 61, 65 57, 52, 48, 43, 39, 34, 30, 25, 66 21, 16, 12, 7, 3, 0, 0, 0, 67 0, 0, 0, 0, 0, 0, 0, 0, 68 0, 0, 0, 0, 0, 0, 0, 0, 69 0, 0, 0, 0, 0, 0, 0, 0, 70 0, 0, 0, 0, 0, 0, 0, 0, 71 0, 0, 0, 0, 0, 0, 0, 0, 72 0, 0, 0, 0, 0, 0, 0, 0, 73 0, 0, 0, 0, 0, 0, 0, 0, 74 0, 0, 0, 0, 0, 0, 0, 0, 75 0, 0, 0, 0, 0, 0, 0, 0, 76 0, 0, 0, 0, 0, 0, 0, 0, 77 0, 0, 0, 0, 0, 0, 0, 0, 78 0, 0, 0, 0, 0, 0, 0, 0, 79 0, 0, 0, 0, 0, 0, 0, 0, 80 0, 0, 0, 0, 0, 0, 1, 5, 81 10, 14, 19, 23, 28, 32, 37, 41, 82 46, 50, 55, 59, 64, 68, 73, 77, 83 82, 86, 91, 95, 100, 104, 109, 113, 84 118, 123, 127, 132, 136, 141, 145, 150, 85 154, 159, 163, 168, 172, 177, 181, 186, 86 190, 195, 199, 204, 208, 213, 217, 222, 87 226, 231, 235, 240, 244, 249, 253, 255, 88 255, 255, 255, 255, 255, 255, 255, 255, 89 255, 255, 255, 255, 255, 255, 255, 255, 90 255, 255, 255, 255, 255, 255, 255, 255, 91 255, 255, 255, 255, 255, 255, 255, 255, 92 255, 255, 255, 255, 255, 255, 255, 255, 93 255, 255, 255, 255, 255, 255, 255, 255, 94 255, 255, 255, 255, 255, 255, 255, 255}; 95 96 97 private int[] green = {255, 0, 0, 0, 0, 0, 0, 0, 98 0, 0, 0, 0, 0, 0, 0, 0, 99 0, 0, 0, 0, 0, 0, 0, 0, 100 0, 0, 0, 0, 0, 2, 6, 11, 101 15, 20, 24, 29, 33, 38, 42, 47, 102 51, 56, 60, 65, 69, 74, 78, 83, 103 87, 92, 96, 101, 105, 110, 114, 119, 104 123, 128, 132, 137, 141, 146, 150, 155, 105 159, 164, 168, 173, 177, 182, 186, 191, 106 195, 200, 204, 209, 213, 218, 222, 227, 107 231, 236, 241, 245, 250, 254, 255, 255, 108 255, 255, 255, 255, 255, 255, 255, 255, 109 255, 255, 255, 255, 255, 255, 255, 255, 110 255, 255, 255, 255, 255, 255, 255, 255, 111 255, 255, 255, 255, 255, 255, 255, 255, 112 255, 255, 255, 255, 255, 255, 255, 255, 113 255, 255, 255, 255, 255, 255, 255, 255, 114 255, 255, 255, 255, 255, 255, 255, 255, 115 255, 255, 255, 255, 255, 255, 255, 255, 116 255, 255, 255, 255, 255, 255, 255, 255, 117 255, 255, 255, 255, 255, 255, 255, 255, 118 255, 255, 255, 255, 255, 255, 255, 255, 119 255, 255, 255, 255, 255, 255, 255, 255, 120 255, 255, 255, 255, 255, 255, 255, 255, 121 255, 255, 255, 255, 255, 255, 255, 252, 122 248, 243, 239, 234, 230, 225, 221, 216, 123 212, 207, 203, 198, 194, 189, 185, 180, 124 176, 171, 167, 162, 158, 153, 149, 144, 125 140, 135, 131, 126, 122, 117, 113, 108, 126 104, 99, 95, 90, 86, 81, 77, 72, 127 68, 63, 59, 54, 50, 45, 41, 36, 128 32, 27, 23, 18, 14, 9, 5, 0}; 129 130 131 private int[] blue = {255, 0, 255, 255, 255, 255, 255, 255, 132 255, 255, 255, 255, 255, 255, 255, 255, 133 255, 255, 255, 255, 255, 255, 255, 255, 134 255, 255, 255, 255, 255, 255, 255, 255, 135 255, 255, 255, 255, 255, 255, 255, 255, 136 255, 255, 255, 255, 255, 255, 255, 255, 137 255, 255, 255, 255, 255, 255, 255, 255, 138 255, 255, 255, 255, 255, 255, 255, 255, 139 255, 255, 255, 255, 255, 255, 255, 255, 140 255, 255, 255, 255, 255, 255, 255, 255, 141 255, 255, 255, 255, 255, 255, 251, 247, 142 242, 238, 233, 229, 224, 220, 215, 211, 143 206, 202, 197, 193, 188, 184, 179, 175, 144 170, 166, 161, 157, 152, 148, 143, 139, 145 134, 130, 125, 121, 116, 112, 107, 103, 146 98, 94, 89, 85, 80, 76, 71, 67, 147 62, 58, 53, 49, 44, 40, 35, 31, 148 26, 22, 17, 13, 8, 4, 0, 0, 149 0, 0, 0, 0, 0, 0, 0, 0, 150 0, 0, 0, 0, 0, 0, 0, 0, 151 0, 0, 0, 0, 0, 0, 0, 0, 152 0, 0, 0, 0, 0, 0, 0, 0, 153 0, 0, 0, 0, 0, 0, 0, 0, 154 0, 0, 0, 0, 0, 0, 0, 0, 155 0, 0, 0, 0, 0, 0, 0, 0, 156 0, 0, 0, 0, 0, 0, 0, 0, 157 0, 0, 0, 0, 0, 0, 0, 0, 158 0, 0, 0, 0, 0, 0, 0, 0, 159 0, 0, 0, 0, 0, 0, 0, 0, 160 0, 0, 0, 0, 0, 0, 0, 0, 161 0, 0, 0, 0, 0, 0, 0, 0, 162 0, 0, 0, 0, 0, 0, 0, 0}; 163 164 167 public RainbowPalette() { 168 super(); 169 initialize(); 170 } 171 172 175 public void initialize() { 176 177 setPaletteName("Rainbow"); 178 179 this.r = new int[this.red.length]; 180 this.g = new int[this.green.length]; 181 this.b = new int[this.blue.length]; 182 System.arraycopy(this.red, 0, this.r, 0, this.red.length); 183 System.arraycopy(this.green, 0, this.g, 0, this.green.length); 184 System.arraycopy(this.blue, 0, this.b, 0, this.blue.length); 185 186 } 187 188 } 189 | Popular Tags |