Notes

from Kemper Barkhurst

Script-fu Color Wheel Generation

I was able to put together this color wheel shown here and the Gimp script can be downloaded at:

script-fu-kbColorWheel.scm

Without getting into the syntax of it all this is the basic process:

  1. Create a new image and set the size.
  2. Set a series of variables to store some of that math such as pi, how many color wedges will be used and an array of the three x,y coordinates for the triangle that makes up the wedge.
  3. Run a loop to generate the wedges, set the color values of each wedge by adjusting the hue, and rotate the wedge.
  4. Flatten these wedge layers into one and rotate it 180 degrees because the initial hue value at the top was cyan and I wanted it to start with red. *
  5. To generate the three hue transition strips on the left another loop is setup.  This loop runs three times and at each instance it defines the background and foreground. The x positioning is defined by multiplying out the loop instance by the width of the strip.  This could have also been setup with one set of colors and adjusted via hue values if one felt incline to minimize code further.
  6. Last and the most important step is to then display this image.

*Notice the color wheel doesn’t start from red at the top. My rotation is wrong but I didn’t feel inclined to fix it.  I’ll add this to my list of future enhancements.

Leave a Comment