public HSSFColor addColor( byte red, byte green, byte blue ){byte[] b = _palette.getColor(PaletteRecord.FIRST_COLOR_INDEX);short i;for (i = PaletteRecord.FIRST_COLOR_INDEX; i < PaletteRecord.STANDARD_PALETTE_SIZE + PaletteRecord.FIRST_COLOR_INDEX; b = _palette.getColor(++i)){if (b == null){setColorAtIndex( i, red, green, blue );return getColor(i);}}throw new RuntimeException("Could not find free color index");}
public HSSFColor AddColor(byte red, byte green, byte blue){byte[] b = palette.GetColor(PaletteRecord.FIRST_COLOR_INDEX);short i;for (i = (short)PaletteRecord.FIRST_COLOR_INDEX; i < PaletteRecord.STANDARD_PALETTE_SIZE + PaletteRecord.FIRST_COLOR_INDEX; b = palette.GetColor(++i)){if (b == null){SetColorAtIndex(i, red, green, blue);return GetColor(i);}}throw new Exception("Could not Find free color index");}