-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathg2rCD.m
36 lines (32 loc) · 1.18 KB
/
g2rCD.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
% col = g2rCD(num,name)
%
% g2rCD returns gray to red colormap
% col = colormap_CD([ 0.45 0.7; 0.08 0.95],[1 .35],[1 0],num);
%
% Can be modified to be other maps, or using argument "name":
%
% 's2g': silver to gold colormap
% col = colormap_CD([ 0.45 0.7; 0.10 0.08],[1 .35],[1 0],6);
%
% 'g2b': gray to blue colormap
% col = colormap_CD([ 0.45 0.7; [0.10 0.24]+0.4],[1 .35],[1 0],6);
%
% Last update: 2018-08-14
function col = g2rCD(num,name)
% *********************************************************************
% Parse input arguments
% *********************************************************************
if ~exist('num','var') num = 6; end
if ~exist('name','var') name = 'g2r'; end
% *********************************************************************
% Generate colormap
% *********************************************************************
switch name,
case 'g2r',
col = colormap_CD([ 0.08 0.95; 0.08 0.95],[1 .35],[1 0],num);
case 's2g',
col = colormap_CD([ 0.10 0.08; 0.10 0.08],[1 .20],[1 0],num);
case 'g2b',
col = colormap_CD([ 0.40 0.64; 0.40 0.64],[1 .28],[1 0],num);
end
end