<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<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">
    <refnamediv>
        <refname>addcolor</refname>
        <refpurpose>add new colors to the current colormap</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>new=addcolor(c)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>new</term>
                <listitem>
                    <para>ids of the colors defined in c in the new color table.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>c</term>
                <listitem>
                    <para>matrix with 3 columns, RGB color definition.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <literal>addcolor</literal> adds new colors given in the <literal>c</literal> argument to the
            current colormap. <literal>c</literal> must be a matrix with 3 columns
            <literal>[R G B]</literal><literal>R</literal> is red component, <literal>G</literal> is green component,
            <literal>B</literal> is blue component). Each entry in <literal>c</literal> must be a non
            negative number less or equal to 1.
        </para>
        <para>
            The ids of the new colors are returned into <literal>new</literal>.
        </para>
        <para>
            If a color defined in <literal>c</literal> is already present in the current colormap
            it is not added.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
plot3d();
h = gcf();
h.color_map = jet(16);
addcolor(name2rgb('grey')/255);
 ]]></programlisting>
        <scilab:image>
            plot3d();
            h = gcf();
            h.color_map = jet(16);
            addcolor(name2rgb('grey')/255);
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="colormap">colormap</link>
            </member>
            <member>
                <link linkend="name2rgb">name2rgb</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
