Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [ uni_colors ] = unicmap(n)
- %UNICMAP Get a matrix of colors
- % unicmap returns a matrix of 9 colors
- % unicmap(n) returns the color with index n. n must be in [1..9].
- % uni_hellgrau = [224/255 224/255 224/255];
- % uni_mittelgrau = [128/255 128/255 128/255];
- % uni_dunkelgrau = [80/255 80/255 80/255];
- narginchk(0, 1);
- uni_colors = [0 126/255 198/255]; % mittelblau
- uni_colors = [uni_colors; 238/255 28/255 35/255]; % rot
- uni_colors = [uni_colors; 140/255 198/255 62/255]; % apfelgruen
- uni_colors = [uni_colors; 1 221/255 0]; % gelb
- uni_colors = [uni_colors; 244/255 111/255 33/255]; % orange
- uni_colors = [uni_colors; 237/255 0 140/255]; % pink
- uni_colors = [uni_colors; 19/255 31/255 31/255]; % anthrazit
- uni_colors = [uni_colors; 0/255 170/255 173/255]; % turquoise
- uni_colors = [uni_colors; 128/255 40/255 145/255]; % lila
- if nargin == 1
- if (~isscalar(n) || ~isnumeric(n))
- error('First argument must be a numeric scalar.')
- end
- if (n < 1 || n > size(uni_colors, 1))
- error(['First argument mus be postive and less than or equal to '...
- num2str(size(uni_colors, 1))]);
- end
- uni_colors = uni_colors(n,:);
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement