function c = xgray(m)
%XGRAY a gray spectrum not including black or white
%	XGRAY(M) returns an M-by-3 matrix containing a gray-scale
%	colormap, not including black or white so outlines will show.
%	XGRAY, by itself, is the same length as the current colormap.
%
%	For example, to reset the colormap of the current figure:
%
%	          colormap(xgray)
%
%	See also HSV, HOT, COOL, BONE, COPPER, PINK, FLAG, 
%	COLORMAP, RGBPLOT.

%     Copyright J. V. Mansbridge, CSIRO, Tue Aug  2 11:15:23 EST 1994

% grayscale, not including black or white so outlines will show   

x = [
   85,  85,  85,    90,  90,  90,    95,  95,  95,   100, 100, 100,
  105, 105, 105,   110, 110, 110,   115, 115, 115,   120, 120, 120,
  125, 125, 125,   130, 130, 130,   135, 135, 135,   140, 140, 140,
  145, 145, 145,   150, 150, 150,   155, 155, 155,   160, 160, 160,
  165, 165, 165,   170, 170, 170,   175, 175, 175,   180, 180, 180,
  185, 185, 185,   190, 190, 190,   195, 195, 195,   200, 200, 200,
  205, 205, 205,   210, 210, 210,   215, 215, 215,   220, 220, 220,
  225, 225, 225,   230, 230, 230,   235, 235, 235,   240, 240, 240
];

x = reshape(x'/255, 96, 1);
if nargin < 1, m = size(get(gcf,'colormap'),1); end
mm = m - 1;
x_32 = (0:31)/31;
x_m = (0:mm)/mm;
r = interp1(x_32, x(1:3:94), x_m);
g = interp1(x_32, x(2:3:95), x_m);
b = interp1(x_32, x(3:3:96), x_m);
c = [ r g b ];
