* Bug 16638 fixed: getcolor() rendering debugged
[scilab.git] / scilab / modules / graphics / help / en_US / color_management / rgb2name.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" 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="rgb2name">
17     <refnamediv>
18         <refname>rgb2name</refname>
19         <refpurpose>returns the name of a color</refpurpose>
20     </refnamediv>
21     <refsynopsisdiv>
22         <title>Syntax</title>
23         <synopsis>names=rgb2name(r,g,b)
24             names=rgb2name(rgb)
25         </synopsis>
26     </refsynopsisdiv>
27     <refsection>
28         <title>Arguments</title>
29         <variablelist>
30             <varlistentry>
31                 <term>r,g,b</term>
32                 <listitem>
33                     <para>RGB integer values of a color.</para>
34                 </listitem>
35             </varlistentry>
36             <varlistentry>
37                 <term>rgb</term>
38                 <listitem>
39                     <para>vector of RGB integer values of a color.</para>
40                 </listitem>
41             </varlistentry>
42             <varlistentry>
43                 <term>names</term>
44                 <listitem>
45                     <para>names of the color.</para>
46                 </listitem>
47             </varlistentry>
48         </variablelist>
49     </refsection>
50     <refsection>
51         <title>Description</title>
52         <para>
53             <literal>rgb2name</literal> returns the color name corresponding to the RGB values
54             given by its argument. A vector of color names can also be returned if the color has more than 1 name.
55             <literal>r</literal>, <literal>g</literal> and <literal>b</literal> must be integers between 0 and 255
56             corresponding to colors components red, green and blue. As usual 0 means no intensity and
57             255 means all the intensity of the color. RGB values can also be given by a vector <literal>[r,g,b]</literal>.
58         </para>
59         <para>
60             If no color is found <literal>[]</literal> is returned.
61         </para>
62         <para>
63             The list of all known colors is given by <link linkend="color_list">color_list</link>.
64         </para>
65     </refsection>
66     <refsection>
67         <title>Examples</title>
68         <programlisting role="example"><![CDATA[
69 rgb2name(255,128,128)
70 rgb2name([255 215 0])
71 // get color #10 of the current colormap and find its name
72 cmap=get(gcf(),"color_map");
73 rgb2name(cmap(10,:)*255)
74  ]]></programlisting>
75     </refsection>
76     <refsection role="see also">
77         <title>See also</title>
78         <simplelist type="inline">
79             <member>
80                 <link linkend="color">color</link>
81             </member>
82             <member>
83                 <link linkend="color_list">color_list</link>
84             </member>
85             <member>
86                 <link linkend="name2rgb">name2rgb</link>
87             </member>
88         </simplelist>
89     </refsection>
90 </refentry>