Brendan Lane - 2014-07-02

I've run into a problem with the C API function ShadeImage(), and I'm wondering if it's a bug or I'm misunderstanding something. The API documentation describes the parameter gray as

A value other than zero shades the intensity of each pixel.

But this seems to be the opposite of the true function. Indeed, in the code (effect.c line 3896), the logic is something like

if(gray)
  color = computed shade
else
  color = color * computed shade

i.e. shades the intensity of each pixel in the else, which is the case of gray==0! Am I misunderstanding how this is supposed to work?