Although RRDTool by default has the ability to generate various colourful graphs, it simply cannot do gradients. Graphs are good for quickly identifying spikes in the data but it is harder to quickly identify high (or low) values when the data is relatively consistent.
Having decided I wanted to monitor the temperature of various points in my room, I figured it would be a good time to create a script that would generate a graph that made it obvious if values were high or low. The script I finally came up with creates graphs that look something like:

The script works by creating lots of data points for the various colours that will make up the gradient. Each data point has a range of values that it represents, for example 20°C to 20.5°C. The data points are set so that if the sampled value is outside it's range, then it is set to 0 otherwise it keeps the value for the graph. Once the data points are created, all you need to do is add all the data points to the graph using the AREA command (a line will not work). The following PHP will generate the necessary data points for the graph, the code is not complete and requires some missing functions which are detailed below.
PHP code:In the code snippet above there are some undefined variables. These are meant to be set in the PHP code that eventually will call this script. Those variables are explained below:
There are two missing functions that are used in the script, they are id() and colour(). The id() function simply returns a safe string (based on the number passed to it) for use in the CDEF data points. The colour() function returns a 6 digit hex string that represents the colour to be used for the requested range of values.
Ignoring the complex nature of the script and the huge length of the command it runs, the only real issue is that --slope-mode cannot be used otherwise gaps will appear in the graph due to the smoothing algorithm.
The full script that is attached to this article (see below) is designed to be included by other files once the necessary variables have been declared. There is a simple check at the top of the script which will allow you to see which variables need to be declared. They are all explained in the list above except the $SENSOR variable, this is simply the name of the data source in the RRD file. There are a couple of variables ($INCREMENT and $RRD) and functions (colour()) that are in the script but can easily be moved out to allow more customisation.
Any problems using the script then feel free to contact me.