public Brush CreateBrush(bool swapColors) { if (!swapColors) { return(BrushInfo.CreateBrush(PrimaryColor.ToColor(), SecondaryColor.ToColor())); } else { return(BrushInfo.CreateBrush(SecondaryColor.ToColor(), PrimaryColor.ToColor())); } }
public Pen CreatePen(BrushInfo brushInfo, Color foreColor, Color backColor) { Pen pen; if (brushInfo.BrushType == BrushType.None) { pen = new Pen(foreColor, width); } else { pen = new Pen(brushInfo.CreateBrush(foreColor, backColor), width); } LineCap startLineCap; CustomLineCap startCustomLineCap; LineCapToLineCap2(this.startCap, out startLineCap, out startCustomLineCap); if (startCustomLineCap != null) { pen.CustomStartCap = startCustomLineCap; } else { pen.StartCap = startLineCap; } LineCap endLineCap; CustomLineCap endCustomLineCap; LineCapToLineCap2(this.endCap, out endLineCap, out endCustomLineCap); if (endCustomLineCap != null) { pen.CustomEndCap = endCustomLineCap; } else { pen.EndCap = endLineCap; } pen.DashStyle = this.dashStyle; return(pen); }