public static Bitmap GenerateColorImage(int pressedIndex)
{
Bitmap bitmap = new Bitmap(OutfitColorBoxSize * OutfitColorsPerRow, OutfitColorBoxSize * 8);
using (Graphics gr = Graphics.FromImage(bitmap)) {
int index = 0;
for (int i = 0; i < outfitColors.Count; i++) {
int x = OutfitColorBoxSize * (index % OutfitColorsPerRow);
int y = OutfitColorBoxSize * (index / OutfitColorsPerRow);
using (Brush brush = new SolidBrush(outfitColors[i]))
gr.FillRectangle(brush, new Rectangle(x, y, OutfitColorBoxSize - 1, OutfitColorBoxSize - 1));
gr.DrawImage(i == pressedIndex ? StyleManager.GetImage("color_bevel_pressed.png") : StyleManager.GetImage("color_bevel.png"), new Rectangle(x, y, OutfitColorBoxSize, OutfitColorBoxSize));
index++;
}
}
return bitmap;
}