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.