public static int ColorIndex(int x, int y) { int index = (x / OutfitColorBoxSize) + OutfitColorsPerRow * (y / OutfitColorBoxSize); if (index < 0 || index >= outfitColors.Count) return -1; return index; }
private void ChangeOutfitColor(object sender, MouseEventArgs e) { int index = OutfiterManager.ColorIndex(e.X, e.Y); if (index < 0) { return; } outfit.colors[colorIndex] = index; RefreshColorPicker(colorIndex); RefreshImage(); }