color file format

I have noticed that there seems to be two main methods of representing the color scheme for a grass raster file. The first, by explictly listing each class number and the associated r g b values for it. The second, to give a range of values and the starting and ending color values. What would be the most automated method to convert the second type of scheme to the first?

_____________________________________________________________________
| |
| Tom Nelson |
| Corps of Engineers |
| Fort Worth, Texas |
| (817) 334-2095 |
| |
| tom@155.84.92.2 |
|____________________________________________________________________|