Instead of aprupt changes in colors as in the color list patterns we now want to produce colors which change gradually. For this we need a function returning float values for each point in space and some way to calculate colors out of these values.
This later step is achieved by color maps, which give a table of pairs of return values between 0 and 1 and corresponding colors. The return values of the function modulo 1 are then used to interpolate between these colors. The syntax of a color_map is:
color_map { [T1 color C1] [T2 color C2] .... [Tn color Cn] }Note that here the square brackets `[' and `]' belong to the syntax and are not indicators for optional parameters. The number of colors may be between 1 and 256. The -values should satisfy . If the function returns one of these values modulo 1 for some point in space, then the corresponding color is used. If the value modulo 1 lies between and then the two colors and are interpolated correspondingly. If the value modulo 1 is smaller than (resp. large than ) then color (resp. ) is used.
Now we turn to the function assigning float values to all points in space. There are many predefined functions, like:
If these predefined functions are not sufficient the user may supply his own function as follows:
function { USER_FUNCTION }with a user defined function USER_FUNCTION (in the simplest case this is just some expression in , and ), see [pov:6.1.6 User-Defined Functions]
So this type of pigment statement will look like:
pigment { function { ... } color_map { ... } }
When all else fails one may use
Andreas Kriegl 2003-07-23