Blame view

matlab/stimBrewerMap.m 807 Bytes
35534291   sberisha   envi.py: added fu...
1
  function result = stimBrewerMap(R)
5d272e9b   David Mayerich   added matlab files
2
3
4
  
  %returns a Brewer colormap with the specified resolution R
  
35534291   sberisha   envi.py: added fu...
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  ctrlPts = zeros(12, 3);
  ctrlPts(1, :) = [0, 0, 0];
  ctrlPts(2, :) = [0.192157, 0.211765, 0.584314];
  ctrlPts(3, :) = [0.270588, 0.458824, 0.705882];
  ctrlPts(4, :) = [0.454902, 0.678431, 0.819608];
  ctrlPts(5, :) = [0.670588, 0.85098, 0.913725];
  ctrlPts(6, :) = [0.878431, 0.952941, 0.972549];
  ctrlPts(7, :) = [1, 1, 0.74902];
  ctrlPts(8, :) = [0.996078, 0.878431, 0.564706];
  ctrlPts(9, :) = [0.992157, 0.682353, 0.380392];
  ctrlPts(10, :) = [0.956863, 0.427451, 0.262745];
  ctrlPts(11, :) = [0.843137, 0.188235, 0.152941];
  ctrlPts(12, :) = [0.647059, 0, 0.14902];
  
  X = 1:12;
  
  r = 1:12/R:12;
5d272e9b   David Mayerich   added matlab files
22
23
24
25
26
27
  
  R = interp1(X, ctrlPts(:, 1), r);
  G = interp1(X, ctrlPts(:, 2), r);
  B = interp1(X, ctrlPts(:, 3), r);
  
  result = [R' G' B'];