You might be able to do that without having to modify the source code.
Define three pigments, each using a slope_map oriented towards each of
the main axes, and each using one of the RGB components as its color map
(ie. the first would be from black to red, the second from black to green,
and so on). Then use the average of these pigments as your overall pigment
of the object.
--
- Warp