[doc] misc. fix & improvements
[scilab.git] / scilab / modules / graphics / help / en_US / color_management / name2rgb.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) INRIA
5  *
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
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.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17           xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
18           xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
19           xml:lang="en" xml:id="name2rgb">
20     <refnamediv>
21         <refname>name2rgb</refname>
22         <refpurpose>returns the RGB values of a named color</refpurpose>
23     </refnamediv>
24     <refsynopsisdiv>
25         <title>Syntax</title>
26         <synopsis>rgb=name2rgb(name)</synopsis>
27     </refsynopsisdiv>
28     <refsection>
29         <title>Arguments</title>
30         <variablelist>
31             <varlistentry>
32                 <term>name</term>
33                 <listitem>
34                     <para>name of the color, or matrix with names of the colors (case insensitive).</para>
35                 </listitem>
36             </varlistentry>
37             <varlistentry>
38                 <term>rgb</term>
39                 <listitem>
40                     <para>vector or matrix with 3 columns of RGB integer values of the colors.</para>
41                 </listitem>
42             </varlistentry>
43         </variablelist>
44     </refsection>
45     <refsection>
46         <title>Description</title>
47         <para>
48             <literal>name2rgb</literal> returns the RGB values of a color given by its literal name.
49             The result is
50             a vector or a matrix with 3 columns <literal>[r,g,b]</literal> where <literal>r</literal>,
51             <literal>g</literal> and <literal>b</literal> are integers between 0 and 255
52             corresponding to colors components red, green and blue. As usual 0 means no intensity and
53             255 means all the intensity of the color.
54         </para>
55         <para>
56             If no color is found <literal>[]</literal> is returned.
57         </para>
58         <para>
59             The list of all known colors is given by <link linkend="color_list">color_list</link>.
60         </para>
61     </refsection>
62     <refsection>
63         <title>Examples</title>
64         <programlisting role="example"><![CDATA[
65 rgb=name2rgb("gold")
66 rgb2name(rgb)
67  ]]></programlisting>
68     </refsection>
69     <refsection role="see also">
70         <title>See also</title>
71         <simplelist type="inline">
72             <member>
73                 <link linkend="color">color</link>
74             </member>
75             <member>
76                 <link linkend="color_list">color_list</link>
77             </member>
78             <member>
79                 <link linkend="rgb2name">rgb2name</link>
80             </member>
81         </simplelist>
82     </refsection>
83     <refsection>
84         <title>History</title>
85         <revhistory>
86             <revision>
87                 <revnumber>6.0.0</revnumber>
88                 <revremark>
89                     Function <function>name2rgb</function> can now handle a single string and a matrix of strings.
90                 </revremark>
91             </revision>
92         </revhistory>
93     </refsection>
94 </refentry>