source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/lightspeed/graphics/YR_colors.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

  • Property svn:executable set to *
File size: 676 bytes
Line 
1function colors = YR_colors(n)
2% YR_colors    A good sequential colormap.
3% YR_colors(n) returns an RGB matrix of n colors (default 64).
4% These colors form a sequential colormap (colors easily perceived to lie
5% on a sequence).
6%
7% Example:
8%   colormap(YR_colors)
9%
10% See also YlGnBu_colors
11
12% Written by Tom Minka
13
14if nargin < 1
15  n = 64;
16end
17
18lt = 0.97;
19dk = 0.03;
20k = ceil(n/3);
21lts = repmat(lt,1,k);
22dks = repmat(dk,1,k);
23span = linspace(lt,dk,k+1);
24span = span(1:(end-1));
25r = [lts lts span];
26g = [lts span dks];
27b = [span dks dks];
28colors = [r;g;b]';
29colors = flipud(colors);
30i = round(linspace(1,rows(colors),n));
31colors = colors(i,:);
Note: See TracBrowser for help on using the repository browser.