source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/lightspeed/graphics/RYB_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: 1.2 KB
Line 
1function colors = RYB_colors(n)
2% RYB_colors    A good diverging colormap.
3% RYB_colors(n) returns an RGB matrix of n colors (default 7).
4% These colors form a diverging colormap (colors easily perceived to lie
5% on a sequence on either side of a central color).
6%
7% Example:
8%   colormap(RYB_colors)
9%
10% See also YR_colors.
11
12% Written by Tom Minka
13
14if nargin < 1
15  n = 7;
16end
17
18% In R: col2rgb(RYB.colors(3))
19switch n
20  case 7,
21    colors = [
22      215    61   41;
23      252   141   89;
24      254   224  144;
25      255   255  191;
26      224   243  248;
27      145   191  219;
28      69   117  180
29      ]/255;
30  case 6,
31    colors = [
32       215    61   41
33       252   141   89
34       254   224  144
35       224   243  248
36       145   191  219
37        69   117  180
38      ]/255;
39  case 5,
40    colors = [
41       202    55   59
42       253   174   97
43       255   255  191
44       171   217  233
45        44   123  182
46        ]/255;
47  case 4,
48    colors = [
49      202    55   59;
50      253   174   97
51      171   217  233;
52       44   123  182
53       ]/255;
54   case 3,
55     colors = [
56       252   141   89;
57       255   255  191;
58       145   191  219
59       ]/255;
60end
Note: See TracBrowser for help on using the repository browser.