2 summary:: A linear color fade between an outside and an inside color
3 categories:: GUI>Accessories
4 related:: Classes/Color, Classes/Gradient
7 A linear color fade between an outside and an inside color.
9 note:: The use of HiliteGradient is strong::not supported yet in Qt GUI::. When HiliteGradient is used in place of Color, the average gradient color will be used instead. ::
19 code::\h:: or code::\v:: for horizontal and vertical respectively. Default value is code::\v::.
21 The resolution of the gradient. Default value is 64.
23 The center of the gradient. Default value is 0.33, i.e. off center toward the top on a vertical gradient.
30 v = CompositeView(w, Rect(50, 50, 200, 50));
31 v.background = HiliteGradient(Color.gray, Color.white);
34 // change direction and resolution
37 w.view.background = HiliteGradient(Color.red, Color.white, \h, 12, 0.5);
40 // almost unnoticeable variations can be pleasant
43 v = CompositeView(w, Rect(50,50,300,300));
46 v.background = HiliteGradient(c, d, \v);
51 var w, k, c, d, e, c1, c2, f, g;
53 k = Slider2D(w, Rect(50, 50, 300, 300));
60 c1 = d.hueBlend(e, k.y).round(0.01);
61 c2 = c.hueBlend(e, k.x).round(0.01);
62 k.background = HiliteGradient(c1, c2, \v)
66 k.mouseUpAction = { [c1, c2].postln };
67 k.keyDownAction = f; // hit any key for new color