private void PaintSelectionBorder(Graphics gr, int index, int balance) { // balance is the percentage solidity to draw (see animation section) if (!m_Applicable) { return; } Color colour = Color.Orange.MixWith(BackColor, balance); Rectangle outside = ColourRectangleIncludingSelection(index); Debug.Assert(outside.Width == outside.Height); using (Pen pn = new Pen(colour, 2)) { using (GraphicsPath path = GUIUtilities.CreateRoundedRectPath(outside.X, outside.Y, outside.Width, 3, 3)) { gr.DrawPath(pn, path); } } }