summaryrefslogtreecommitdiff
path: root/color_gradient.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2013-01-16 14:27:10 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2013-01-16 14:27:10 -0500
commit37d09478a8fca4e1229dcb1246c9f23f1f6118df (patch)
tree79e2d5f9179987b46b5b743c552c29f94ffb999e /color_gradient.m
parent28ef703f718ce7f540864ca8f9a301f8d7d3f3e0 (diff)
downloadwgmr-37d09478a8fca4e1229dcb1246c9f23f1f6118df.tar.gz
wgmr-37d09478a8fca4e1229dcb1246c9f23f1f6118df.zip
move code to directory with speaking name
Diffstat (limited to 'color_gradient.m')
-rw-r--r--color_gradient.m31
1 files changed, 0 insertions, 31 deletions
diff --git a/color_gradient.m b/color_gradient.m
deleted file mode 100644
index 310ff99..0000000
--- a/color_gradient.m
+++ /dev/null
@@ -1,31 +0,0 @@
-function rgb= color_gradient( pos, base_color_rgb, Ncolors )
-%% returns rgb=[R,G,B] components from the brightness gradient of the base color
-% base_color_rgb - [R,G,B] of the base color
-% Ncolors - number of positions in gradient
-
- %% color map as gradient of particular color
- % starting values
- hsv_s=rgb2hsv(base_color_rgb);
- hue_f = hsv_s(1);
- sat_f = hsv_s(2);
- val_f = hsv_s(3);
- % stop values
- hue_s = hue_f;
- sat_s = 0;
- val_s = 1;
- hue=linspace(hue_s,hue_f, Ncolors);
- sat=linspace(sat_s,sat_f, Ncolors);
- val=linspace(val_s,val_f, Ncolors);
- cmap = hsv2rgb([hue', sat', val']);
-
- %% check that pos is with in the reach
- pos = floor(pos);
- if( pos < 1 )
- pos=1;
- end
- if( pos > Ncolors )
- pos=Ncolors;
- end
-
- rgb = cmap(pos,:);
-end