chickadee » macaw » hsl-array-for-each

hsl-array-for-each proc hsl-array ...procedure

Calls proc once for each color in the given hsl-array(s). If the arrays are different sizes, it iterates over the overlapping area (i.e. the smallest width and smallest height).

The iteration proceeds in row-major order. proc is called with the x coordinate, y coordinate, and the corresponding hsl color from each given array. Modifying the color(s) will modify the array data. The color's parent will be automatically set to the array, so that the array will not be garbage collected while the color is using its memory.

(hsl-array-for-each
  (lambda (x y hsl_1 hsl_2)
    (hsl-lerp! hsl_1 hsl_2 (/ x 100.0)))
  hsl-array_1 hsl-array_2)