private Drawing.Bitmap GetAtrriutesBackground(Card card) { Drawing.Color colorTo; Drawing.Color colorFrom; if (card.Attributes.Count == 1) { Drawing.Color baseColor = ClassAttributesHelper.DeckAttributeColors[card.Attributes[0]]; colorTo = colorFrom = baseColor.ApplyFactor(0.7); } else { colorTo = ClassAttributesHelper.DeckAttributeColors[card.Attributes[0]]; colorFrom = ClassAttributesHelper.DeckAttributeColors[card.Attributes[1]]; colorTo = colorTo.ApplyFactor(0.7); colorFrom = colorFrom.ApplyFactor(0.7); } Drawing.Bitmap attribsBitmap = new Drawing.Bitmap(160, 44); Drawing.Brush brush = new LinearGradientBrush( new Drawing.PointF(39, (float)0), new Drawing.PointF(120, (float)0), colorFrom, colorTo); Drawing.Brush brushFrom = new Drawing.SolidBrush(colorFrom); Drawing.Brush brushTo = new Drawing.SolidBrush(colorTo); using (Drawing.Graphics graphics = Drawing.Graphics.FromImage(attribsBitmap)) { graphics.FillRectangle(brushFrom, new Drawing.Rectangle(0, 0, 40, 44)); graphics.FillRectangle(brush, new Drawing.Rectangle(40, 0, 80, 44)); graphics.FillRectangle(brushTo, new Drawing.Rectangle(120, 0, 40, 44)); } return(attribsBitmap); }