desaturate colors in matlab
April 14th, 2008 by Lawrence David
it’s surprisingly easy to desaturate colors in matlab.  the trick is to use the HSV (hue, saturation, value) transformation to do so.  for instance, to desaturate the color blue ([0 0 1] in RGB-speak) by 25%, use the following commands:
>> desat = [1 0.75 1];
>> blue_desat = hsv2rgb(desat.*rgb2hsv([0 0 1]));
Â
Â