2 summary:: A linear color fade between an outside and an inside color
3 categories:: GUI>GUI-Tools
4 related:: Classes/Color, Classes/Gradient
7 A linear color fade between an outside and an inside color.
17 code::\h:: or code::\v:: for horizontal and vertical respectively. Default value is code::\v::.
19 The resolution of the gradient. Default value is 64.
21 The center of the gradient. Default value is 0.33, i.e. off center toward the top on a vertical gradient.
28 v = CompositeView(w, Rect(50, 50, 200, 50));
29 v.background = HiliteGradient(Color.gray, Color.white);
32 // change direction and resolution
35 w.view.background = HiliteGradient(Color.red, Color.white, \h, 12, 0.5);
38 // almost unnoticeable variations can be pleasant
41 v = CompositeView(w, Rect(50,50,300,300));
44 v.background = HiliteGradient(c, d, \v);
49 var w, k, c, d, e, c1, c2, f, g;
51 k = Slider2D(w, Rect(50, 50, 300, 300));
58 c1 = d.hueBlend(e, k.y).round(0.01);
59 c2 = c.hueBlend(e, k.x).round(0.01);
60 k.background = HiliteGradient(c1, c2, \v)
64 k.mouseUpAction = { [c1, c2].postln };
65 k.keyDownAction = f; // hit any key for new color