You're from SA right? Good to have someone in close timezone. I'll wait for Andy's input as I he was the original author I think and would know the background. If he's happy with it I'll need to get you to repost to bugzilla as an attachment with the -u option to diff. Pasting straight into an email or into the bugzilla textbox tends to wrap the patch and stuff it up.
Regards, Glen Stampoultzis (TriNexus Pty Ltd) Fixed:+61 3 9753-6850 Mob:+61 (0)402 835 458 ICQ: 62722370 EMail: [EMAIL PROTECTED] URL's: http://jakarta.apache.org/poi, http://www.krysalis.org > Hi Glen, > > I dont know much about the AUTOMATIC colour (Ha! another Aussie with the > right spelling ;-) ) however with regards to the class vs instance issue, I > have the same problems as you suggest. There is no reason why they need to > be classes. > > In fact i have attached a patch that does this, although it doesnt fix the > places where it breaks the existing code (except for the Workbook class). I > could create a patch that uses this new scheme if everyone agrees that this > approach is the best way to go. > > I think that in the long run when the custom colours are decoded correctly, > the HSSFColor will need to change into something like this patch and provide > a constructor that allows a triplet (R,G,B value) to be passed in. Any > existing methods that return an index (short) to reference a colour whould > then need to return a HSSFColor directly. > > I hope that makes sense. > > Anyhow if people think that this patch is OK then i will make all of the > necessary example changes so that the code can be built. > > Jason > > PS Sorry about the size of this email. It is a large patch after all..... > > Index: jakarta-poi/src/java/org/apache/poi/hssf/model/Workbook.java > =================================================================== > RCS file: > /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/model/Workbook.java > ,v > retrieving revision 1.13 > diff -w -r1.13 Workbook.java > 1482,1485c1482,1485 > < retval.setTopBorderPaletteIdx(HSSFColor.BLACK.index); > < retval.setBottomBorderPaletteIdx(HSSFColor.BLACK.index); > < retval.setLeftBorderPaletteIdx(HSSFColor.BLACK.index); > < retval.setRightBorderPaletteIdx(HSSFColor.BLACK.index); > --- > > retval.setTopBorderPaletteIdx(HSSFColor.BLACK.getIndex()); > > retval.setBottomBorderPaletteIdx(HSSFColor.BLACK.getIndex()); > > retval.setLeftBorderPaletteIdx(HSSFColor.BLACK.getIndex()); > > retval.setRightBorderPaletteIdx(HSSFColor.BLACK.getIndex()); > Index: jakarta-poi/src/java/org/apache/poi/hssf/util/HSSFColor.java > =================================================================== > RCS file: > /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/util/HSSFColor.java > ,v > retrieving revision 1.5 > diff -w -r1.5 HSSFColor.java > 75a76,78 > > private short[] triplet; > > private int index; > > private String hexString; > 77a81,83 > > public HSSFColor(short[] triplet) { > > this(triplet, -1, ""); > > } > 79c85 > < public HSSFColor() > --- > > private HSSFColor(short[] triplet, int index, String hexString) > 80a87,89 > > this.triplet = triplet; > > this.index = index; > > this.hexString = hexString; > 97,145c106,154 > < hash.put(new Integer(HSSFColor.BLACK.index), new > HSSFColor.BLACK()); > < hash.put(new Integer(HSSFColor.BROWN.index), new > HSSFColor.BROWN()); > < hash.put(new Integer(HSSFColor.OLIVE_GREEN.index), > < new HSSFColor.OLIVE_GREEN()); > < hash.put(new Integer(HSSFColor.DARK_GREEN.index), new > HSSFColor.DARK_GREEN()); > < hash.put(new Integer(HSSFColor.DARK_TEAL.index), new > HSSFColor.DARK_TEAL()); > < hash.put(new Integer(HSSFColor.DARK_BLUE.index), new > HSSFColor.DARK_BLUE()); > < hash.put(new Integer(HSSFColor.INDIGO.index), new > HSSFColor.INDIGO()); > < hash.put(new Integer(HSSFColor.GREY_80_PERCENT.index), > < new HSSFColor.GREY_80_PERCENT()); > < hash.put(new Integer(HSSFColor.ORANGE.index), new > HSSFColor.ORANGE()); > < hash.put(new Integer(HSSFColor.DARK_YELLOW.index), > < new HSSFColor.DARK_YELLOW()); > < hash.put(new Integer(HSSFColor.GREEN.index), new > HSSFColor.GREEN()); > < hash.put(new Integer(HSSFColor.TEAL.index), new HSSFColor.TEAL()); > < hash.put(new Integer(HSSFColor.BLUE.index), new HSSFColor.BLUE()); > < hash.put(new Integer(HSSFColor.BLUE_GREY.index), new > HSSFColor.BLUE_GREY()); > < hash.put(new Integer(HSSFColor.GREY_50_PERCENT.index), > < new HSSFColor.GREY_50_PERCENT()); > < hash.put(new Integer(HSSFColor.RED.index), new HSSFColor.RED()); > < hash.put(new Integer(HSSFColor.LIGHT_ORANGE.index), > < new HSSFColor.LIGHT_ORANGE()); > < hash.put(new Integer(HSSFColor.LIME.index), new HSSFColor.LIME()); > < hash.put(new Integer(HSSFColor.SEA_GREEN.index), new > HSSFColor.SEA_GREEN()); > < hash.put(new Integer(HSSFColor.AQUA.index), new HSSFColor.AQUA()); > < hash.put(new Integer(HSSFColor.LIGHT_BLUE.index), new > HSSFColor.LIGHT_BLUE()); > < hash.put(new Integer(HSSFColor.VIOLET.index), new > HSSFColor.VIOLET()); > < hash.put(new Integer(HSSFColor.GREY_40_PERCENT.index), > < new HSSFColor.GREY_40_PERCENT()); > < hash.put(new Integer(HSSFColor.PINK.index), new HSSFColor.PINK()); > < hash.put(new Integer(HSSFColor.GOLD.index), new HSSFColor.GOLD()); > < hash.put(new Integer(HSSFColor.YELLOW.index), new > HSSFColor.YELLOW()); > < hash.put(new Integer(HSSFColor.BRIGHT_GREEN.index), > < new HSSFColor.BRIGHT_GREEN()); > < hash.put(new Integer(HSSFColor.BRIGHT_GREEN.index), new > HSSFColor.TURQUOISE()); > < hash.put(new Integer(HSSFColor.SKY_BLUE.index), new > HSSFColor.SKY_BLUE()); > < hash.put(new Integer(HSSFColor.PLUM.index), new HSSFColor.PLUM()); > < hash.put(new Integer(HSSFColor.GREY_25_PERCENT.index), > < new HSSFColor.GREY_25_PERCENT()); > < hash.put(new Integer(HSSFColor.ROSE.index), new HSSFColor.ROSE()); > < hash.put(new Integer(HSSFColor.LIGHT_YELLOW.index), > < new HSSFColor.LIGHT_YELLOW()); > < hash.put(new Integer(HSSFColor.LIGHT_GREEN.index), > < new HSSFColor.LIGHT_GREEN()); > < hash.put(new Integer(HSSFColor.LIGHT_TURQUOISE.index), > < new HSSFColor.LIGHT_TURQUOISE()); > < hash.put(new Integer(HSSFColor.PALE_BLUE.index), new > HSSFColor.PALE_BLUE()); > < hash.put(new Integer(HSSFColor.LAVENDER.index), new > HSSFColor.LAVENDER()); > < hash.put(new Integer(HSSFColor.WHITE.index), new > HSSFColor.WHITE()); > --- > > hash.put(new Integer(HSSFColor.BLACK.getIndex()), BLACK); > > hash.put(new Integer(HSSFColor.BROWN.getIndex()), BROWN); > > hash.put(new Integer(HSSFColor.OLIVE_GREEN.getIndex()), > > OLIVE_GREEN); > > hash.put(new Integer(HSSFColor.DARK_GREEN.getIndex()), > DARK_GREEN); > > hash.put(new Integer(HSSFColor.DARK_TEAL.getIndex()), DARK_TEAL); > > hash.put(new Integer(HSSFColor.DARK_BLUE.getIndex()), DARK_BLUE); > > hash.put(new Integer(HSSFColor.INDIGO.getIndex()), INDIGO); > > hash.put(new Integer(HSSFColor.GREY_80_PERCENT.getIndex()), > > GREY_80_PERCENT); > > hash.put(new Integer(HSSFColor.ORANGE.getIndex()), ORANGE); > > hash.put(new Integer(HSSFColor.DARK_YELLOW.getIndex()), > > DARK_YELLOW); > > hash.put(new Integer(HSSFColor.GREEN.getIndex()), GREEN); > > hash.put(new Integer(HSSFColor.TEAL.getIndex()), TEAL); > > hash.put(new Integer(HSSFColor.BLUE.getIndex()), BLUE); > > hash.put(new Integer(HSSFColor.BLUE_GREY.getIndex()), BLUE_GREY); > > hash.put(new Integer(HSSFColor.GREY_50_PERCENT.getIndex()), > > GREY_50_PERCENT); > > hash.put(new Integer(HSSFColor.RED.getIndex()), RED); > > hash.put(new Integer(HSSFColor.LIGHT_ORANGE.getIndex()), > > LIGHT_ORANGE); > > hash.put(new Integer(HSSFColor.LIME.getIndex()), LIME); > > hash.put(new Integer(HSSFColor.SEA_GREEN.getIndex()), SEA_GREEN); > > hash.put(new Integer(HSSFColor.AQUA.getIndex()), AQUA); > > hash.put(new Integer(HSSFColor.LIGHT_BLUE.getIndex()), > LIGHT_BLUE); > > hash.put(new Integer(HSSFColor.VIOLET.getIndex()), VIOLET); > > hash.put(new Integer(HSSFColor.GREY_40_PERCENT.getIndex()), > > GREY_40_PERCENT); > > hash.put(new Integer(HSSFColor.PINK.getIndex()), PINK); > > hash.put(new Integer(HSSFColor.GOLD.getIndex()), GOLD); > > hash.put(new Integer(HSSFColor.YELLOW.getIndex()), YELLOW); > > hash.put(new Integer(HSSFColor.BRIGHT_GREEN.getIndex()), > > BRIGHT_GREEN); > > hash.put(new Integer(HSSFColor.BRIGHT_GREEN.getIndex()), > TURQUOISE); > > hash.put(new Integer(HSSFColor.SKY_BLUE.getIndex()), SKY_BLUE); > > hash.put(new Integer(HSSFColor.PLUM.getIndex()), PLUM); > > hash.put(new Integer(HSSFColor.GREY_25_PERCENT.getIndex()), > > GREY_25_PERCENT); > > hash.put(new Integer(HSSFColor.ROSE.getIndex()), ROSE); > > hash.put(new Integer(HSSFColor.LIGHT_YELLOW.getIndex()), > > LIGHT_YELLOW); > > hash.put(new Integer(HSSFColor.LIGHT_GREEN.getIndex()), > > LIGHT_GREEN); > > hash.put(new Integer(HSSFColor.LIGHT_TURQUOISE.getIndex()), > > LIGHT_TURQUOISE); > > hash.put(new Integer(HSSFColor.PALE_BLUE.getIndex()), PALE_BLUE); > > hash.put(new Integer(HSSFColor.LAVENDER.getIndex()), LAVENDER); > > hash.put(new Integer(HSSFColor.WHITE.getIndex()), WHITE); > 164,212c173,221 > < hash.put(HSSFColor.BLACK.hexString, new HSSFColor.BLACK()); > < hash.put(HSSFColor.BROWN.hexString, new HSSFColor.BROWN()); > < hash.put(HSSFColor.OLIVE_GREEN.hexString, > < new HSSFColor.OLIVE_GREEN()); > < hash.put(HSSFColor.DARK_GREEN.hexString, new > HSSFColor.DARK_GREEN()); > < hash.put(HSSFColor.DARK_TEAL.hexString, new > HSSFColor.DARK_TEAL()); > < hash.put(HSSFColor.DARK_BLUE.hexString, new > HSSFColor.DARK_BLUE()); > < hash.put(HSSFColor.INDIGO.hexString, new HSSFColor.INDIGO()); > < hash.put(HSSFColor.GREY_80_PERCENT.hexString, > < new HSSFColor.GREY_80_PERCENT()); > < hash.put(HSSFColor.ORANGE.hexString, new HSSFColor.ORANGE()); > < hash.put(HSSFColor.DARK_YELLOW.hexString, > < new HSSFColor.DARK_YELLOW()); > < hash.put(HSSFColor.GREEN.hexString, new HSSFColor.GREEN()); > < hash.put(HSSFColor.TEAL.hexString, new HSSFColor.TEAL()); > < hash.put(HSSFColor.BLUE.hexString, new HSSFColor.BLUE()); > < hash.put(HSSFColor.BLUE_GREY.hexString, new > HSSFColor.BLUE_GREY()); > < hash.put(HSSFColor.GREY_50_PERCENT.hexString, > < new HSSFColor.GREY_50_PERCENT()); > < hash.put(HSSFColor.RED.hexString, new HSSFColor.RED()); > < hash.put(HSSFColor.LIGHT_ORANGE.hexString, > < new HSSFColor.LIGHT_ORANGE()); > < hash.put(HSSFColor.LIME.hexString, new HSSFColor.LIME()); > < hash.put(HSSFColor.SEA_GREEN.hexString, new > HSSFColor.SEA_GREEN()); > < hash.put(HSSFColor.AQUA.hexString, new HSSFColor.AQUA()); > < hash.put(HSSFColor.LIGHT_BLUE.hexString, new > HSSFColor.LIGHT_BLUE()); > < hash.put(HSSFColor.VIOLET.hexString, new HSSFColor.VIOLET()); > < hash.put(HSSFColor.GREY_40_PERCENT.hexString, > < new HSSFColor.GREY_40_PERCENT()); > < hash.put(HSSFColor.PINK.hexString, new HSSFColor.PINK()); > < hash.put(HSSFColor.GOLD.hexString, new HSSFColor.GOLD()); > < hash.put(HSSFColor.YELLOW.hexString, new HSSFColor.YELLOW()); > < hash.put(HSSFColor.BRIGHT_GREEN.hexString, > < new HSSFColor.BRIGHT_GREEN()); > < hash.put(HSSFColor.BRIGHT_GREEN.hexString, new > HSSFColor.TURQUOISE()); > < hash.put(HSSFColor.SKY_BLUE.hexString, new HSSFColor.SKY_BLUE()); > < hash.put(HSSFColor.PLUM.hexString, new HSSFColor.PLUM()); > < hash.put(HSSFColor.GREY_25_PERCENT.hexString, > < new HSSFColor.GREY_25_PERCENT()); > < hash.put(HSSFColor.ROSE.hexString, new HSSFColor.ROSE()); > < hash.put(HSSFColor.LIGHT_YELLOW.hexString, > < new HSSFColor.LIGHT_YELLOW()); > < hash.put(HSSFColor.LIGHT_GREEN.hexString, > < new HSSFColor.LIGHT_GREEN()); > < hash.put(HSSFColor.LIGHT_TURQUOISE.hexString, > < new HSSFColor.LIGHT_TURQUOISE()); > < hash.put(HSSFColor.PALE_BLUE.hexString, new > HSSFColor.PALE_BLUE()); > < hash.put(HSSFColor.LAVENDER.hexString, new HSSFColor.LAVENDER()); > < hash.put(HSSFColor.WHITE.hexString, new HSSFColor.WHITE()); > --- > > hash.put(HSSFColor.BLACK.getHexString(), BLACK); > > hash.put(HSSFColor.BROWN.getHexString(), BROWN); > > hash.put(HSSFColor.OLIVE_GREEN.getHexString(), > > OLIVE_GREEN); > > hash.put(HSSFColor.DARK_GREEN.getHexString(), DARK_GREEN); > > hash.put(HSSFColor.DARK_TEAL.getHexString(), DARK_TEAL); > > hash.put(HSSFColor.DARK_BLUE.getHexString(), DARK_BLUE); > > hash.put(HSSFColor.INDIGO.getHexString(), INDIGO); > > hash.put(HSSFColor.GREY_80_PERCENT.getHexString(), > > GREY_80_PERCENT); > > hash.put(HSSFColor.ORANGE.getHexString(), ORANGE); > > hash.put(HSSFColor.DARK_YELLOW.getHexString(), > > DARK_YELLOW); > > hash.put(HSSFColor.GREEN.getHexString(), GREEN); > > hash.put(HSSFColor.TEAL.getHexString(), TEAL); > > hash.put(HSSFColor.BLUE.getHexString(), BLUE); > > hash.put(HSSFColor.BLUE_GREY.getHexString(), BLUE_GREY); > > hash.put(HSSFColor.GREY_50_PERCENT.getHexString(), > > GREY_50_PERCENT); > > hash.put(HSSFColor.RED.getHexString(), RED); > > hash.put(HSSFColor.LIGHT_ORANGE.getHexString(), > > LIGHT_ORANGE); > > hash.put(HSSFColor.LIME.getHexString(), LIME); > > hash.put(HSSFColor.SEA_GREEN.getHexString(), SEA_GREEN); > > hash.put(HSSFColor.AQUA.getHexString(), AQUA); > > hash.put(HSSFColor.LIGHT_BLUE.getHexString(), LIGHT_BLUE); > > hash.put(HSSFColor.VIOLET.getHexString(), VIOLET); > > hash.put(HSSFColor.GREY_40_PERCENT.getHexString(), > > GREY_40_PERCENT); > > hash.put(HSSFColor.PINK.getHexString(), PINK); > > hash.put(HSSFColor.GOLD.getHexString(), GOLD); > > hash.put(HSSFColor.YELLOW.getHexString(), YELLOW); > > hash.put(HSSFColor.BRIGHT_GREEN.getHexString(), > > BRIGHT_GREEN); > > hash.put(HSSFColor.BRIGHT_GREEN.getHexString(), TURQUOISE); > > hash.put(HSSFColor.SKY_BLUE.getHexString(), SKY_BLUE); > > hash.put(HSSFColor.PLUM.getHexString(), PLUM); > > hash.put(HSSFColor.GREY_25_PERCENT.getHexString(), > > GREY_25_PERCENT); > > hash.put(HSSFColor.ROSE.getHexString(), ROSE); > > hash.put(HSSFColor.LIGHT_YELLOW.getHexString(), > > LIGHT_YELLOW); > > hash.put(HSSFColor.LIGHT_GREEN.getHexString(), > > LIGHT_GREEN); > > hash.put(HSSFColor.LIGHT_TURQUOISE.getHexString(), > > LIGHT_TURQUOISE); > > hash.put(HSSFColor.PALE_BLUE.getHexString(), PALE_BLUE); > > hash.put(HSSFColor.LAVENDER.getHexString(), LAVENDER); > > hash.put(HSSFColor.WHITE.getHexString(), WHITE); > 222c231 > < return BLACK.index; > --- > > return (short)index; > 231c240 > < return BLACK.triplet; > --- > > return triplet; > 242,581d250 > < return BLACK.hexString; > < } > < > < /** > < * Class BLACK > < * > < */ > < > < public final static class BLACK > < extends HSSFColor > < { > < public final static short index = 0x8; > < public final static short[] triplet = > < { > < 0, 0, 0 > < }; > < public final static String hexString = "0:0:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class BROWN > < * > < */ > < > < public final static class BROWN > < extends HSSFColor > < { > < public final static short index = 0x3c; > < public final static short[] triplet = > < { > < 153, 51, 0 > < }; > < public final static String hexString = "9999:3333:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class OLIVE_GREEN > < * > < */ > < > < public static class OLIVE_GREEN > < extends HSSFColor > < { > < public final static short index = 0x3b; > < public final static short[] triplet = > < { > < 51, 51, 0 > < }; > < public final static String hexString = "3333:3333:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class DARK_GREEN > < * > < */ > < > < public final static class DARK_GREEN > < extends HSSFColor > < { > < public final static short index = 0x3a; > < public final static short[] triplet = > < { > < 0, 51, 0 > < }; > < public final static String hexString = "0:3333:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class DARK_TEAL > < * > < */ > < > < public final static class DARK_TEAL > < extends HSSFColor > < { > < public final static short index = 0x38; > < public final static short[] triplet = > < { > < 0, 51, 102 > < }; > < public final static String hexString = "0:3333:6666"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class DARK_BLUE > < * > < */ > < > < public final static class DARK_BLUE > < extends HSSFColor > < { > < public final static short index = 0x12; > < public final static short[] triplet = > < { > < 0, 0, 128 > < }; > < public final static String hexString = "0:0:8080"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class INDIGO > < * > < */ > < > < public final static class INDIGO > < extends HSSFColor > < { > < public final static short index = 0x3e; > < public final static short[] triplet = > < { > < 51, 51, 153 > < }; > < public final static String hexString = "3333:3333:9999"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class GREY_80_PERCENT > < * > < */ > < > < public final static class GREY_80_PERCENT > < extends HSSFColor > < { > < public final static short index = 0x3f; > < public final static short[] triplet = > < { > < 51, 51, 51 > < }; > < public final static String hexString = "3333:3333:3333"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class DARK_RED > < * > < */ > < > < public final static class DARK_RED > < extends HSSFColor > < { > < public final static short index = 0x10; > < public final static short[] triplet = > < { > < 128, 0, 0 > < }; > < public final static String hexString = "8080:0:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class ORANGE > < * > < */ > < > < public final static class ORANGE > < extends HSSFColor > < { > < public final static short index = 0x35; > < public final static short[] triplet = > < { > < 255, 102, 0 > < }; > < public final static String hexString = "FFFF:6666:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class DARK_YELLOW > < * > < */ > < > < public final static class DARK_YELLOW > < extends HSSFColor > < { > < public final static short index = 0x13; > < public final static short[] triplet = > < { > < 128, 128, 0 > < }; > < public final static String hexString = "8080:8080:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > 584d252 > < } > 587c255 > < * Class GREEN > --- > > * Class BLACK > 591,1483c259,298 > < public final static class GREEN > < extends HSSFColor > < { > < public final static short index = 0x11; > < public final static short[] triplet = > < { > < 0, 128, 0 > < }; > < public final static String hexString = "0:8080:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class TEAL > < * > < */ > < > < public final static class TEAL > < extends HSSFColor > < { > < public final static short index = 0x15; > < public final static short[] triplet = > < { > < 0, 128, 128 > < }; > < public final static String hexString = "0:8080:8080"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class BLUE > < * > < */ > < > < public final static class BLUE > < extends HSSFColor > < { > < public final static short index = 0xc; > < public final static short[] triplet = > < { > < 0, 0, 255 > < }; > < public final static String hexString = "0:0:FFFF"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class BLUE_GREY > < * > < */ > < > < public final static class BLUE_GREY > < extends HSSFColor > < { > < public final static short index = 0x36; > < public final static short[] triplet = > < { > < 102, 102, 153 > < }; > < public final static String hexString = "6666:6666:9999"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class GREY_50_PERCENT > < * > < */ > < > < public final static class GREY_50_PERCENT > < extends HSSFColor > < { > < public final static short index = 0x17; > < public final static short[] triplet = > < { > < 128, 128, 128 > < }; > < public final static String hexString = "8080:8080:8080"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class RED > < * > < */ > < > < public final static class RED > < extends HSSFColor > < { > < public final static short index = 0xa; > < public final static short[] triplet = > < { > < 255, 0, 0 > < }; > < public final static String hexString = "FFFF:0:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class LIGHT_ORANGE > < * > < */ > < > < public final static class LIGHT_ORANGE > < extends HSSFColor > < { > < public final static short index = 0x34; > < public final static short[] triplet = > < { > < 255, 153, 0 > < }; > < public final static String hexString = "FFF:9999:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class LIME > < * > < */ > < > < public final static class LIME > < extends HSSFColor > < { > < public final static short index = 0x32; > < public final static short[] triplet = > < { > < 153, 204, 0 > < }; > < public final static String hexString = "9999:CCCC:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class SEA_GREEN > < * > < */ > < > < public final static class SEA_GREEN > < extends HSSFColor > < { > < public final static short index = 0x39; > < public final static short[] triplet = > < { > < 51, 153, 102 > < }; > < public final static String hexString = "3333:9999:6666"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class AQUA > < * > < */ > < > < public final static class AQUA > < extends HSSFColor > < { > < public final static short index = 0x31; > < public final static short[] triplet = > < { > < 51, 204, 204 > < }; > < public final static String hexString = "3333:CCCC:CCCC"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class LIGHT_BLUE > < * > < */ > < > < public final static class LIGHT_BLUE > < extends HSSFColor > < { > < public final static short index = 0x30; > < public final static short[] triplet = > < { > < 51, 102, 255 > < }; > < public final static String hexString = "3333:6666:FFFF"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class VIOLET > < * > < */ > < > < public final static class VIOLET > < extends HSSFColor > < { > < public final static short index = 0x14; > < public final static short[] triplet = > < { > < 128, 0, 128 > < }; > < public final static String hexString = "8080:0:8080"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class GREY_40_PERCENT > < * > < */ > < > < public final static class GREY_40_PERCENT > < extends HSSFColor > < { > < public final static short index = 0x37; > < public final static short[] triplet = > < { > < 150, 150, 150 > < }; > < public final static String hexString = "9696:9696:9696"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class PINK > < * > < */ > < > < public final static class PINK > < extends HSSFColor > < { > < public final static short index = 0xe; > < public final static short[] triplet = > < { > < 255, 0, 255 > < }; > < public final static String hexString = "FFFF:0:FFFF"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class GOLD > < * > < */ > < > < public final static class GOLD > < extends HSSFColor > < { > < public final static short index = 0x33; > < public final static short[] triplet = > < { > < 255, 204, 0 > < }; > < public final static String hexString = "FFFF:CCCC:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class YELLOW > < * > < */ > < > < public final static class YELLOW > < extends HSSFColor > < { > < public final static short index = 0xd; > < public final static short[] triplet = > < { > < 255, 255, 0 > < }; > < public final static String hexString = "FFFF:FFFF:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class BRIGHT_GREEN > < * > < */ > < > < public final static class BRIGHT_GREEN > < extends HSSFColor > < { > < public final static short index = 0xb; > < public final static short[] triplet = > < { > < 0, 255, 0 > < }; > < public final static String hexString = "0:FFFF:0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < } > < > < /** > < * Class TURQUOISE > < * > < */ > < > < public final static class TURQUOISE > < extends HSSFColor > < { > < public final static short index = 0xf; > < public final static short[] triplet = > < { > < 0, 255, 255 > < }; > < public final static String hexString = "0:FFFF:FFFF"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class SKY_BLUE > < * > < */ > < > < public final static class SKY_BLUE > < extends HSSFColor > < { > < public final static short index = 0x28; > < public final static short[] triplet = > < { > < 0, 204, 255 > < }; > < public final static String hexString = "0:CCCC:FFFF"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class PLUM > < * > < */ > < > < public final static class PLUM > < extends HSSFColor > < { > < public final static short index = 0x3d; > < public final static short[] triplet = > < { > < 153, 51, 102 > < }; > < public final static String hexString = "9999:3333:6666"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class GREY_25_PERCENT > < * > < */ > < > < public final static class GREY_25_PERCENT > < extends HSSFColor > < { > < public final static short index = 0x16; > < public final static short[] triplet = > < { > < 192, 192, 192 > < }; > < public final static String hexString = "C0C0:C0C0:C0C0"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class ROSE > < * > < */ > < > < public final static class ROSE > < extends HSSFColor > < { > < public final static short index = 0x2d; > < public final static short[] triplet = > < { > < 255, 153, 204 > < }; > < public final static String hexString = "FFFF:9999:CCCC"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class TAN > < * > < */ > < > < public final static class TAN > < extends HSSFColor > < { > < public final static short index = 0x2f; > < public final static short[] triplet = > < { > < 255, 204, 153 > < }; > < public final static String hexString = "FFFF:CCCC:9999"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class LIGHT_YELLOW > < * > < */ > < > < public final static class LIGHT_YELLOW > < extends HSSFColor > < { > < public final static short index = 0x2b; > < public final static short[] triplet = > < { > < 255, 255, 153 > < }; > < public final static String hexString = "FFFF:FFFF:9999"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class LIGHT_GREEN > < * > < */ > < > < public final static class LIGHT_GREEN > < extends HSSFColor > < { > < public final static short index = 0x2a; > < public final static short[] triplet = > < { > < 204, 255, 204 > < }; > < public final static String hexString = "CCCC:FFFF:CCCC"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class LIGHT_TURQUOISE > < * > < */ > < > < public final static class LIGHT_TURQUOISE > < extends HSSFColor > < { > < public final static short index = 0x29; > < public final static short[] triplet = > < { > < 204, 255, 255 > < }; > < public final static String hexString = "CCCC:FFFF:FFFF"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class PALE_BLUE > < * > < */ > < > < public final static class PALE_BLUE > < extends HSSFColor > < { > < public final static short index = 0x2c; > < public final static short[] triplet = > < { > < 153, 204, 255 > < }; > < public final static String hexString = "9999:CCCC:FFFF"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class LAVENDER > < * > < */ > < > < public final static class LAVENDER > < extends HSSFColor > < { > < public final static short index = 0x2e; > < public final static short[] triplet = > < { > < 204, 153, 255 > < }; > < public final static String hexString = "CCCC:9999:FFFF"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > < > < /** > < * Class WHITE > < * > < */ > < > < public final static class WHITE > < extends HSSFColor > < { > < public final static short index = 0x9; > < public final static short[] triplet = > < { > < 255, 255, 255 > < }; > < public final static String hexString = "FFFF:FFFF:FFFF"; > < > < public short getIndex() > < { > < return index; > < } > < > < public short [] getTriplet() > < { > < return triplet; > < } > < > < public String getHexString() > < { > < return hexString; > < } > < } > --- > > public static final HSSFColor BLACK = new HSSFColor(new short[] > {0,0,0}, 0x8, "0:0:0"); > > public static final HSSFColor BROWN = new HSSFColor(new short[] {153, > 51, 0}, 0x3c, "9999:3333:0"); > > public static final HSSFColor OLIVE_GREEN = new HSSFColor(new short[] > {51, 51, 0}, 0x3b, "3333:3333:0"); > > public static final HSSFColor DARK_GREEN = new HSSFColor(new short[] > {0, 51, 0}, 0x3a, "0:3333:0"); > > public static final HSSFColor DARK_TEAL = new HSSFColor(new short[] > {0, 51, 102}, 0x38, "0:3333:6666"); > > public static final HSSFColor DARK_BLUE = new HSSFColor(new short[] > {0, 0, 128}, 0x12, "0:0:8080"); > > public static final HSSFColor INDIGO = new HSSFColor(new short[] {51, > 51, 153}, 0x3e, "3333:3333:9999"); > > public static final HSSFColor GREY_80_PERCENT = new HSSFColor(new > short[] {51, 51, 5}, 0x3f, "3333:3333:3333"); > > public static final HSSFColor DARK_RED = new HSSFColor(new short[] > {128, 0, 0}, 0x10, "8080:0:0"); > > public static final HSSFColor ORANGE = new HSSFColor(new short[] {255, > 102, 0}, 0x35, "FFFF:6666:0"); > > public static final HSSFColor DARK_YELLOW = new HSSFColor(new short[] > {128, 128, 0}, 0x13, "8080:8080:0"); > > public static final HSSFColor GREEN = new HSSFColor(new short[] {0, > 128, 0}, 0x11, "0:8080:0"); > > public static final HSSFColor TEAL = new HSSFColor(new short[] > {0,128,128}, 0x15, "0:8080:8080"); > > public static final HSSFColor BLUE = new HSSFColor(new short[] > {0,0,255}, 0xc, "0:0:FFFF"); > > public static final HSSFColor BLUE_GREY = new HSSFColor(new short[] > {102,102,153}, 0x36, "6666:6666:9999"); > > public static final HSSFColor GREY_50_PERCENT = new HSSFColor(new > short[] {128,128,128}, 0x17, "8080:8080:8080"); > > public static final HSSFColor RED = new HSSFColor(new short[] > {255,0,0}, 0xa, "FFFF:0:0"); > > public static final HSSFColor LIGHT_ORANGE = new HSSFColor(new short[] > {255,153,0}, 0x34, "FFFF:9999:0"); > > public static final HSSFColor LIME = new HSSFColor(new short[] > {153,204,0}, 0x32, "9999:CCCC:0"); > > public static final HSSFColor SEA_GREEN = new HSSFColor(new short[] > {51,153,102}, 0x39, "3333:9999:6666"); > > public static final HSSFColor AQUA = new HSSFColor(new short[] > {51,204,204}, 0x31, "3333:CCCC:CCCC"); > > public static final HSSFColor LIGHT_BLUE = new HSSFColor(new short[] > {51,102,255}, 0x30, "3333:6666:FFFF"); > > public static final HSSFColor VIOLET = new HSSFColor(new short[] > {128,0,128}, 0x14, "8080:0:8080"); > > public static final HSSFColor GREY_40_PERCENT = new HSSFColor(new > short[] {150,150,150}, 0x37, "9696:9696:9696"); > > public static final HSSFColor PINK = new HSSFColor(new short[] > {255,0,255}, 0xe, "FFFF:0:FFFF"); > > public static final HSSFColor GOLD = new HSSFColor(new short[] > {255,204,0}, 0x33, "FFFF:CCCC:0"); > > public static final HSSFColor YELLOW = new HSSFColor(new short[] > {255,255,0}, 0xd, "FFFF:FFFF:0"); > > public static final HSSFColor BRIGHT_GREEN = new HSSFColor(new short[] > {0,255,0}, 0xb, "0:FFFF:0"); > > public static final HSSFColor TURQUOISE = new HSSFColor(new short[] > {0,255,255}, 0xf, "0:FFFF:FFFF"); > > public static final HSSFColor SKY_BLUE = new HSSFColor(new short[] > {0,204,255}, 0x28, "0:CCCC:FFFF"); > > public static final HSSFColor PLUM = new HSSFColor(new short[] > {153,51,102}, 0x3d, "9999:3333:6666"); > > public static final HSSFColor GREY_25_PERCENT = new HSSFColor(new > short[] {192,192,192}, 0x16, "C0C0:C0C0:C0C0"); > > public static final HSSFColor ROSE = new HSSFColor(new short[] > {255,153,204}, 0x2d, "FFFF:9999:CCCC"); > > public static final HSSFColor TAN = new HSSFColor(new short[] > {255,104,153}, 0x2f, "FFFF:CCCC:9999"); > > public static final HSSFColor LIGHT_YELLOW = new HSSFColor(new short[] > {255,255,153}, 0x2b, "FFFF:FFFF:9999"); > > public static final HSSFColor LIGHT_GREEN = new HSSFColor(new short[] > {204,255,204}, 0x2a, "CCCC:FFFF:CCCC"); > > public static final HSSFColor LIGHT_TURQUOISE = new HSSFColor(new > short[] {204,255,255}, 0x29, "CCCC:FFFF:FFFF"); > > public static final HSSFColor PALE_BLUE = new HSSFColor(new short[] > {153,204,255}, 0x2c, "9999:CCCC:FFFF"); > > public static final HSSFColor LAVENDER = new HSSFColor(new short[] > {204,153,255}, 0x2e, "CCCC:9999:FFFF"); > > public static final HSSFColor WHITE = new HSSFColor(new short[] > {255,255,255}, 0x9, "FFFF:FFFF:FFFF"); > > > -----Original Message----- > > From: Glen Stampoultzis [SMTP:[EMAIL PROTECTED]] > > Sent: Saturday, 20 July 2002 21:27 > > To: [EMAIL PROTECTED] > > Subject: Colours > > > > At one stage we had an AUTOMATIC colour... anyone know what happened with > > that? > > > > Also I don't really understand HSSFColor. What is the evil triplet issue > > and why is each colour implemented as a class and not an instance? > > > > Thank you for your patience with my small brain. > > > > Regards, > > > > Glen Stampoultzis (TriNexus Pty Ltd) > > Fixed:+61 3 9753-6850 Mob:+61 (0)402 835 458 > > ICQ: 62722370 EMail: [EMAIL PROTECTED] > > URL's: http://jakarta.apache.org/poi, http://www.krysalis.org > > > > > > > > > > > > -- > > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
