public HSSFColor findSimilarColor(int red, int green, int blue) {HSSFColor result = null;int minColorDistance = Integer.MAX_VALUE;byte[] b = _palette.getColor(PaletteRecord.FIRST_COLOR_INDEX);for (short i = PaletteRecord.FIRST_COLOR_INDEX; b != null;b = _palette.getColor(++i)){int colorDistance = Math.abs(red - unsignedInt(b[0])) +Math.abs(green - unsignedInt(b[1])) +Math.abs(blue - unsignedInt(b[2]));if (colorDistance < minColorDistance){minColorDistance = colorDistance;result = getColor(i);}}return result;}

public HSSFColor FindSimilarColor(byte red, byte green, byte blue){HSSFColor result = null;int minColorDistance = int.MaxValue;byte[] b = palette.GetColor(PaletteRecord.FIRST_COLOR_INDEX);for (short i = (short)PaletteRecord.FIRST_COLOR_INDEX; b != null;b = palette.GetColor(++i)){int colorDistance = Math.Abs(red - b[0]) +Math.Abs(green - b[1]) + Math.Abs(blue - b[2]);if (colorDistance < minColorDistance){minColorDistance = colorDistance;result = GetColor(i);}}return result;}
