text: 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;}