| Last updated: 2011-08-07 |
| xmCHART Gradients | back |
| New in xmCHART 3.4 are linear and radial gradients. Gradients are available for all xmCHART functions (fills, borders, texts, etc.) and are defined by a list of numbers. | ||
| Linear Gradients | ||
| [ 1 angle isScalableFlag offset1 r1 g1 b1 a1 offset2 r2 g2 b2 a2 ... ] | ||
|
For linear gradients the first value of the list is always 1, the second value defines the direction of the gradient within a range of -360 and +360 degrees. 0 degree defines a horizontal gradient from left to right, 90 degrees a gradient from top to bottom. The third value is either 0 or 1, 1 means the angle of the gradient is linked to the width/height ratio of the bounding box, which is in most cases preferable. For example, for a diagonal gradient set the first three values to 1 45 1. On the other hand if you set the third value 0 (1 45 0 ...) the direction of the gradient is always exactly 45 degrees regardless of the shape of the bounding box. These three values follows a series of color stops. A color stop is represented by five elements: offset, red, green, blue and alpha. Offsets are between 0 and 1, the four RGBA components are between 0 and 255. OpenDrawing(300;100)
|
||
|
OpenDrawing(300;100)
|
||
| Radial Gradients | ||
| [ 2 cx cy offset1 r1 g1 b1 a1 offset2 r2 g2 b2 a2 ... ] | ||
For radial gradients the first value of the list is always 2. The second and third value represent the center point in relative coordinates in respect to the bounding box. For example, the center of the bounding box is defined by cx=0.5 and cy=0.5. These three values follows a series of color stops. A color stop is represented by five elements: offset, red, green, blue and alpha. Offsets are between 0 and 1, the four RGBA components are between 0 and 255. For example: OpenDrawing(300;100) |
||
| ©2012 X2max Software | back |