+local function make_rainbow_pigment(scale)
+ return function (x,y)
+
+ local Ired = math.sin(x/math.pi/scale)^2 * math.sin(y/math.pi/scale)^2
+ local Igreen = math.cos(x/math.pi/scale)^2 * math.sin(y/math.pi/scale)^2
+ local Iblue = math.sin(x/math.pi/scale)^2 * math.cos(y/math.pi/scale)^2
+
+ return C.red*Ired + C.green*Igreen + C.blue*Iblue
+ end
+end
+
+