comparison scripts/image/copper.m @ 11587:c792872f8942

all script files: untabify and strip trailing whitespace
author John W. Eaton <jwe@octave.org>
date Thu, 20 Jan 2011 17:35:29 -0500
parents fd0a3ac60b0e
children 72c96de7a403
comparison
equal deleted inserted replaced
11586:12df7854fa7c 11587:c792872f8942
19 ## -*- texinfo -*- 19 ## -*- texinfo -*-
20 ## @deftypefn {Function File} {@var{map} =} copper () 20 ## @deftypefn {Function File} {@var{map} =} copper ()
21 ## @deftypefnx {Function File} {@var{map} =} copper (@var{n}) 21 ## @deftypefnx {Function File} {@var{map} =} copper (@var{n})
22 ## Create color colormap. This colormap varies from black to 22 ## Create color colormap. This colormap varies from black to
23 ## a light copper tone. 23 ## a light copper tone.
24 ## The argument @var{n} must be a scalar. 24 ## The argument @var{n} must be a scalar.
25 ## If unspecified, the length of the current colormap, or 64, is used. 25 ## If unspecified, the length of the current colormap, or 64, is used.
26 ## @seealso{colormap} 26 ## @seealso{colormap}
27 ## @end deftypefn 27 ## @end deftypefn
28 28
29 ## Author: Kai Habel <kai.habel@gmx.de> 29 ## Author: Kai Habel <kai.habel@gmx.de>
39 else 39 else
40 print_usage (); 40 print_usage ();
41 endif 41 endif
42 42
43 if (n == 1) 43 if (n == 1)
44 map = [0, 0, 0]; 44 map = [0, 0, 0];
45 elseif (n > 1) 45 elseif (n > 1)
46 x = linspace (0, 1, n)'; 46 x = linspace (0, 1, n)';
47 r = (x < 4/5) .* (5/4 * x) + (x >= 4/5); 47 r = (x < 4/5) .* (5/4 * x) + (x >= 4/5);
48 g = 4/5 * x; 48 g = 4/5 * x;
49 b = 1/2 * x; 49 b = 1/2 * x;