KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hssf > util > HSSFColor


1 /* ====================================================================
2    Copyright 2002-2004 Apache Software Foundation
3
4    Licensed under the Apache License, Version 2.0 (the "License");
5    you may not use this file except in compliance with the License.
6    You may obtain a copy of the License at
7
8        http://www.apache.org/licenses/LICENSE-2.0
9
10    Unless required by applicable law or agreed to in writing, software
11    distributed under the License is distributed on an "AS IS" BASIS,
12    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    See the License for the specific language governing permissions and
14    limitations under the License.
15 ==================================================================== */

16
17
18 package org.apache.poi.hssf.util;
19
20 import java.util.*;
21
22 /**
23  * Intends to provide support for the very evil index to triplet issue and
24  * will likely replace the color contants interface for HSSF 2.0.
25  * This class contains static inner class members for representing colors.
26  * Each color has an index (for the standard palette in Excel (tm) ),
27  * native (RGB) triplet and string triplet. The string triplet is as the
28  * color would be represented by Gnumeric. Having (string) this here is a bit of a
29  * collusion of function between HSSF and the HSSFSerializer but I think its
30  * a reasonable one in this case.
31  *
32  * @author Andrew C. Oliver (acoliver at apache dot org)
33  * @author Brian Sanders (bsanders at risklabs dot com) - full default color palette
34  */

35
36 public class HSSFColor
37 {
38     private final static int PALETTE_SIZE = 56;
39     private final static int DISTINCT_COLOR_COUNT = 46;
40
41     /** Creates a new instance of HSSFColor */
42
43     public HSSFColor()
44     {
45     }
46
47     /**
48      * this function returns all colors in a hastable. Its not implemented as a
49      * static member/staticly initialized because that would be dirty in a
50      * server environment as it is intended. This means you'll eat the time
51      * it takes to create it once per request but you will not hold onto it
52      * if you have none of those requests.
53      *
54      * @return a hashtable containing all colors mapped to their excel-style
55      * pallette index
56      */

57     public final static Hashtable getIndexHash() {
58
59         Hashtable hash = new Hashtable(PALETTE_SIZE);
60
61         hash.put(new Integer JavaDoc(HSSFColor.BLACK.index), new HSSFColor.BLACK());
62         hash.put(new Integer JavaDoc(HSSFColor.BROWN.index), new HSSFColor.BROWN());
63         hash.put(new Integer JavaDoc(HSSFColor.OLIVE_GREEN.index),
64                  new HSSFColor.OLIVE_GREEN());
65         hash.put(new Integer JavaDoc(HSSFColor.DARK_GREEN.index), new HSSFColor.DARK_GREEN());
66         hash.put(new Integer JavaDoc(HSSFColor.DARK_TEAL.index), new HSSFColor.DARK_TEAL());
67         hash.put(new Integer JavaDoc(HSSFColor.DARK_BLUE.index), new HSSFColor.DARK_BLUE());
68         hash.put(new Integer JavaDoc(HSSFColor.DARK_BLUE.index2), new HSSFColor.DARK_BLUE());
69         hash.put(new Integer JavaDoc(HSSFColor.INDIGO.index), new HSSFColor.INDIGO());
70         hash.put(new Integer JavaDoc(HSSFColor.GREY_80_PERCENT.index),
71                  new HSSFColor.GREY_80_PERCENT());
72         hash.put(new Integer JavaDoc(HSSFColor.ORANGE.index), new HSSFColor.ORANGE());
73         hash.put(new Integer JavaDoc(HSSFColor.DARK_YELLOW.index),
74                  new HSSFColor.DARK_YELLOW());
75         hash.put(new Integer JavaDoc(HSSFColor.GREEN.index), new HSSFColor.GREEN());
76         hash.put(new Integer JavaDoc(HSSFColor.TEAL.index), new HSSFColor.TEAL());
77         hash.put(new Integer JavaDoc(HSSFColor.TEAL.index2), new HSSFColor.TEAL());
78         hash.put(new Integer JavaDoc(HSSFColor.BLUE.index), new HSSFColor.BLUE());
79         hash.put(new Integer JavaDoc(HSSFColor.BLUE.index2), new HSSFColor.BLUE());
80         hash.put(new Integer JavaDoc(HSSFColor.BLUE_GREY.index), new HSSFColor.BLUE_GREY());
81         hash.put(new Integer JavaDoc(HSSFColor.GREY_50_PERCENT.index),
82                  new HSSFColor.GREY_50_PERCENT());
83         hash.put(new Integer JavaDoc(HSSFColor.RED.index), new HSSFColor.RED());
84         hash.put(new Integer JavaDoc(HSSFColor.LIGHT_ORANGE.index),
85                  new HSSFColor.LIGHT_ORANGE());
86         hash.put(new Integer JavaDoc(HSSFColor.LIME.index), new HSSFColor.LIME());
87         hash.put(new Integer JavaDoc(HSSFColor.SEA_GREEN.index), new HSSFColor.SEA_GREEN());
88         hash.put(new Integer JavaDoc(HSSFColor.AQUA.index), new HSSFColor.AQUA());
89         hash.put(new Integer JavaDoc(HSSFColor.LIGHT_BLUE.index), new HSSFColor.LIGHT_BLUE());
90         hash.put(new Integer JavaDoc(HSSFColor.VIOLET.index), new HSSFColor.VIOLET());
91         hash.put(new Integer JavaDoc(HSSFColor.VIOLET.index2), new HSSFColor.VIOLET());
92         hash.put(new Integer JavaDoc(HSSFColor.GREY_40_PERCENT.index),
93                  new HSSFColor.GREY_40_PERCENT());
94         hash.put(new Integer JavaDoc(HSSFColor.PINK.index), new HSSFColor.PINK());
95         hash.put(new Integer JavaDoc(HSSFColor.PINK.index2), new HSSFColor.PINK());
96         hash.put(new Integer JavaDoc(HSSFColor.GOLD.index), new HSSFColor.GOLD());
97         hash.put(new Integer JavaDoc(HSSFColor.YELLOW.index), new HSSFColor.YELLOW());
98         hash.put(new Integer JavaDoc(HSSFColor.YELLOW.index2), new HSSFColor.YELLOW());
99         hash.put(new Integer JavaDoc(HSSFColor.BRIGHT_GREEN.index),
100                  new HSSFColor.BRIGHT_GREEN());
101         hash.put(new Integer JavaDoc(HSSFColor.BRIGHT_GREEN.index2),
102                  new HSSFColor.BRIGHT_GREEN());
103         hash.put(new Integer JavaDoc(HSSFColor.TURQUOISE.index), new HSSFColor.TURQUOISE());
104         hash.put(new Integer JavaDoc(HSSFColor.TURQUOISE.index2), new HSSFColor.TURQUOISE());
105         hash.put(new Integer JavaDoc(HSSFColor.DARK_RED.index), new HSSFColor.DARK_RED());
106         hash.put(new Integer JavaDoc(HSSFColor.DARK_RED.index2), new HSSFColor.DARK_RED());
107         hash.put(new Integer JavaDoc(HSSFColor.SKY_BLUE.index), new HSSFColor.SKY_BLUE());
108         hash.put(new Integer JavaDoc(HSSFColor.PLUM.index), new HSSFColor.PLUM());
109         hash.put(new Integer JavaDoc(HSSFColor.PLUM.index2), new HSSFColor.PLUM());
110         hash.put(new Integer JavaDoc(HSSFColor.GREY_25_PERCENT.index),
111                  new HSSFColor.GREY_25_PERCENT());
112         hash.put(new Integer JavaDoc(HSSFColor.ROSE.index), new HSSFColor.ROSE());
113         hash.put(new Integer JavaDoc(HSSFColor.LIGHT_YELLOW.index),
114                  new HSSFColor.LIGHT_YELLOW());
115         hash.put(new Integer JavaDoc(HSSFColor.LIGHT_GREEN.index),
116                  new HSSFColor.LIGHT_GREEN());
117         hash.put(new Integer JavaDoc(HSSFColor.LIGHT_TURQUOISE.index),
118                  new HSSFColor.LIGHT_TURQUOISE());
119         hash.put(new Integer JavaDoc(HSSFColor.LIGHT_TURQUOISE.index2),
120                  new HSSFColor.LIGHT_TURQUOISE());
121         hash.put(new Integer JavaDoc(HSSFColor.PALE_BLUE.index), new HSSFColor.PALE_BLUE());
122         hash.put(new Integer JavaDoc(HSSFColor.LAVENDER.index), new HSSFColor.LAVENDER());
123         hash.put(new Integer JavaDoc(HSSFColor.WHITE.index), new HSSFColor.WHITE());
124         hash.put(new Integer JavaDoc(HSSFColor.CORNFLOWER_BLUE.index),
125                  new HSSFColor.CORNFLOWER_BLUE());
126         hash.put(new Integer JavaDoc(HSSFColor.LEMON_CHIFFON.index),
127                  new HSSFColor.LEMON_CHIFFON());
128         hash.put(new Integer JavaDoc(HSSFColor.MAROON.index), new HSSFColor.MAROON());
129         hash.put(new Integer JavaDoc(HSSFColor.ORCHID.index), new HSSFColor.ORCHID());
130         hash.put(new Integer JavaDoc(HSSFColor.CORAL.index), new HSSFColor.CORAL());
131         hash.put(new Integer JavaDoc(HSSFColor.ROYAL_BLUE.index), new HSSFColor.ROYAL_BLUE());
132         hash.put(new Integer JavaDoc(HSSFColor.LIGHT_CORNFLOWER_BLUE.index),
133                  new HSSFColor.LIGHT_CORNFLOWER_BLUE());
134     return hash;
135     }
136
137     /**
138      * this function returns all colors in a hastable. Its not implemented as a
139      * static member/staticly initialized because that would be dirty in a
140      * server environment as it is intended. This means you'll eat the time
141      * it takes to create it once per request but you will not hold onto it
142      * if you have none of those requests.
143      *
144      * @return a hashtable containing all colors mapped to their gnumeric-like
145      * triplet string
146      */

147
148     public final static Hashtable getTripletHash()
149     {
150         Hashtable hash = new Hashtable(DISTINCT_COLOR_COUNT);
151
152         hash.put(HSSFColor.BLACK.hexString, new HSSFColor.BLACK());
153         hash.put(HSSFColor.BROWN.hexString, new HSSFColor.BROWN());
154         hash.put(HSSFColor.OLIVE_GREEN.hexString,
155                  new HSSFColor.OLIVE_GREEN());
156         hash.put(HSSFColor.DARK_GREEN.hexString, new HSSFColor.DARK_GREEN());
157         hash.put(HSSFColor.DARK_TEAL.hexString, new HSSFColor.DARK_TEAL());
158         hash.put(HSSFColor.DARK_BLUE.hexString, new HSSFColor.DARK_BLUE());
159         hash.put(HSSFColor.INDIGO.hexString, new HSSFColor.INDIGO());
160         hash.put(HSSFColor.GREY_80_PERCENT.hexString,
161                  new HSSFColor.GREY_80_PERCENT());
162         hash.put(HSSFColor.ORANGE.hexString, new HSSFColor.ORANGE());
163         hash.put(HSSFColor.DARK_YELLOW.hexString,
164                  new HSSFColor.DARK_YELLOW());
165         hash.put(HSSFColor.GREEN.hexString, new HSSFColor.GREEN());
166         hash.put(HSSFColor.TEAL.hexString, new HSSFColor.TEAL());
167         hash.put(HSSFColor.BLUE.hexString, new HSSFColor.BLUE());
168         hash.put(HSSFColor.BLUE_GREY.hexString, new HSSFColor.BLUE_GREY());
169         hash.put(HSSFColor.GREY_50_PERCENT.hexString,
170                  new HSSFColor.GREY_50_PERCENT());
171         hash.put(HSSFColor.RED.hexString, new HSSFColor.RED());
172         hash.put(HSSFColor.LIGHT_ORANGE.hexString,
173                  new HSSFColor.LIGHT_ORANGE());
174         hash.put(HSSFColor.LIME.hexString, new HSSFColor.LIME());
175         hash.put(HSSFColor.SEA_GREEN.hexString, new HSSFColor.SEA_GREEN());
176         hash.put(HSSFColor.AQUA.hexString, new HSSFColor.AQUA());
177         hash.put(HSSFColor.LIGHT_BLUE.hexString, new HSSFColor.LIGHT_BLUE());
178         hash.put(HSSFColor.VIOLET.hexString, new HSSFColor.VIOLET());
179         hash.put(HSSFColor.GREY_40_PERCENT.hexString,
180                  new HSSFColor.GREY_40_PERCENT());
181         hash.put(HSSFColor.PINK.hexString, new HSSFColor.PINK());
182         hash.put(HSSFColor.GOLD.hexString, new HSSFColor.GOLD());
183         hash.put(HSSFColor.YELLOW.hexString, new HSSFColor.YELLOW());
184         hash.put(HSSFColor.BRIGHT_GREEN.hexString,
185                  new HSSFColor.BRIGHT_GREEN());
186         hash.put(HSSFColor.BRIGHT_GREEN.hexString, new HSSFColor.TURQUOISE());
187         hash.put(HSSFColor.DARK_RED.hexString, new HSSFColor.DARK_RED());
188         hash.put(HSSFColor.SKY_BLUE.hexString, new HSSFColor.SKY_BLUE());
189         hash.put(HSSFColor.PLUM.hexString, new HSSFColor.PLUM());
190         hash.put(HSSFColor.GREY_25_PERCENT.hexString,
191                  new HSSFColor.GREY_25_PERCENT());
192         hash.put(HSSFColor.ROSE.hexString, new HSSFColor.ROSE());
193         hash.put(HSSFColor.LIGHT_YELLOW.hexString,
194                  new HSSFColor.LIGHT_YELLOW());
195         hash.put(HSSFColor.LIGHT_GREEN.hexString,
196                  new HSSFColor.LIGHT_GREEN());
197         hash.put(HSSFColor.LIGHT_TURQUOISE.hexString,
198                  new HSSFColor.LIGHT_TURQUOISE());
199         hash.put(HSSFColor.PALE_BLUE.hexString, new HSSFColor.PALE_BLUE());
200         hash.put(HSSFColor.LAVENDER.hexString, new HSSFColor.LAVENDER());
201         hash.put(HSSFColor.WHITE.hexString, new HSSFColor.WHITE());
202         hash.put(HSSFColor.CORNFLOWER_BLUE.hexString, new HSSFColor.CORNFLOWER_BLUE());
203         hash.put(HSSFColor.LEMON_CHIFFON.hexString, new HSSFColor.LEMON_CHIFFON());
204         hash.put(HSSFColor.MAROON.hexString, new HSSFColor.MAROON());
205         hash.put(HSSFColor.ORCHID.hexString, new HSSFColor.ORCHID());
206         hash.put(HSSFColor.CORAL.hexString, new HSSFColor.CORAL());
207         hash.put(HSSFColor.ROYAL_BLUE.hexString, new HSSFColor.ROYAL_BLUE());
208         hash.put(HSSFColor.LIGHT_CORNFLOWER_BLUE.hexString,
209                  new HSSFColor.LIGHT_CORNFLOWER_BLUE());
210         return hash;
211     }
212
213     /**
214      * @return index to the standard palette
215      */

216
217     public short getIndex()
218     {
219         return BLACK.index;
220     }
221
222     /**
223      * @return triplet representation like that in Excel
224      */

225
226     public short [] getTriplet()
227     {
228         return BLACK.triplet;
229     }
230
231     // its a hack but its a good hack
232

233     /**
234      * @return a hex string exactly like a gnumeric triplet
235      */

236
237     public String JavaDoc getHexString()
238     {
239         return BLACK.hexString;
240     }
241
242     /**
243      * Class BLACK
244      *
245      */

246
247     public final static class BLACK
248         extends HSSFColor
249     {
250         public final static short index = 0x8;
251         public final static short[] triplet =
252         {
253             0, 0, 0
254         };
255         public final static String JavaDoc hexString = "0:0:0";
256
257         public short getIndex()
258         {
259             return index;
260         }
261
262         public short [] getTriplet()
263         {
264             return triplet;
265         }
266
267         public String JavaDoc getHexString()
268         {
269             return hexString;
270         }
271     }
272
273     /**
274      * Class BROWN
275      *
276      */

277
278     public final static class BROWN
279         extends HSSFColor
280     {
281         public final static short index = 0x3c;
282         public final static short[] triplet =
283         {
284             153, 51, 0
285         };
286         public final static String JavaDoc hexString = "9999:3333:0";
287
288         public short getIndex()
289         {
290             return index;
291         }
292
293         public short [] getTriplet()
294         {
295             return triplet;
296         }
297
298         public String JavaDoc getHexString()
299         {
300             return hexString;
301         }
302     }
303
304     /**
305      * Class OLIVE_GREEN
306      *
307      */

308
309     public static class OLIVE_GREEN
310         extends HSSFColor
311     {
312         public final static short index = 0x3b;
313         public final static short[] triplet =
314         {
315             51, 51, 0
316         };
317         public final static String JavaDoc hexString = "3333:3333:0";
318
319         public short getIndex()
320         {
321             return index;
322         }
323
324         public short [] getTriplet()
325         {
326             return triplet;
327         }
328
329         public String JavaDoc getHexString()
330         {
331             return hexString;
332         }
333     }
334
335     /**
336      * Class DARK_GREEN
337      *
338      */

339
340     public final static class DARK_GREEN
341         extends HSSFColor
342     {
343         public final static short index = 0x3a;
344         public final static short[] triplet =
345         {
346             0, 51, 0
347         };
348         public final static String JavaDoc hexString = "0:3333:0";
349
350         public short getIndex()
351         {
352             return index;
353         }
354
355         public short [] getTriplet()
356         {
357             return triplet;
358         }
359
360         public String JavaDoc getHexString()
361         {
362             return hexString;
363         }
364     }
365
366     /**
367      * Class DARK_TEAL
368      *
369      */

370
371     public final static class DARK_TEAL
372         extends HSSFColor
373     {
374         public final static short index = 0x38;
375         public final static short[] triplet =
376         {
377             0, 51, 102
378         };
379         public final static String JavaDoc hexString = "0:3333:6666";
380
381         public short getIndex()
382         {
383             return index;
384         }
385
386         public short [] getTriplet()
387         {
388             return triplet;
389         }
390
391         public String JavaDoc getHexString()
392         {
393             return hexString;
394         }
395     }
396
397     /**
398      * Class DARK_BLUE
399      *
400      */

401
402     public final static class DARK_BLUE
403         extends HSSFColor
404     {
405         public final static short index = 0x12;
406         public final static short index2 = 0x20;
407         public final static short[] triplet =
408         {
409             0, 0, 128
410         };
411         public final static String JavaDoc hexString = "0:0:8080";
412
413         public short getIndex()
414         {
415             return index;
416         }
417
418         public short [] getTriplet()
419         {
420             return triplet;
421         }
422
423         public String JavaDoc getHexString()
424         {
425             return hexString;
426         }
427     }
428
429     /**
430      * Class INDIGO
431      *
432      */

433
434     public final static class INDIGO
435         extends HSSFColor
436     {
437         public final static short index = 0x3e;
438         public final static short[] triplet =
439         {
440             51, 51, 153
441         };
442         public final static String JavaDoc hexString = "3333:3333:9999";
443
444         public short getIndex()
445         {
446             return index;
447         }
448
449         public short [] getTriplet()
450         {
451             return triplet;
452         }
453
454         public String JavaDoc getHexString()
455         {
456             return hexString;
457         }
458     }
459
460     /**
461      * Class GREY_80_PERCENT
462      *
463      */

464
465     public final static class GREY_80_PERCENT
466         extends HSSFColor
467     {
468         public final static short index = 0x3f;
469         public final static short[] triplet =
470         {
471             51, 51, 51
472         };
473         public final static String JavaDoc hexString = "3333:3333:3333";
474
475         public short getIndex()
476         {
477             return index;
478         }
479
480         public short [] getTriplet()
481         {
482             return triplet;
483         }
484
485         public String JavaDoc getHexString()
486         {
487             return hexString;
488         }
489     }
490
491     /**
492      * Class DARK_RED
493      *
494      */

495
496     public final static class DARK_RED
497         extends HSSFColor
498     {
499         public final static short index = 0x10;
500         public final static short index2 = 0x25;
501         public final static short[] triplet =
502         {
503             128, 0, 0
504         };
505         public final static String JavaDoc hexString = "8080:0:0";
506
507         public short getIndex()
508         {
509             return index;
510         }
511
512         public short [] getTriplet()
513         {
514             return triplet;
515         }
516
517         public String JavaDoc getHexString()
518         {
519             return hexString;
520         }
521     }
522
523     /**
524      * Class ORANGE
525      *
526      */

527
528     public final static class ORANGE
529         extends HSSFColor
530     {
531         public final static short index = 0x35;
532         public final static short[] triplet =
533         {
534             255, 102, 0
535         };
536         public final static String JavaDoc hexString = "FFFF:6666:0";
537
538         public short getIndex()
539         {
540             return index;
541         }
542
543         public short [] getTriplet()
544         {
545             return triplet;
546         }
547
548         public String JavaDoc getHexString()
549         {
550             return hexString;
551         }
552     }
553
554     /**
555      * Class DARK_YELLOW
556      *
557      */

558
559     public final static class DARK_YELLOW
560         extends HSSFColor
561     {
562         public final static short index = 0x13;
563         public final static short[] triplet =
564         {
565             128, 128, 0
566         };
567         public final static String JavaDoc hexString = "8080:8080:0";
568
569         public short getIndex()
570         {
571             return index;
572         }
573
574         public short [] getTriplet()
575         {
576             return triplet;
577         }
578
579         public String JavaDoc getHexString()
580         {
581             return hexString;
582         }
583     }
584
585     /**
586      * Class GREEN
587      *
588      */

589
590     public final static class GREEN
591         extends HSSFColor
592     {
593         public final static short index = 0x11;
594         public final static short[] triplet =
595         {
596             0, 128, 0
597         };
598         public final static String JavaDoc hexString = "0:8080:0";
599
600         public short getIndex()
601         {
602             return index;
603         }
604
605         public short [] getTriplet()
606         {
607             return triplet;
608         }
609
610         public String JavaDoc getHexString()
611         {
612             return hexString;
613         }
614     }
615
616     /**
617      * Class TEAL
618      *
619      */

620
621     public final static class TEAL
622         extends HSSFColor
623     {
624         public final static short index = 0x15;
625         public final static short index2 = 0x26;
626         public final static short[] triplet =
627         {
628             0, 128, 128
629         };
630         public final static String JavaDoc hexString = "0:8080:8080";
631
632         public short getIndex()
633         {
634             return index;
635         }
636
637         public short [] getTriplet()
638         {
639             return triplet;
640         }
641
642         public String JavaDoc getHexString()
643         {
644             return hexString;
645         }
646     }
647
648     /**
649      * Class BLUE
650      *
651      */

652
653     public final static class BLUE
654         extends HSSFColor
655     {
656         public final static short index = 0xc;
657         public final static short index2 = 0x27;
658         public final static short[] triplet =
659         {
660             0, 0, 255
661         };
662         public final static String JavaDoc hexString = "0:0:FFFF";
663
664         public short getIndex()
665         {
666             return index;
667         }
668
669         public short [] getTriplet()
670         {
671             return triplet;
672         }
673
674         public String JavaDoc getHexString()
675         {
676             return hexString;
677         }
678     }
679
680     /**
681      * Class BLUE_GREY
682      *
683      */

684
685     public final static class BLUE_GREY
686         extends HSSFColor
687     {
688         public final static short index = 0x36;
689         public final static short[] triplet =
690         {
691             102, 102, 153
692         };
693         public final static String JavaDoc hexString = "6666:6666:9999";
694
695         public short getIndex()
696         {
697             return index;
698         }
699
700         public short [] getTriplet()
701         {
702             return triplet;
703         }
704
705         public String JavaDoc getHexString()
706         {
707             return hexString;
708         }
709     }
710
711     /**
712      * Class GREY_50_PERCENT
713      *
714      */

715
716     public final static class GREY_50_PERCENT
717         extends HSSFColor
718     {
719         public final static short index = 0x17;
720         public final static short[] triplet =
721         {
722             128, 128, 128
723         };
724         public final static String JavaDoc hexString = "8080:8080:8080";
725
726         public short getIndex()
727         {
728             return index;
729         }
730
731         public short [] getTriplet()
732         {
733             return triplet;
734         }
735
736         public String JavaDoc getHexString()
737         {
738             return hexString;
739         }
740     }
741
742     /**
743      * Class RED
744      *
745      */

746
747     public final static class RED
748         extends HSSFColor
749     {
750         public final static short index = 0xa;
751         public final static short[] triplet =
752         {
753             255, 0, 0
754         };
755         public final static String JavaDoc hexString = "FFFF:0:0";
756
757         public short getIndex()
758         {
759             return index;
760         }
761
762         public short [] getTriplet()
763         {
764             return triplet;
765         }
766
767         public String JavaDoc getHexString()
768         {
769             return hexString;
770         }
771     }
772
773     /**
774      * Class LIGHT_ORANGE
775      *
776      */

777
778     public final static class LIGHT_ORANGE
779         extends HSSFColor
780     {
781         public final static short index = 0x34;
782         public final static short[] triplet =
783         {
784             255, 153, 0
785         };
786         public final static String JavaDoc hexString = "FFFF:9999:0";
787
788         public short getIndex()
789         {
790             return index;
791         }
792
793         public short [] getTriplet()
794         {
795             return triplet;
796         }
797
798         public String JavaDoc getHexString()
799         {
800             return hexString;
801         }
802     }
803
804     /**
805      * Class LIME
806      *
807      */

808
809     public final static class LIME
810         extends HSSFColor
811     {
812         public final static short index = 0x32;
813         public final static short[] triplet =
814         {
815             153, 204, 0
816         };
817         public final static String JavaDoc hexString = "9999:CCCC:0";
818
819         public short getIndex()
820         {
821             return index;
822         }
823
824         public short [] getTriplet()
825         {
826             return triplet;
827         }
828
829         public String JavaDoc getHexString()
830         {
831             return hexString;
832         }
833     }
834
835     /**
836      * Class SEA_GREEN
837      *
838      */

839
840     public final static class SEA_GREEN
841         extends HSSFColor
842     {
843         public final static short index = 0x39;
844         public final static short[] triplet =
845         {
846             51, 153, 102
847         };
848         public final static String JavaDoc hexString = "3333:9999:6666";
849
850         public short getIndex()
851         {
852             return index;
853         }
854
855         public short [] getTriplet()
856         {
857             return triplet;
858         }
859
860         public String JavaDoc getHexString()
861         {
862             return hexString;
863         }
864     }
865
866     /**
867      * Class AQUA
868      *
869      */

870
871     public final static class AQUA
872         extends HSSFColor
873     {
874         public final static short index = 0x31;
875         public final static short[] triplet =
876         {
877             51, 204, 204
878         };
879         public final static String JavaDoc hexString = "3333:CCCC:CCCC";
880
881         public short getIndex()
882         {
883             return index;
884         }
885
886         public short [] getTriplet()
887         {
888             return triplet;
889         }
890
891         public String JavaDoc getHexString()
892         {
893             return hexString;
894         }
895     }
896
897     /**
898      * Class LIGHT_BLUE
899      *
900      */

901
902     public final static class LIGHT_BLUE
903         extends HSSFColor
904     {
905         public final static short index = 0x30;
906         public final static short[] triplet =
907         {
908             51, 102, 255
909         };
910         public final static String JavaDoc hexString = "3333:6666:FFFF";
911
912         public short getIndex()
913         {
914             return index;
915         }
916
917         public short [] getTriplet()
918         {
919             return triplet;
920         }
921
922         public String JavaDoc getHexString()
923         {
924             return hexString;
925         }
926     }
927
928     /**
929      * Class VIOLET
930      *
931      */

932
933     public final static class VIOLET
934         extends HSSFColor
935     {
936         public final static short index = 0x14;
937         public final static short index2 = 0x24;
938         public final static short[] triplet =
939         {
940             128, 0, 128
941         };
942         public final static String JavaDoc hexString = "8080:0:8080";
943
944         public short getIndex()
945         {
946             return index;
947         }
948
949         public short [] getTriplet()
950         {
951             return triplet;
952         }
953
954         public String JavaDoc getHexString()
955         {
956             return hexString;
957         }
958     }
959
960     /**
961      * Class GREY_40_PERCENT
962      *
963      */

964
965     public final static class GREY_40_PERCENT
966         extends HSSFColor
967     {
968         public final static short index = 0x37;
969         public final static short[] triplet =
970         {
971             150, 150, 150
972         };
973         public final static String JavaDoc hexString = "9696:9696:9696";
974
975         public short getIndex()
976         {
977             return index;
978         }
979
980         public short [] getTriplet()
981         {
982             return triplet;
983         }
984
985         public String JavaDoc getHexString()
986         {
987             return hexString;
988         }
989     }
990
991     /**
992      * Class PINK
993      *
994      */

995
996     public final static class PINK
997         extends HSSFColor
998     {
999         public final static short index = 0xe;
1000        public final static short index2 = 0x21;
1001        public final static short[] triplet =
1002        {
1003            255, 0, 255
1004        };
1005        public final static String JavaDoc hexString = "FFFF:0:FFFF";
1006
1007        public short getIndex()
1008        {
1009            return index;
1010        }
1011
1012        public short [] getTriplet()
1013        {
1014            return triplet;
1015        }
1016
1017        public String JavaDoc getHexString()
1018        {
1019            return hexString;
1020        }
1021    }
1022
1023    /**
1024     * Class GOLD
1025     *
1026     */

1027
1028    public final static class GOLD
1029        extends HSSFColor
1030    {
1031        public final static short index = 0x33;
1032        public final static short[] triplet =
1033        {
1034            255, 204, 0
1035        };
1036        public final static String JavaDoc hexString = "FFFF:CCCC:0";
1037
1038        public short getIndex()
1039        {
1040            return index;
1041        }
1042
1043        public short [] getTriplet()
1044        {
1045            return triplet;
1046        }
1047
1048        public String JavaDoc getHexString()
1049        {
1050            return hexString;
1051        }
1052    }
1053
1054    /**
1055     * Class YELLOW
1056     *
1057     */

1058
1059    public final static class YELLOW
1060        extends HSSFColor
1061    {
1062        public final static short index = 0xd;
1063        public final static short index2 = 0x22;
1064        public final static short[] triplet =
1065        {
1066            255, 255, 0
1067        };
1068        public final static String JavaDoc hexString = "FFFF:FFFF:0";
1069
1070        public short getIndex()
1071        {
1072            return index;
1073        }
1074
1075        public short [] getTriplet()
1076        {
1077            return triplet;
1078        }
1079
1080        public String JavaDoc getHexString()
1081        {
1082            return hexString;
1083        }
1084    }
1085
1086    /**
1087     * Class BRIGHT_GREEN
1088     *
1089     */

1090
1091    public final static class BRIGHT_GREEN
1092        extends HSSFColor
1093    {
1094        public final static short index = 0xb;
1095        public final static short index2 = 0x23;
1096        public final static short[] triplet =
1097        {
1098            0, 255, 0
1099        };
1100        public final static String JavaDoc hexString = "0:FFFF:0";
1101
1102        public short getIndex()
1103        {
1104            return index;
1105        }
1106
1107        public String JavaDoc getHexString()
1108        {
1109            return hexString;
1110        }
1111
1112        public short [] getTriplet()
1113        {
1114            return triplet;
1115        }
1116    }
1117
1118    /**
1119     * Class TURQUOISE
1120     *
1121     */

1122
1123    public final static class TURQUOISE
1124        extends HSSFColor
1125    {
1126        public final static short index = 0xf;
1127        public final static short index2 = 0x23;
1128        public final static short[] triplet =
1129        {
1130            0, 255, 255
1131        };
1132        public final static String JavaDoc hexString = "0:FFFF:FFFF";
1133
1134        public short getIndex()
1135        {
1136            return index;
1137        }
1138
1139        public short [] getTriplet()
1140        {
1141            return triplet;
1142        }
1143
1144        public String JavaDoc getHexString()
1145        {
1146            return hexString;
1147        }
1148    }
1149
1150    /**
1151     * Class SKY_BLUE
1152     *
1153     */

1154
1155    public final static class SKY_BLUE
1156        extends HSSFColor
1157    {
1158        public final static short index = 0x28;
1159        public final static short[] triplet =
1160        {
1161            0, 204, 255
1162        };
1163        public final static String JavaDoc hexString = "0:CCCC:FFFF";
1164
1165        public short getIndex()
1166        {
1167            return index;
1168        }
1169
1170        public short [] getTriplet()
1171        {
1172            return triplet;
1173        }
1174
1175        public String JavaDoc getHexString()
1176        {
1177            return hexString;
1178        }
1179    }
1180
1181    /**
1182     * Class PLUM
1183     *
1184     */

1185
1186    public final static class PLUM
1187        extends HSSFColor
1188    {
1189        public final static short index = 0x3d;
1190        public final static short index2 = 0x19;
1191        public final static short[] triplet =
1192        {
1193            153, 51, 102
1194        };
1195        public final static String JavaDoc hexString = "9999:3333:6666";
1196
1197        public short getIndex()
1198        {
1199            return index;
1200        }
1201
1202        public short [] getTriplet()
1203        {
1204            return triplet;
1205        }
1206
1207        public String JavaDoc getHexString()
1208        {
1209            return hexString;
1210        }
1211    }
1212
1213    /**
1214     * Class GREY_25_PERCENT
1215     *
1216     */

1217
1218    public final static class GREY_25_PERCENT
1219        extends HSSFColor
1220    {
1221        public final static short index = 0x16;
1222        public final static short[] triplet =
1223        {
1224            192, 192, 192
1225        };
1226        public final static String JavaDoc hexString = "C0C0:C0C0:C0C0";
1227
1228        public short getIndex()
1229        {
1230            return index;
1231        }
1232
1233        public short [] getTriplet()
1234        {
1235            return triplet;
1236        }
1237
1238        public String JavaDoc getHexString()
1239        {
1240            return hexString;
1241        }
1242    }
1243
1244    /**
1245     * Class ROSE
1246     *
1247     */

1248
1249    public final static class ROSE
1250        extends HSSFColor
1251    {
1252        public final static short index = 0x2d;
1253        public final static short[] triplet =
1254        {
1255            255, 153, 204
1256        };
1257        public final static String JavaDoc hexString = "FFFF:9999:CCCC";
1258
1259        public short getIndex()
1260        {
1261            return index;
1262        }
1263
1264        public short [] getTriplet()
1265        {
1266            return triplet;
1267        }
1268
1269        public String JavaDoc getHexString()
1270        {
1271            return hexString;
1272        }
1273    }
1274
1275    /**
1276     * Class TAN
1277     *
1278     */

1279
1280    public final static class TAN
1281        extends HSSFColor
1282    {
1283        public final static short index = 0x2f;
1284        public final static short[] triplet =
1285        {
1286            255, 204, 153
1287        };
1288        public final static String JavaDoc hexString = "FFFF:CCCC:9999";
1289
1290        public short getIndex()
1291        {
1292            return index;
1293        }
1294
1295        public short [] getTriplet()
1296        {
1297            return triplet;
1298        }
1299
1300        public String JavaDoc getHexString()
1301        {
1302            return hexString;
1303        }
1304    }
1305
1306    /**
1307     * Class LIGHT_YELLOW
1308     *
1309     */

1310
1311    public final static class LIGHT_YELLOW
1312        extends HSSFColor
1313    {
1314        public final static short index = 0x2b;
1315        public final static short[] triplet =
1316        {
1317            255, 255, 153
1318        };
1319        public final static String JavaDoc hexString = "FFFF:FFFF:9999";
1320
1321        public short getIndex()
1322        {
1323            return index;
1324        }
1325
1326        public short [] getTriplet()
1327        {
1328            return triplet;
1329        }
1330
1331        public String JavaDoc getHexString()
1332        {
1333            return hexString;
1334        }
1335    }
1336
1337    /**
1338     * Class LIGHT_GREEN
1339     *
1340     */

1341
1342    public final static class LIGHT_GREEN
1343        extends HSSFColor
1344    {
1345        public final static short index = 0x2a;
1346        public final static short[] triplet =
1347        {
1348            204, 255, 204
1349        };
1350        public final static String JavaDoc hexString = "CCCC:FFFF:CCCC";
1351
1352        public short getIndex()
1353        {
1354            return index;
1355        }
1356
1357        public short [] getTriplet()
1358        {
1359            return triplet;
1360        }
1361
1362        public String JavaDoc getHexString()
1363        {
1364            return hexString;
1365        }
1366    }
1367
1368    /**
1369     * Class LIGHT_TURQUOISE
1370     *
1371     */

1372
1373    public final static class LIGHT_TURQUOISE
1374        extends HSSFColor
1375    {
1376        public final static short index = 0x29;
1377        public final static short index2 = 0x1b;
1378        public final static short[] triplet =
1379        {
1380            204, 255, 255
1381        };
1382        public final static String JavaDoc hexString = "CCCC:FFFF:FFFF";
1383
1384        public short getIndex()
1385        {
1386            return index;
1387        }
1388
1389        public short [] getTriplet()
1390        {
1391            return triplet;
1392        }
1393
1394        public String JavaDoc getHexString()
1395        {
1396            return hexString;
1397        }
1398    }
1399
1400    /**
1401     * Class PALE_BLUE
1402     *
1403     */

1404
1405    public final static class PALE_BLUE
1406        extends HSSFColor
1407    {
1408        public final static short index = 0x2c;
1409        public final static short[] triplet =
1410        {
1411            153, 204, 255
1412        };
1413        public final static String JavaDoc hexString = "9999:CCCC:FFFF";
1414
1415        public short getIndex()
1416        {
1417            return index;
1418        }
1419
1420        public short [] getTriplet()
1421        {
1422            return triplet;
1423        }
1424
1425        public String JavaDoc getHexString()
1426        {
1427            return hexString;
1428        }
1429    }
1430
1431    /**
1432     * Class LAVENDER
1433     *
1434     */

1435
1436    public final static class LAVENDER
1437        extends HSSFColor
1438    {
1439        public final static short index = 0x2e;
1440        public final static short[] triplet =
1441        {
1442            204, 153, 255
1443        };
1444        public final static String JavaDoc hexString = "CCCC:9999:FFFF";
1445
1446        public short getIndex()
1447        {
1448            return index;
1449        }
1450
1451        public short [] getTriplet()
1452        {
1453            return triplet;
1454        }
1455
1456        public String JavaDoc getHexString()
1457        {
1458            return hexString;
1459        }
1460    }
1461
1462    /**
1463     * Class WHITE
1464     *
1465     */

1466
1467    public final static class WHITE
1468        extends HSSFColor
1469    {
1470        public final static short index = 0x9;
1471        public final static short[] triplet =
1472        {
1473            255, 255, 255
1474        };
1475        public final static String JavaDoc hexString = "FFFF:FFFF:FFFF";
1476
1477        public short getIndex()
1478        {
1479            return index;
1480        }
1481
1482        public short [] getTriplet()
1483        {
1484            return triplet;
1485        }
1486
1487        public String JavaDoc getHexString()
1488        {
1489            return hexString;
1490        }
1491    }
1492    
1493    /**
1494     * Class CORNFLOWER_BLUE
1495     */

1496    public final static class CORNFLOWER_BLUE
1497        extends HSSFColor
1498    {
1499        public final static short index = 0x18;
1500        public final static short[] triplet =
1501        {
1502            153, 153, 255
1503        };
1504        public final static String JavaDoc hexString = "9999:9999:FFFF";
1505
1506        public short getIndex()
1507        {
1508            return index;
1509        }
1510
1511        public short [] getTriplet()
1512        {
1513            return triplet;
1514        }
1515
1516        public String JavaDoc getHexString()
1517        {
1518            return hexString;
1519        }
1520    }
1521    
1522    
1523    /**
1524     * Class LEMON_CHIFFON
1525     */

1526    public final static class LEMON_CHIFFON
1527        extends HSSFColor
1528    {
1529        public final static short index = 0x1a;
1530        public final static short[] triplet =
1531        {
1532            255, 255, 204
1533        };
1534        public final static String JavaDoc hexString = "FFFF:FFFF:CCCC";
1535
1536        public short getIndex()
1537        {
1538            return index;
1539        }
1540
1541        public short [] getTriplet()
1542        {
1543            return triplet;
1544        }
1545
1546        public String JavaDoc getHexString()
1547        {
1548            return hexString;
1549        }
1550    }
1551    
1552    /**
1553     * Class MAROON
1554     */

1555    public final static class MAROON
1556        extends HSSFColor
1557    {
1558        public final static short index = 0x19;
1559        public final static short[] triplet =
1560        {
1561            153, 51, 102
1562        };
1563        public final static String JavaDoc hexString = "9999:3333:6666";
1564
1565        public short getIndex()
1566        {
1567            return index;
1568        }
1569
1570        public short [] getTriplet()
1571        {
1572            return triplet;
1573        }
1574
1575        public String JavaDoc getHexString()
1576        {
1577            return hexString;
1578        }
1579    }
1580    
1581    /**
1582     * Class ORCHID
1583     */

1584    public final static class ORCHID
1585        extends HSSFColor
1586    {
1587        public final static short index = 0x1c;
1588        public final static short[] triplet =
1589        {
1590            102, 0, 102
1591        };
1592        public final static String JavaDoc hexString = "6666:0:6666";
1593
1594        public short getIndex()
1595        {
1596            return index;
1597        }
1598
1599        public short [] getTriplet()
1600        {
1601            return triplet;
1602        }
1603
1604        public String JavaDoc getHexString()
1605        {
1606            return hexString;
1607        }
1608    }
1609    
1610    /**
1611     * Class CORAL
1612     */

1613    public final static class CORAL
1614        extends HSSFColor
1615    {
1616        public final static short index = 0x1d;
1617        public final static short[] triplet =
1618        {
1619            255, 128, 128
1620        };
1621        public final static String JavaDoc hexString = "FFFF:8080:8080";
1622
1623        public short getIndex()
1624        {
1625            return index;
1626        }
1627
1628        public short [] getTriplet()
1629        {
1630            return triplet;
1631        }
1632
1633        public String JavaDoc getHexString()
1634        {
1635            return hexString;
1636        }
1637    }
1638    
1639    /**
1640     * Class ROYAL_BLUE
1641     */

1642    public final static class ROYAL_BLUE
1643        extends HSSFColor
1644    {
1645        public final static short index = 0x1e;
1646        public final static short[] triplet =
1647        {
1648            0, 102, 204
1649        };
1650        public final static String JavaDoc hexString = "0:6666:CCCC";
1651
1652        public short getIndex()
1653        {
1654            return index;
1655        }
1656
1657        public short [] getTriplet()
1658        {
1659            return triplet;
1660        }
1661
1662        public String JavaDoc getHexString()
1663        {
1664            return hexString;
1665        }
1666    }
1667    
1668    /**
1669     * Class LIGHT_CORNFLOWER_BLUE
1670     */

1671    public final static class LIGHT_CORNFLOWER_BLUE
1672        extends HSSFColor
1673    {
1674        public final static short index = 0x1f;
1675        public final static short[] triplet =
1676        {
1677            204, 204, 255
1678        };
1679        public final static String JavaDoc hexString = "CCCC:CCCC:FFFF";
1680
1681        public short getIndex()
1682        {
1683            return index;
1684        }
1685
1686        public short [] getTriplet()
1687        {
1688            return triplet;
1689        }
1690
1691        public String JavaDoc getHexString()
1692        {
1693            return hexString;
1694        }
1695    }
1696}
1697
Popular Tags