function [c] = redblue2(m)
%
% redblue2  	Shades of red to white to blue colormap.
%		REDBLUE(M) returns an M-by-3 matrix containing a
%		"redblue" colormap.
%               CAVEAT this actually only works properly for even length
%               colormaps.  Some fiddling will get it to work generally.
%
%		See also HSV, COLORMAP, RGBPLOT.

if nargin<1
  [m,n] = size(colormap);
end;

base_map=jet(m);

% This is the current midcolor
mid_ind=round(m/2);
mid_color=[1 1 1]-base_map(mid_ind,:);
add_map=[gray(mid_ind) ; flipud(gray(m-mid_ind))].*meshgrid(mid_color,1:m);
c=base_map+add_map;
c(find(c>1))=1;