1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA - Serge Steer
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
10 * This file was originally licensed under the terms of the CeCILL v2.1,
11 * and continues to be available under such terms.
12 * For more information, see the COPYING file which you should have received
13 * along with this program.
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="hsv2rgb">
18 <refname>hsv2rgb</refname>
19 <refpurpose>Converts HSV colors to RGB</refpurpose>
23 <synopsis>[r,g,b] = hsv2rgb(h,s,v)
25 [r,g,b] = hsv2rgb(hsv)
30 <title>Arguments</title>
35 <para> a vector of size n. The "hue" values.
42 <para> a vector of size n. The "saturation" values.
49 <para> a vector of size n. The "value" values
56 <para> a n x 3 matrix. Each row contains a [hue saturation value] triple.
63 <para> a column vector of size n. The associated "red" values.
70 <para>a column vector of size n. The associated "green" values.
77 <para>a column vector of size n. The associated "blue" values.
84 <para> a n x 3 matrix. Each row contains a [red green blue] triple.
91 <title>Description</title>
92 <para>The function hsv2rgb converts colormaps
93 between the RGB and HSV color spaces. As hue varies from 0 to 1.0,
94 the corresponding colors vary from red through yellow, green, cyan, blue,
95 magenta, and back to red, so that there are actually red values both at 0
96 and 1.0. As saturation varies from 0 to 1.0, the corresponding colors
97 (hues) vary from unsaturated (shades of gray) to fully saturated (no
98 white component). As value, or brightness, varies from 0 to 1.0, the
99 corresponding colors become increasingly brighter.
103 <title>Examples</title>
104 <programlisting role="example"><![CDATA[
105 t=[0:0.3:2*%pi]'; z=sin(t)*cos(t');
109 hsv=[h*ones(32,1) linspace(0,1,32)' 0.7*ones(32,1)];
110 f.color_map=hsv2rgb(hsv);
114 hsv=[ones(32,1) linspace(0,1,32)' v*ones(32,1)];
115 f.color_map=hsv2rgb(hsv);
120 t=[0:0.3:2*%pi]'; z=sin(t)*cos(t');
124 hsv=[h*ones(32,1) linspace(0,1,32)' 0.7*ones(32,1)];
125 f.color_map=hsv2rgb(hsv);
128 hsv=[ones(32,1) linspace(0,1,32)' v*ones(32,1)];
129 f.color_map=hsv2rgb(hsv);