* Bug 16638 fixed: getcolor() rendering debugged
[scilab.git] / scilab / modules / graphics / help / en_US / color_management / addcolor.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="addcolor">
17     <refnamediv>
18         <refname>addcolor</refname>
19         <refpurpose>add new colors to the current colormap</refpurpose>
20     </refnamediv>
21     <refsynopsisdiv>
22         <title>Syntax</title>
23         <synopsis>new=addcolor(c)</synopsis>
24     </refsynopsisdiv>
25     <refsection>
26         <title>Arguments</title>
27         <variablelist>
28             <varlistentry>
29                 <term>new</term>
30                 <listitem>
31                     <para>ids of the colors defined in c in the new color table.</para>
32                 </listitem>
33             </varlistentry>
34             <varlistentry>
35                 <term>c</term>
36                 <listitem>
37                     <para>matrix with 3 columns, RGB color definition.</para>
38                 </listitem>
39             </varlistentry>
40         </variablelist>
41     </refsection>
42     <refsection>
43         <title>Description</title>
44         <para>
45             <literal>addcolor</literal> adds new colors given in the <literal>c</literal> argument to the
46             current colormap. <literal>c</literal> must be a matrix with 3 columns
47             <literal>[R G B]</literal><literal>R</literal> is red component, <literal>G</literal> is green component,
48             <literal>B</literal> is blue component). Each entry in <literal>c</literal> must be a non
49             negative number less or equal to 1.
50         </para>
51         <para>
52             The ids of the new colors are returned into <literal>new</literal>.
53         </para>
54         <para>
55             If a color defined in <literal>c</literal> is already present in the current colormap
56             it is not added.
57         </para>
58     </refsection>
59     <refsection>
60         <title>Examples</title>
61         <programlisting role="example"><![CDATA[
62 plot3d();
63 h = gcf();
64 h.color_map = jetcolormap(16);
65 addcolor(name2rgb('grey')/255);
66  ]]></programlisting>
67         <scilab:image>
68             plot3d();
69             h = gcf();
70             h.color_map = jetcolormap(16);
71             addcolor(name2rgb('grey')/255);
72         </scilab:image>
73     </refsection>
74     <refsection role="see also">
75         <title>See also</title>
76         <simplelist type="inline">
77             <member>
78                 <link linkend="colormap">colormap</link>
79             </member>
80             <member>
81                 <link linkend="name2rgb">name2rgb</link>
82             </member>
83         </simplelist>
84     </refsection>
85 </refentry>