AnimalCrossingQR.ColorDialog.DrawNineBox C# (CSharp) Method

DrawNineBox() private method

private DrawNineBox ( Graphics graphics, int x, int y, int colorIndex ) : void
graphics System.Drawing.Graphics
x int
y int
colorIndex int
return void
        private void DrawNineBox(Graphics graphics, int x, int y, int colorIndex)
        {
            graphics.FillRectangle(Brushes.Gray, new Rectangle(x - ColorBoxBorder, y - ColorBoxBorder, ColorBoxBorder * 4 + ColorBoxSize * 3, ColorBoxBorder * 4 + ColorBoxSize * 3));

            for (int i = 0; i < 3; i++)
                for (int j = 0; j < 3; j++)
                {
                    Rectangle rect = new Rectangle(
                            x + (ColorBoxSize + ColorBoxBorder) * i,
                            y + (ColorBoxSize + ColorBoxBorder) * j,
                            ColorBoxSize,
                            ColorBoxSize);

                    graphics.FillRectangle(paletteBrushes[colorIndex + 3 * j + i], rect);
                    graphics.DrawString(paletteLabels[colorIndex + 3 * j + i], textFont, oppositePaletteBrushes[colorIndex + 3 * j + i], rect, stringFormat);
                }
        }