In Looking up color table I showed how to look up colors from a growing table of color models, in order to create color swatches. These show distinct colors with a hard stop between them, like this
But lets say that we wanted the intermediate colors to be automatically calculated - creating a smooth transition between each color.
You can calculate the transition between two colors by adjusting the red, blue and green mix proportional to the distance traveled between the source and target color. Putting it all together, you can see the smooth transition between each color in the swatch, compared to the discrete individual color components.
This is covered in detail in the Color ramp library. Here's the code for creating the diagram above, using the libraries in the cDataSet.xlsm workbook.
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Color Fiesta >