protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); using (SolidBrush b = JPaint.GetStyleBrush(Style)) { LinearGradientBrush linearGradientBrush = new LinearGradientBrush(this.ClientRectangle, Color.Red, Color.Yellow, 45); ColorBlend cblend = new ColorBlend(3); cblend.Colors = new Color[3] { Color.Black, Color.Magenta, Color.Gold }; cblend.Positions = new float[3] { 0f, 0.1f, 1f }; linearGradientBrush.InterpolationColors = cblend; Rectangle topRect = new Rectangle(0, 0, Width, 5); e.Graphics.FillRectangle(linearGradientBrush, topRect); } }
private void Start() { _jpaint = GameObject.Find("JPaint").GetComponent <JPaint>(); }