numeric[]
The blend factors of a graduation determine how the colors change from start to finish. They are relevant for 2-color graduations only. Graduations with blend factors (and/or blend positions) are known as custom blends.
Each value is a factor of the transition from start to finish color in the range 0 through 1, e.g. 0 is the start color, 1 is the finish color, 0.5 is half way through the transition from start to finish. There can be a maximum of 32 factors, producing a maximum of 32 color transitions.
Unless blend positions are also defined, the color transitions are evenly spaced across the area being filled.
Here is an example of a graduation with both blend factors and positions.
The command to create this graduation is as follows:
graduation mygrad,-rgb=<blue.rgb,yellow.rgb>,-fac=<0,0.9,0,0.9,0>,-pos=<0,0.25,0.5,0.75,1>
Once created, the graduation.blend_factors array would contain 5 values 0,0.9,0,0.9,0.
The above blend has been applied to a linear graduation, but blends can also be applied to shaped graduations with some interesting effects. Consider an octagon, filled with the same blend but with a non-linear automatic shape:
The command to create the above graduation is as follows:
graduation mygrad,-sh=1,-rgb=<blue.rgb,yellow.rgb>,-fac=<0,0.9,0,0.9,0>,-pos=<0,0.25,0.5,0.75,1>
Commands: |
|