function J = lcmap(m,hue) % function J = lcmap(m,hue) % % Linear Color Map % LCMAP(M) is an M-by-3 matrix % Saturation linearly ramped from 0 to 1 % Intensity linearly ramped from 0.2 to 1 (black is too low for % details...perhaps on better screens) % Hue is constant % LCMAP, by itself, is the same length as the current figure's % colormap. % % optional second input "hue" is scalar color value. Hue is cyclical about % (0,1) w/ red at bounds % % Following IBM research on human color perception: % Why Should Engineers and Scientists Be Worried About Color? % http://www.research.ibm.com/people/l/lloydt/color/color.HTM % % T.Hilmer UH % 2010.03.14 version 1 if nargin < 1 || isempty(m) m = size(get(gcf,'colormap'),1); end if nargin < 2 hue = 1/3; % a nice blue color else if 0 > hue || hue > 1 warning('second input "hue" outside (0,1) will give black') end end J = zeros(m,3); % HSV ramps: J(:,1) = hue; % HUE J(:,2) = linspace(0.25,1,m); % SATURATION J(:,3) = fliplr(linspace(0.5,1,m)); % INTENSITY J = hsv2rgb(J);