Skip to content

Commit 040de4e

Browse files
committed
breaking change!! hue range now 0-1 to 0-100
this only made sense since the other ranges are similar
1 parent 4bd322b commit 040de4e

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

colourscale.m

+13-13
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
% intensities for a given colour hue.
77
%
88
% COLOURSCALE(...,'hue',H)
9-
% Use hue H for colour scheme (default 0.2).
10-
% H is a standard "HSV" hue, from zero to one, where approx.:
11-
% H=0.0 - red
12-
% H=0.1 - orange
13-
% H=0.15 - yellow
14-
% H=0.35 - green
15-
% H=0.55 - light blue
16-
% H=0.6 - dark blue
17-
% H=0.75 - purple
18-
% H=0.85 - magenta
19-
% H=1.0 - red again
9+
% Use hue H for colour scheme (default 20).
10+
% H is a standard "HSV" hue, from 0 to 100, where approx.:
11+
% H = 0 - red
12+
% H = 10 - orange
13+
% H = 15 - yellow
14+
% H = 35 - green
15+
% H = 55 - light blue
16+
% H = 60 - dark blue
17+
% H = 75 - purple
18+
% H = 85 - magenta
19+
% H = 100 - red again
2020
%
2121
% COLOURSCALE(...,'chroma',C)
2222
% Use chroma C for colour scheme (default 70).
@@ -79,7 +79,7 @@
7979
%% Option parsing
8080

8181
p = inputParser;
82-
p.addOptional('hue',0.2);
82+
p.addOptional('hue',20);
8383
p.addOptional('chroma',70);
8484
p.addOptional('repeat',1);
8585
p.addOptional('permute',[]);
@@ -145,7 +145,7 @@
145145
end
146146

147147
hcl = nan(Ncol,3);
148-
hcl(:,1) = hue*360;
148+
hcl(:,1) = hue*3.6;
149149
hcl(:,2) = chroma;
150150
hcl(:,3) = linspace(lmin,lmax,Ncol)';
151151

colourscale_test.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
% points per graph:
1010
p = 20;
1111

12-
% colour: (0-1)
13-
HUE = 0.1;
12+
% colour: (0-100)
13+
HUE = 10;
1414
CHROMA = 60;
1515

1616
% linewidths:
17-
LW = [2 4]; % more exaggerated than default
17+
LW = [0.5 4]; % more exaggerated than default
1818

1919
figure(1)
2020
for m = 1:M
@@ -37,12 +37,12 @@
3737
N = 4;
3838

3939
% lines per graph:
40-
l = 5;
40+
l = 6;
4141

4242
% points per line:
4343
p = 20;
4444

45-
hrange = linspace(0,1,M*N+1);
45+
hrange = linspace(0,100,M*N+1);
4646
hrange(end) = [];
4747

4848
figure(2)
@@ -53,7 +53,7 @@
5353
xx = linspace(0,1,p);
5454
yy = repmat(1:l,[p 1])+rand(p,l);
5555
plot(xx,yy,'linewidth',2)
56-
colourscale('hue',hrange(c),'lumin',[1 99]);
56+
colourscale('hue',hrange(c),'lumin',[20 90]);
5757
title(['H=',num2str(hrange(c))])
5858
axis tight
5959
end

0 commit comments

Comments
 (0)