dad626f9fe8ef4f14a3297b77fdbc951b8b7630e ceisenhart Fri Mar 18 14:56:50 2016 -0700 changing the white to black rainbow to be called greyscale as suggested by Jim, refs #16216 diff --git src/lib/rainbow.c src/lib/rainbow.c index 686dc03..ea53039 100644 --- src/lib/rainbow.c +++ src/lib/rainbow.c @@ -96,31 +96,31 @@ {174,207,255}, {174,191,255}, {174,174,255}, {191,174,255}, {207,174,255}, {223,174,255}, {239,174,255}, {255,174,255}, {255,174,239}, {255,174,223}, {255,174,207}, {255,174,191}, }; -static struct rgbColor whiteToBlackRainbowTable[30] = { +static struct rgbColor greyScaleRainbowTable[30] = { /* This is a rainbow from white to black. There are no colors, only varying * shades of grey. It is good for displays that are not meant to draw attention. */ {255,255,255}, {247,247,247}, {238,238,238}, {230,230,230}, {221,221,221}, {213,213,213}, {204,204,204}, {196,196,196}, {187,187,187}, {179,179,179}, {170,170,170}, {162,162,162}, {153,153,153}, @@ -175,35 +175,35 @@ struct rgbColor lightRainbowAtPos(double pos) /* Given pos, a number between 0 and 1, return a lightish rainbow rgbColor * where 0 maps to red, 0.1 is orange, and 0.9 is violet and 1.0 is back to red */ { return interpolatedHue(lightRainbowTable, ArraySize(lightRainbowTable), pos); } struct rgbColor saturatedRainbowAtPos(double pos) /* Given pos, a number between 0 and 1, return a saturated rainbow rgbColor * where 0 maps to red, 0.1 is orange, and 0.9 is violet and 1.0 is back to red */ { return interpolatedHue(saturatedRainbowTable, ArraySize(saturatedRainbowTable), pos); } -struct rgbColor whiteToBlackRainbowAtPos(double pos) +struct rgbColor greyScaleRainbowAtPos(double pos) /* Given pos, a number between 0 and 1, return a blackToWhite rainbow rgbColor * where 0 maps to white, 0.1 is grey, and 1 is black. */ { -return interpolatedHue(whiteToBlackRainbowTable, ArraySize(whiteToBlackRainbowTable), pos); +return interpolatedHue(greyScaleRainbowTable, ArraySize(greyScaleRainbowTable), pos); } struct rgbColor *getRainbow(struct rgbColor (*rainbowAtPos)(double pos), int size) /* Return array filled with rainbow of colors */ { struct rgbColor *colors; AllocArray(colors, size); double invCount = 1.0/size; double pos; int i; for (i = 0; i < size; i++) { pos = invCount * i; colors[i] = (*rainbowAtPos)(pos); }