-
Notifications
You must be signed in to change notification settings - Fork 2
/
makec2f.m
63 lines (60 loc) · 1.23 KB
/
makec2f.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
function c2 = makec2f
% makecolormap.m
% ----> c3(64,3)
% red
% yellow
% black
% cyan
% blue
c2 = zeros(64,3);
% for ii=1:10 % black to grey
% c2(ii,1) = 0.1 + 0.4*ii/10; % red
% c2(ii,2) = 0.1 + 0.4*ii/10; % green
% c2(ii,3) = 0.1 + 0.4*ii/10; % blue
% end
for ii=1:10 % black to grey
c2(ii,1) = 0.0 + 0.5*ii/10; % red
c2(ii,2) = 0.0 + 0.5*ii/10; % green
c2(ii,3) = 0.0 + 0.5*ii/10; % blue
end
for ii=11:20 % grey to blue
c2(ii,1) = 0.5*(1-(ii-10)/10); % red
c2(ii,2) = 0.5*(1-(ii-10)/10); % green
c2(ii,3) = 0.5 + 0.5*(ii-10)/10; % blue
end
a = 21; b = 32;
for ii=a:b % blue to cyan
c2(ii,1) = 0;
c2(ii,2) = (ii-a+1)/(b-a+1);
c2(ii,3) = 1;
end
% a = 29; b = 32;
% for ii=a:b % cyan
% c2(ii,1) = 0;
% c2(ii,2) = 1;
% c2(ii,3) = 1;
% end
% a = 33; b = 37;
% for ii=a:b % cyan to green
% c2(ii,1) = 0;
% c2(ii,2) = 1;
% c2(ii,3) = 1 - (ii-a+1)/(b-a+1);
% end
a = 33; b = 45;
for ii=a:b % green to yellow
c2(ii,1) = (ii-a+1)/(b-a+1);
c2(ii,2) = 1;
c2(ii,3) = 0;
end
a = 46; b = 53;
for ii=a:b % yellow
c2(ii,1) = 1;
c2(ii,2) = 1;
c2(ii,3) = 0;
end
a = 54; b = 64;
for ii=a:b % yellow to red
c2(ii,1) = 1;
c2(ii,2) = 1 - (ii-a+1)/(b-a+1);
c2(ii,3) = 0;
end