1    
2    /* ====================================================================
3     * The Apache Software License, Version 1.1
4     *
5     * Copyright (c) 2002 The Apache Software Foundation.  All rights
6     * reserved.
7     *
8     * Redistribution and use in source and binary forms, with or without
9     * modification, are permitted provided that the following conditions
10    * are met:
11    *
12    * 1. Redistributions of source code must retain the above copyright
13    *    notice, this list of conditions and the following disclaimer.
14    *
15    * 2. Redistributions in binary form must reproduce the above copyright
16    *    notice, this list of conditions and the following disclaimer in
17    *    the documentation and/or other materials provided with the
18    *    distribution.
19    *
20    * 3. The end-user documentation included with the redistribution,
21    *    if any, must include the following acknowledgment:
22    *       "This product includes software developed by the
23    *        Apache Software Foundation (http://www.apache.org/)."
24    *    Alternately, this acknowledgment may appear in the software itself,
25    *    if and wherever such third-party acknowledgments normally appear.
26    *
27    * 4. The names "Apache" and "Apache Software Foundation" and
28    *    "Apache POI" must not be used to endorse or promote products
29    *    derived from this software without prior written permission. For
30    *    written permission, please contact apache@apache.org.
31    *
32    * 5. Products derived from this software may not be called "Apache",
33    *    "Apache POI", nor may "Apache" appear in their name, without
34    *    prior written permission of the Apache Software Foundation.
35    *
36    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47    * SUCH DAMAGE.
48    * ====================================================================
49    *
50    * This software consists of voluntary contributions made by many
51    * individuals on behalf of the Apache Software Foundation.  For more
52    * information on the Apache Software Foundation, please see
53    * <http://www.apache.org/>.
54    */
55   
56   package org.apache.poi.hssf.util;
57   
58   import java.util.*;
59   
60   /**
61    * Intends to provide support for the very evil index to triplet issue and
62    * will likely replace the color contants interface for HSSF 2.0.
63    * This class contains static inner class members for representing colors.
64    * Each color has an index (for the standard palette in Excel (tm) ),
65    * native (RGB) triplet and string triplet.  The string triplet is as the
66    * color would be represented by Gnumeric.  Having (string) this here is a bit of a
67    * collusion of function between HSSF and the HSSFSerializer but I think its
68    * a reasonable one in this case.
69    *
70    * @author  Andrew C. Oliver (acoliver at apache dot org)
71    */
72   
73   public class HSSFColor
74   {
75       private final static int PALETTE_SIZE = 50;
76   
77       /** Creates a new instance of HSSFColor */
78   
79       public HSSFColor()
80       {
81       }
82   
83       /**
84        * this function returns all colors in a hastable.  Its not implemented as a
85        * static member/staticly initialized because that would be dirty in a
86        * server environment as it is intended.  This means you'll eat the time
87        * it takes to create it once per request but you will not hold onto it
88        * if you have none of those requests.
89        *
90        * @return a hashtable containing all colors mapped to their excel-style 
91        * pallette index
92        */
93       public final static Hashtable getIndexHash() {
94   
95           Hashtable hash = new Hashtable(PALETTE_SIZE);
96   
97           hash.put(new Integer(HSSFColor.BLACK.index), new HSSFColor.BLACK());
98           hash.put(new Integer(HSSFColor.BROWN.index), new HSSFColor.BROWN());
99           hash.put(new Integer(HSSFColor.OLIVE_GREEN.index),
100                   new HSSFColor.OLIVE_GREEN());
101          hash.put(new Integer(HSSFColor.DARK_GREEN.index), new HSSFColor.DARK_GREEN());
102          hash.put(new Integer(HSSFColor.DARK_TEAL.index), new HSSFColor.DARK_TEAL());
103          hash.put(new Integer(HSSFColor.DARK_BLUE.index), new HSSFColor.DARK_BLUE());
104          hash.put(new Integer(HSSFColor.INDIGO.index), new HSSFColor.INDIGO());
105          hash.put(new Integer(HSSFColor.GREY_80_PERCENT.index),
106                   new HSSFColor.GREY_80_PERCENT());
107          hash.put(new Integer(HSSFColor.ORANGE.index), new HSSFColor.ORANGE());
108          hash.put(new Integer(HSSFColor.DARK_YELLOW.index),
109                   new HSSFColor.DARK_YELLOW());
110          hash.put(new Integer(HSSFColor.GREEN.index), new HSSFColor.GREEN());
111          hash.put(new Integer(HSSFColor.TEAL.index), new HSSFColor.TEAL());
112          hash.put(new Integer(HSSFColor.BLUE.index), new HSSFColor.BLUE());
113          hash.put(new Integer(HSSFColor.BLUE_GREY.index), new HSSFColor.BLUE_GREY());
114          hash.put(new Integer(HSSFColor.GREY_50_PERCENT.index),
115                   new HSSFColor.GREY_50_PERCENT());
116          hash.put(new Integer(HSSFColor.RED.index), new HSSFColor.RED());
117          hash.put(new Integer(HSSFColor.LIGHT_ORANGE.index),
118                   new HSSFColor.LIGHT_ORANGE());
119          hash.put(new Integer(HSSFColor.LIME.index), new HSSFColor.LIME());
120          hash.put(new Integer(HSSFColor.SEA_GREEN.index), new HSSFColor.SEA_GREEN());
121          hash.put(new Integer(HSSFColor.AQUA.index), new HSSFColor.AQUA());
122          hash.put(new Integer(HSSFColor.LIGHT_BLUE.index), new HSSFColor.LIGHT_BLUE());
123          hash.put(new Integer(HSSFColor.VIOLET.index), new HSSFColor.VIOLET());
124          hash.put(new Integer(HSSFColor.GREY_40_PERCENT.index),
125                   new HSSFColor.GREY_40_PERCENT());
126          hash.put(new Integer(HSSFColor.PINK.index), new HSSFColor.PINK());
127          hash.put(new Integer(HSSFColor.GOLD.index), new HSSFColor.GOLD());
128          hash.put(new Integer(HSSFColor.YELLOW.index), new HSSFColor.YELLOW());
129          hash.put(new Integer(HSSFColor.BRIGHT_GREEN.index),
130                   new HSSFColor.BRIGHT_GREEN());
131          hash.put(new Integer(HSSFColor.BRIGHT_GREEN.index), new HSSFColor.TURQUOISE());
132          hash.put(new Integer(HSSFColor.SKY_BLUE.index), new HSSFColor.SKY_BLUE());
133          hash.put(new Integer(HSSFColor.PLUM.index), new HSSFColor.PLUM());
134          hash.put(new Integer(HSSFColor.GREY_25_PERCENT.index),
135                   new HSSFColor.GREY_25_PERCENT());
136          hash.put(new Integer(HSSFColor.ROSE.index), new HSSFColor.ROSE());
137          hash.put(new Integer(HSSFColor.LIGHT_YELLOW.index),
138                   new HSSFColor.LIGHT_YELLOW());
139          hash.put(new Integer(HSSFColor.LIGHT_GREEN.index),
140                   new HSSFColor.LIGHT_GREEN());
141          hash.put(new Integer(HSSFColor.LIGHT_TURQUOISE.index),
142                   new HSSFColor.LIGHT_TURQUOISE());
143          hash.put(new Integer(HSSFColor.PALE_BLUE.index), new HSSFColor.PALE_BLUE());
144          hash.put(new Integer(HSSFColor.LAVENDER.index), new HSSFColor.LAVENDER());
145          hash.put(new Integer(HSSFColor.WHITE.index), new HSSFColor.WHITE());
146  	return hash;
147      }
148  
149      /**
150       * this function returns all colors in a hastable.  Its not implemented as a
151       * static member/staticly initialized because that would be dirty in a
152       * server environment as it is intended.  This means you'll eat the time
153       * it takes to create it once per request but you will not hold onto it
154       * if you have none of those requests.
155       *
156       * @return a hashtable containing all colors mapped to their gnumeric-like
157       * triplet string
158       */
159  
160      public final static Hashtable getTripletHash()
161      {
162          Hashtable hash = new Hashtable(PALETTE_SIZE);
163  
164          hash.put(HSSFColor.BLACK.hexString, new HSSFColor.BLACK());
165          hash.put(HSSFColor.BROWN.hexString, new HSSFColor.BROWN());
166          hash.put(HSSFColor.OLIVE_GREEN.hexString,
167                   new HSSFColor.OLIVE_GREEN());
168          hash.put(HSSFColor.DARK_GREEN.hexString, new HSSFColor.DARK_GREEN());
169          hash.put(HSSFColor.DARK_TEAL.hexString, new HSSFColor.DARK_TEAL());
170          hash.put(HSSFColor.DARK_BLUE.hexString, new HSSFColor.DARK_BLUE());
171          hash.put(HSSFColor.INDIGO.hexString, new HSSFColor.INDIGO());
172          hash.put(HSSFColor.GREY_80_PERCENT.hexString,
173                   new HSSFColor.GREY_80_PERCENT());
174          hash.put(HSSFColor.ORANGE.hexString, new HSSFColor.ORANGE());
175          hash.put(HSSFColor.DARK_YELLOW.hexString,
176                   new HSSFColor.DARK_YELLOW());
177          hash.put(HSSFColor.GREEN.hexString, new HSSFColor.GREEN());
178          hash.put(HSSFColor.TEAL.hexString, new HSSFColor.TEAL());
179          hash.put(HSSFColor.BLUE.hexString, new HSSFColor.BLUE());
180          hash.put(HSSFColor.BLUE_GREY.hexString, new HSSFColor.BLUE_GREY());
181          hash.put(HSSFColor.GREY_50_PERCENT.hexString,
182                   new HSSFColor.GREY_50_PERCENT());
183          hash.put(HSSFColor.RED.hexString, new HSSFColor.RED());
184          hash.put(HSSFColor.LIGHT_ORANGE.hexString,
185                   new HSSFColor.LIGHT_ORANGE());
186          hash.put(HSSFColor.LIME.hexString, new HSSFColor.LIME());
187          hash.put(HSSFColor.SEA_GREEN.hexString, new HSSFColor.SEA_GREEN());
188          hash.put(HSSFColor.AQUA.hexString, new HSSFColor.AQUA());
189          hash.put(HSSFColor.LIGHT_BLUE.hexString, new HSSFColor.LIGHT_BLUE());
190          hash.put(HSSFColor.VIOLET.hexString, new HSSFColor.VIOLET());
191          hash.put(HSSFColor.GREY_40_PERCENT.hexString,
192                   new HSSFColor.GREY_40_PERCENT());
193          hash.put(HSSFColor.PINK.hexString, new HSSFColor.PINK());
194          hash.put(HSSFColor.GOLD.hexString, new HSSFColor.GOLD());
195          hash.put(HSSFColor.YELLOW.hexString, new HSSFColor.YELLOW());
196          hash.put(HSSFColor.BRIGHT_GREEN.hexString,
197                   new HSSFColor.BRIGHT_GREEN());
198          hash.put(HSSFColor.BRIGHT_GREEN.hexString, new HSSFColor.TURQUOISE());
199          hash.put(HSSFColor.SKY_BLUE.hexString, new HSSFColor.SKY_BLUE());
200          hash.put(HSSFColor.PLUM.hexString, new HSSFColor.PLUM());
201          hash.put(HSSFColor.GREY_25_PERCENT.hexString,
202                   new HSSFColor.GREY_25_PERCENT());
203          hash.put(HSSFColor.ROSE.hexString, new HSSFColor.ROSE());
204          hash.put(HSSFColor.LIGHT_YELLOW.hexString,
205                   new HSSFColor.LIGHT_YELLOW());
206          hash.put(HSSFColor.LIGHT_GREEN.hexString,
207                   new HSSFColor.LIGHT_GREEN());
208          hash.put(HSSFColor.LIGHT_TURQUOISE.hexString,
209                   new HSSFColor.LIGHT_TURQUOISE());
210          hash.put(HSSFColor.PALE_BLUE.hexString, new HSSFColor.PALE_BLUE());
211          hash.put(HSSFColor.LAVENDER.hexString, new HSSFColor.LAVENDER());
212          hash.put(HSSFColor.WHITE.hexString, new HSSFColor.WHITE());
213          return hash;
214      }
215  
216      /**
217       * @return index to the standard palet
218       */
219  
220      public short getIndex()
221      {
222          return BLACK.index;
223      }
224  
225      /**
226       * @return  triplet representation like that in Excel
227       */
228  
229      public short [] getTriplet()
230      {
231          return BLACK.triplet;
232      }
233  
234      // its a hack but its a good hack
235  
236      /**
237       * @return a hex string exactly like a gnumeric triplet
238       */
239  
240      public String getHexString()
241      {
242          return BLACK.hexString;
243      }
244  
245      /**
246       * Class BLACK
247       *
248       */
249  
250      public final static class BLACK
251          extends HSSFColor
252      {
253          public final static short   index     = 0x8;
254          public final static short[] triplet   =
255          {
256              0, 0, 0
257          };
258          public final static String  hexString = "0:0:0";
259  
260          public short getIndex()
261          {
262              return index;
263          }
264  
265          public short [] getTriplet()
266          {
267              return triplet;
268          }
269  
270          public String getHexString()
271          {
272              return hexString;
273          }
274      }
275  
276      /**
277       * Class BROWN
278       *
279       */
280  
281      public final static class BROWN
282          extends HSSFColor
283      {
284          public final static short   index     = 0x3c;
285          public final static short[] triplet   =
286          {
287              153, 51, 0
288          };
289          public final static String  hexString = "9999:3333:0";
290  
291          public short getIndex()
292          {
293              return index;
294          }
295  
296          public short [] getTriplet()
297          {
298              return triplet;
299          }
300  
301          public String getHexString()
302          {
303              return hexString;
304          }
305      }
306  
307      /**
308       * Class OLIVE_GREEN
309       *
310       */
311  
312      public static class OLIVE_GREEN
313          extends HSSFColor
314      {
315          public final static short   index     = 0x3b;
316          public final static short[] triplet   =
317          {
318              51, 51, 0
319          };
320          public final static String  hexString = "3333:3333:0";
321  
322          public short getIndex()
323          {
324              return index;
325          }
326  
327          public short [] getTriplet()
328          {
329              return triplet;
330          }
331  
332          public String getHexString()
333          {
334              return hexString;
335          }
336      }
337  
338      /**
339       * Class DARK_GREEN
340       *
341       */
342  
343      public final static class DARK_GREEN
344          extends HSSFColor
345      {
346          public final static short   index     = 0x3a;
347          public final static short[] triplet   =
348          {
349              0, 51, 0
350          };
351          public final static String  hexString = "0:3333:0";
352  
353          public short getIndex()
354          {
355              return index;
356          }
357  
358          public short [] getTriplet()
359          {
360              return triplet;
361          }
362  
363          public String getHexString()
364          {
365              return hexString;
366          }
367      }
368  
369      /**
370       * Class DARK_TEAL
371       *
372       */
373  
374      public final static class DARK_TEAL
375          extends HSSFColor
376      {
377          public final static short   index     = 0x38;
378          public final static short[] triplet   =
379          {
380              0, 51, 102
381          };
382          public final static String  hexString = "0:3333:6666";
383  
384          public short getIndex()
385          {
386              return index;
387          }
388  
389          public short [] getTriplet()
390          {
391              return triplet;
392          }
393  
394          public String getHexString()
395          {
396              return hexString;
397          }
398      }
399  
400      /**
401       * Class DARK_BLUE
402       *
403       */
404  
405      public final static class DARK_BLUE
406          extends HSSFColor
407      {
408          public final static short   index     = 0x12;
409          public final static short[] triplet   =
410          {
411              0, 0, 128
412          };
413          public final static String  hexString = "0:0:8080";
414  
415          public short getIndex()
416          {
417              return index;
418          }
419  
420          public short [] getTriplet()
421          {
422              return triplet;
423          }
424  
425          public String getHexString()
426          {
427              return hexString;
428          }
429      }
430  
431      /**
432       * Class INDIGO
433       *
434       */
435  
436      public final static class INDIGO
437          extends HSSFColor
438      {
439          public final static short   index     = 0x3e;
440          public final static short[] triplet   =
441          {
442              51, 51, 153
443          };
444          public final static String  hexString = "3333:3333:9999";
445  
446          public short getIndex()
447          {
448              return index;
449          }
450  
451          public short [] getTriplet()
452          {
453              return triplet;
454          }
455  
456          public String getHexString()
457          {
458              return hexString;
459          }
460      }
461  
462      /**
463       * Class GREY_80_PERCENT
464       *
465       */
466  
467      public final static class GREY_80_PERCENT
468          extends HSSFColor
469      {
470          public final static short   index     = 0x3f;
471          public final static short[] triplet   =
472          {
473              51, 51, 51
474          };
475          public final static String  hexString = "3333:3333:3333";
476  
477          public short getIndex()
478          {
479              return index;
480          }
481  
482          public short [] getTriplet()
483          {
484              return triplet;
485          }
486  
487          public String getHexString()
488          {
489              return hexString;
490          }
491      }
492  
493      /**
494       * Class DARK_RED
495       *
496       */
497  
498      public final static class DARK_RED
499          extends HSSFColor
500      {
501          public final static short   index     = 0x10;
502          public final static short[] triplet   =
503          {
504              128, 0, 0
505          };
506          public final static String  hexString = "8080:0:0";
507  
508          public short getIndex()
509          {
510              return index;
511          }
512  
513          public short [] getTriplet()
514          {
515              return triplet;
516          }
517  
518          public String getHexString()
519          {
520              return hexString;
521          }
522      }
523  
524      /**
525       * Class ORANGE
526       *
527       */
528  
529      public final static class ORANGE
530          extends HSSFColor
531      {
532          public final static short   index     = 0x35;
533          public final static short[] triplet   =
534          {
535              255, 102, 0
536          };
537          public final static String  hexString = "FFFF:6666:0";
538  
539          public short getIndex()
540          {
541              return index;
542          }
543  
544          public short [] getTriplet()
545          {
546              return triplet;
547          }
548  
549          public String getHexString()
550          {
551              return hexString;
552          }
553      }
554  
555      /**
556       * Class DARK_YELLOW
557       *
558       */
559  
560      public final static class DARK_YELLOW
561          extends HSSFColor
562      {
563          public final static short   index     = 0x13;
564          public final static short[] triplet   =
565          {
566              128, 128, 0
567          };
568          public final static String  hexString = "8080:8080:0";
569  
570          public short getIndex()
571          {
572              return index;
573          }
574  
575          public short [] getTriplet()
576          {
577              return triplet;
578          }
579  
580          public String getHexString()
581          {
582              return hexString;
583          }
584      }
585  
586      /**
587       * Class GREEN
588       *
589       */
590  
591      public final static class GREEN
592          extends HSSFColor
593      {
594          public final static short   index     = 0x11;
595          public final static short[] triplet   =
596          {
597              0, 128, 0
598          };
599          public final static String  hexString = "0:8080:0";
600  
601          public short getIndex()
602          {
603              return index;
604          }
605  
606          public short [] getTriplet()
607          {
608              return triplet;
609          }
610  
611          public String getHexString()
612          {
613              return hexString;
614          }
615      }
616  
617      /**
618       * Class TEAL
619       *
620       */
621  
622      public final static class TEAL
623          extends HSSFColor
624      {
625          public final static short   index     = 0x15;
626          public final static short[] triplet   =
627          {
628              0, 128, 128
629          };
630          public final static String  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 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[] triplet   =
658          {
659              0, 0, 255
660          };
661          public final static String  hexString = "0:0:FFFF";
662  
663          public short getIndex()
664          {
665              return index;
666          }
667  
668          public short [] getTriplet()
669          {
670              return triplet;
671          }
672  
673          public String getHexString()
674          {
675              return hexString;
676          }
677      }
678  
679      /**
680       * Class BLUE_GREY
681       *
682       */
683  
684      public final static class BLUE_GREY
685          extends HSSFColor
686      {
687          public final static short   index     = 0x36;
688          public final static short[] triplet   =
689          {
690              102, 102, 153
691          };
692          public final static String  hexString = "6666:6666:9999";
693  
694          public short getIndex()
695          {
696              return index;
697          }
698  
699          public short [] getTriplet()
700          {
701              return triplet;
702          }
703  
704          public String getHexString()
705          {
706              return hexString;
707          }
708      }
709  
710      /**
711       * Class GREY_50_PERCENT
712       *
713       */
714  
715      public final static class GREY_50_PERCENT
716          extends HSSFColor
717      {
718          public final static short   index     = 0x17;
719          public final static short[] triplet   =
720          {
721              128, 128, 128
722          };
723          public final static String  hexString = "8080:8080:8080";
724  
725          public short getIndex()
726          {
727              return index;
728          }
729  
730          public short [] getTriplet()
731          {
732              return triplet;
733          }
734  
735          public String getHexString()
736          {
737              return hexString;
738          }
739      }
740  
741      /**
742       * Class RED
743       *
744       */
745  
746      public final static class RED
747          extends HSSFColor
748      {
749          public final static short   index     = 0xa;
750          public final static short[] triplet   =
751          {
752              255, 0, 0
753          };
754          public final static String  hexString = "FFFF:0:0";
755  
756          public short getIndex()
757          {
758              return index;
759          }
760  
761          public short [] getTriplet()
762          {
763              return triplet;
764          }
765  
766          public String getHexString()
767          {
768              return hexString;
769          }
770      }
771  
772      /**
773       * Class LIGHT_ORANGE
774       *
775       */
776  
777      public final static class LIGHT_ORANGE
778          extends HSSFColor
779      {
780          public final static short   index     = 0x34;
781          public final static short[] triplet   =
782          {
783              255, 153, 0
784          };
785          public final static String  hexString = "FFF:9999:0";
786  
787          public short getIndex()
788          {
789              return index;
790          }
791  
792          public short [] getTriplet()
793          {
794              return triplet;
795          }
796  
797          public String getHexString()
798          {
799              return hexString;
800          }
801      }
802  
803      /**
804       * Class LIME
805       *
806       */
807  
808      public final static class LIME
809          extends HSSFColor
810      {
811          public final static short   index     = 0x32;
812          public final static short[] triplet   =
813          {
814              153, 204, 0
815          };
816          public final static String  hexString = "9999:CCCC:0";
817  
818          public short getIndex()
819          {
820              return index;
821          }
822  
823          public short [] getTriplet()
824          {
825              return triplet;
826          }
827  
828          public String getHexString()
829          {
830              return hexString;
831          }
832      }
833  
834      /**
835       * Class SEA_GREEN
836       *
837       */
838  
839      public final static class SEA_GREEN
840          extends HSSFColor
841      {
842          public final static short   index     = 0x39;
843          public final static short[] triplet   =
844          {
845              51, 153, 102
846          };
847          public final static String  hexString = "3333:9999:6666";
848  
849          public short getIndex()
850          {
851              return index;
852          }
853  
854          public short [] getTriplet()
855          {
856              return triplet;
857          }
858  
859          public String getHexString()
860          {
861              return hexString;
862          }
863      }
864  
865      /**
866       * Class AQUA
867       *
868       */
869  
870      public final static class AQUA
871          extends HSSFColor
872      {
873          public final static short   index     = 0x31;
874          public final static short[] triplet   =
875          {
876              51, 204, 204
877          };
878          public final static String  hexString = "3333:CCCC:CCCC";
879  
880          public short getIndex()
881          {
882              return index;
883          }
884  
885          public short [] getTriplet()
886          {
887              return triplet;
888          }
889  
890          public String getHexString()
891          {
892              return hexString;
893          }
894      }
895  
896      /**
897       * Class LIGHT_BLUE
898       *
899       */
900  
901      public final static class LIGHT_BLUE
902          extends HSSFColor
903      {
904          public final static short   index     = 0x30;
905          public final static short[] triplet   =
906          {
907              51, 102, 255
908          };
909          public final static String  hexString = "3333:6666:FFFF";
910  
911          public short getIndex()
912          {
913              return index;
914          }
915  
916          public short [] getTriplet()
917          {
918              return triplet;
919          }
920  
921          public String getHexString()
922          {
923              return hexString;
924          }
925      }
926  
927      /**
928       * Class VIOLET
929       *
930       */
931  
932      public final static class VIOLET
933          extends HSSFColor
934      {
935          public final static short   index     = 0x14;
936          public final static short[] triplet   =
937          {
938              128, 0, 128
939          };
940          public final static String  hexString = "8080:0:8080";
941  
942          public short getIndex()
943          {
944              return index;
945          }
946  
947          public short [] getTriplet()
948          {
949              return triplet;
950          }
951  
952          public String getHexString()
953          {
954              return hexString;
955          }
956      }
957  
958      /**
959       * Class GREY_40_PERCENT
960       *
961       */
962  
963      public final static class GREY_40_PERCENT
964          extends HSSFColor
965      {
966          public final static short   index     = 0x37;
967          public final static short[] triplet   =
968          {
969              150, 150, 150
970          };
971          public final static String  hexString = "9696:9696:9696";
972  
973          public short getIndex()
974          {
975              return index;
976          }
977  
978          public short [] getTriplet()
979          {
980              return triplet;
981          }
982  
983          public String getHexString()
984          {
985              return hexString;
986          }
987      }
988  
989      /**
990       * Class PINK
991       *
992       */
993  
994      public final static class PINK
995          extends HSSFColor
996      {
997          public final static short   index     = 0xe;
998          public final static short[] triplet   =
999          {
1000             255, 0, 255
1001         };
1002         public final static String  hexString = "FFFF:0:FFFF";
1003 
1004         public short getIndex()
1005         {
1006             return index;
1007         }
1008 
1009         public short [] getTriplet()
1010         {
1011             return triplet;
1012         }
1013 
1014         public String getHexString()
1015         {
1016             return hexString;
1017         }
1018     }
1019 
1020     /**
1021      * Class GOLD
1022      *
1023      */
1024 
1025     public final static class GOLD
1026         extends HSSFColor
1027     {
1028         public final static short   index     = 0x33;
1029         public final static short[] triplet   =
1030         {
1031             255, 204, 0
1032         };
1033         public final static String  hexString = "FFFF:CCCC:0";
1034 
1035         public short getIndex()
1036         {
1037             return index;
1038         }
1039 
1040         public short [] getTriplet()
1041         {
1042             return triplet;
1043         }
1044 
1045         public String getHexString()
1046         {
1047             return hexString;
1048         }
1049     }
1050 
1051     /**
1052      * Class YELLOW
1053      *
1054      */
1055 
1056     public final static class YELLOW
1057         extends HSSFColor
1058     {
1059         public final static short   index     = 0xd;
1060         public final static short[] triplet   =
1061         {
1062             255, 255, 0
1063         };
1064         public final static String  hexString = "FFFF:FFFF:0";
1065 
1066         public short getIndex()
1067         {
1068             return index;
1069         }
1070 
1071         public short [] getTriplet()
1072         {
1073             return triplet;
1074         }
1075 
1076         public String getHexString()
1077         {
1078             return hexString;
1079         }
1080     }
1081 
1082     /**
1083      * Class BRIGHT_GREEN
1084      *
1085      */
1086 
1087     public final static class BRIGHT_GREEN
1088         extends HSSFColor
1089     {
1090         public final static short   index     = 0xb;
1091         public final static short[] triplet   =
1092         {
1093             0, 255, 0
1094         };
1095         public final static String  hexString = "0:FFFF:0";
1096 
1097         public short getIndex()
1098         {
1099             return index;
1100         }
1101 
1102         public String getHexString()
1103         {
1104             return hexString;
1105         }
1106 
1107         public short [] getTriplet()
1108         {
1109             return triplet;
1110         }
1111     }
1112 
1113     /**
1114      * Class TURQUOISE
1115      *
1116      */
1117 
1118     public final static class TURQUOISE
1119         extends HSSFColor
1120     {
1121         public final static short   index     = 0xf;
1122         public final static short[] triplet   =
1123         {
1124             0, 255, 255
1125         };
1126         public final static String  hexString = "0:FFFF:FFFF";
1127 
1128         public short getIndex()
1129         {
1130             return index;
1131         }
1132 
1133         public short [] getTriplet()
1134         {
1135             return triplet;
1136         }
1137 
1138         public String getHexString()
1139         {
1140             return hexString;
1141         }
1142     }
1143 
1144     /**
1145      * Class SKY_BLUE
1146      *
1147      */
1148 
1149     public final static class SKY_BLUE
1150         extends HSSFColor
1151     {
1152         public final static short   index     = 0x28;
1153         public final static short[] triplet   =
1154         {
1155             0, 204, 255
1156         };
1157         public final static String  hexString = "0:CCCC:FFFF";
1158 
1159         public short getIndex()
1160         {
1161             return index;
1162         }
1163 
1164         public short [] getTriplet()
1165         {
1166             return triplet;
1167         }
1168 
1169         public String getHexString()
1170         {
1171             return hexString;
1172         }
1173     }
1174 
1175     /**
1176      * Class PLUM
1177      *
1178      */
1179 
1180     public final static class PLUM
1181         extends HSSFColor
1182     {
1183         public final static short   index     = 0x3d;
1184         public final static short[] triplet   =
1185         {
1186             153, 51, 102
1187         };
1188         public final static String  hexString = "9999:3333:6666";
1189 
1190         public short getIndex()
1191         {
1192             return index;
1193         }
1194 
1195         public short [] getTriplet()
1196         {
1197             return triplet;
1198         }
1199 
1200         public String getHexString()
1201         {
1202             return hexString;
1203         }
1204     }
1205 
1206     /**
1207      * Class GREY_25_PERCENT
1208      *
1209      */
1210 
1211     public final static class GREY_25_PERCENT
1212         extends HSSFColor
1213     {
1214         public final static short   index     = 0x16;
1215         public final static short[] triplet   =
1216         {
1217             192, 192, 192
1218         };
1219         public final static String  hexString = "C0C0:C0C0:C0C0";
1220 
1221         public short getIndex()
1222         {
1223             return index;
1224         }
1225 
1226         public short [] getTriplet()
1227         {
1228             return triplet;
1229         }
1230 
1231         public String getHexString()
1232         {
1233             return hexString;
1234         }
1235     }
1236 
1237     /**
1238      * Class ROSE
1239      *
1240      */
1241 
1242     public final static class ROSE
1243         extends HSSFColor
1244     {
1245         public final static short   index     = 0x2d;
1246         public final static short[] triplet   =
1247         {
1248             255, 153, 204
1249         };
1250         public final static String  hexString = "FFFF:9999:CCCC";
1251 
1252         public short getIndex()
1253         {
1254             return index;
1255         }
1256 
1257         public short [] getTriplet()
1258         {
1259             return triplet;
1260         }
1261 
1262         public String getHexString()
1263         {
1264             return hexString;
1265         }
1266     }
1267 
1268     /**
1269      * Class TAN
1270      *
1271      */
1272 
1273     public final static class TAN
1274         extends HSSFColor
1275     {
1276         public final static short   index     = 0x2f;
1277         public final static short[] triplet   =
1278         {
1279             255, 204, 153
1280         };
1281         public final static String  hexString = "FFFF:CCCC:9999";
1282 
1283         public short getIndex()
1284         {
1285             return index;
1286         }
1287 
1288         public short [] getTriplet()
1289         {
1290             return triplet;
1291         }
1292 
1293         public String getHexString()
1294         {
1295             return hexString;
1296         }
1297     }
1298 
1299     /**
1300      * Class LIGHT_YELLOW
1301      *
1302      */
1303 
1304     public final static class LIGHT_YELLOW
1305         extends HSSFColor
1306     {
1307         public final static short   index     = 0x2b;
1308         public final static short[] triplet   =
1309         {
1310             255, 255, 153
1311         };
1312         public final static String  hexString = "FFFF:FFFF:9999";
1313 
1314         public short getIndex()
1315         {
1316             return index;
1317         }
1318 
1319         public short [] getTriplet()
1320         {
1321             return triplet;
1322         }
1323 
1324         public String getHexString()
1325         {
1326             return hexString;
1327         }
1328     }
1329 
1330     /**
1331      * Class LIGHT_GREEN
1332      *
1333      */
1334 
1335     public final static class LIGHT_GREEN
1336         extends HSSFColor
1337     {
1338         public final static short   index     = 0x2a;
1339         public final static short[] triplet   =
1340         {
1341             204, 255, 204
1342         };
1343         public final static String  hexString = "CCCC:FFFF:CCCC";
1344 
1345         public short getIndex()
1346         {
1347             return index;
1348         }
1349 
1350         public short [] getTriplet()
1351         {
1352             return triplet;
1353         }
1354 
1355         public String getHexString()
1356         {
1357             return hexString;
1358         }
1359     }
1360 
1361     /**
1362      * Class LIGHT_TURQUOISE
1363      *
1364      */
1365 
1366     public final static class LIGHT_TURQUOISE
1367         extends HSSFColor
1368     {
1369         public final static short   index     = 0x29;
1370         public final static short[] triplet   =
1371         {
1372             204, 255, 255
1373         };
1374         public final static String  hexString = "CCCC:FFFF:FFFF";
1375 
1376         public short getIndex()
1377         {
1378             return index;
1379         }
1380 
1381         public short [] getTriplet()
1382         {
1383             return triplet;
1384         }
1385 
1386         public String getHexString()
1387         {
1388             return hexString;
1389         }
1390     }
1391 
1392     /**
1393      * Class PALE_BLUE
1394      *
1395      */
1396 
1397     public final static class PALE_BLUE
1398         extends HSSFColor
1399     {
1400         public final static short   index     = 0x2c;
1401         public final static short[] triplet   =
1402         {
1403             153, 204, 255
1404         };
1405         public final static String  hexString = "9999:CCCC:FFFF";
1406 
1407         public short getIndex()
1408         {
1409             return index;
1410         }
1411 
1412         public short [] getTriplet()
1413         {
1414             return triplet;
1415         }
1416 
1417         public String getHexString()
1418         {
1419             return hexString;
1420         }
1421     }
1422 
1423     /**
1424      * Class LAVENDER
1425      *
1426      */
1427 
1428     public final static class LAVENDER
1429         extends HSSFColor
1430     {
1431         public final static short   index     = 0x2e;
1432         public final static short[] triplet   =
1433         {
1434             204, 153, 255
1435         };
1436         public final static String  hexString = "CCCC:9999:FFFF";
1437 
1438         public short getIndex()
1439         {
1440             return index;
1441         }
1442 
1443         public short [] getTriplet()
1444         {
1445             return triplet;
1446         }
1447 
1448         public String getHexString()
1449         {
1450             return hexString;
1451         }
1452     }
1453 
1454     /**
1455      * Class WHITE
1456      *
1457      */
1458 
1459     public final static class WHITE
1460         extends HSSFColor
1461     {
1462         public final static short   index     = 0x9;
1463         public final static short[] triplet   =
1464         {
1465             255, 255, 255
1466         };
1467         public final static String  hexString = "FFFF:FFFF:FFFF";
1468 
1469         public short getIndex()
1470         {
1471             return index;
1472         }
1473 
1474         public short [] getTriplet()
1475         {
1476             return triplet;
1477         }
1478 
1479         public String getHexString()
1480         {
1481             return hexString;
1482         }
1483     }
1484 }
1485