samer@47: function D=desat(C,s) samer@47: % desat(C,s) samer@47: % desaturate colormap - moves all colours towards samer@47: % a grey of roughly equivalent brightness samer@47: % C - colourmap (N by 3 matrix) samer@47: % s - saturation: 1 no change, 0 completely grey samer@47: samer@47: % this matrix transforms to grey samer@47: G=[0.3 0.5 0.2]'*[1 1 1]; samer@47: D=s*C + (1-s)*C*G; samer@47: samer@47: samer@47: samer@47: