Variable | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## *color-gradient-blend*

This variable has an effect only on the Windows platform.

This variable specifies how the lightness of the fill color will vary along the line from its lightest shade to its darkest, when filling an area while `*color-gradient-filling*` is true.

The default value is `nil`, which means that the lightness will vary in a linear manner. Otherwise the value should be an association list, where each element in the list is a list of two real numbers between zero and one (exclusive). The first number indicates a fraction of the distance from the lightest point to the darkest point. The second number indicates a fraction of the change in lightness from the lightest shade to the darkest shade, which will be used at the corresponding point. The first number in each pair should be greater than the first number in the preceding pair, and likewise for the second number.

This is best explained with an example. Here's what would be drawn if `*color-gradient-direction*` is `:vertical` and `*color-gradient-blend*` is `((.2 .3) (.8 .5))`. The lightest version of the fill color will be used at the very top of the filled area. At one-fifth (.2) of the distance to the bottom of the filled area, the color will be darker by 30% (.3) of the total lightness range, and will darken linearly between the top and that point. At four-fifths (.8) of the distance, the color will have darkened by 50% (.5) from the lightest shade. It will darken by the remaining 50% of the lightness range between there and the bottom. The lightness range itself is controlled by `*color-gradient-intensity*`.

That particular value would distribute most of the lightness change toward the top and bottom edges, varying the lightness only by 20% over the middle three-fifths of the area. That creates a three-dimensional effect that looks like a raised button that's relatively flat in the middle. It also may be suitable for a label that's drawn in the middle of the area, to avoid a large color shift under the text that may decrease the readability. (The linear shift that results from the default value of nil tends to look somewhat like a horizontal line drawn through the middle of the text.) The example value also distributes more of the color shift toward the darker edge than toward the lighter edge, to avoid darkening the middle area more than needed.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version