void drawtrect(DrawContext c, trect tr, double r, double g, double bl) { var p = new Path(FillMode.Winding); var b = new SolidColorBrush(); b.R = r; b.G = g; b.B = bl; b.A = 1.0; if (tr.isIn) { b.R += b.R * 0.75; b.G += b.G * 0.75; b.B += b.B * 0.75; } p.AddRectangle(tr.left, tr.top, tr.right - tr.left, tr.bottom - tr.top); p.End(); c.Fill(p, b); p.Free(); }