<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://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="name2rgb">
    <refnamediv>
        <refname>name2rgb</refname>
        <refpurpose>returns the RGB values of a named color</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>rgb=name2rgb(name)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>name</term>
                <listitem>
                    <para>name of the color, or matrix with names of the colors (case insensitive).</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>rgb</term>
                <listitem>
                    <para>vector or matrix with 3 columns of RGB integer values of the colors.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <literal>name2rgb</literal> returns the RGB values of a color given by its literal name.
            The result is
            a vector or a matrix with 3 columns <literal>[r,g,b]</literal> where <literal>r</literal>,
            <literal>g</literal> and <literal>b</literal> are integers between 0 and 255
            corresponding to colors components red, green and blue. As usual 0 means no intensity and
            255 means all the intensity of the color.
        </para>
        <para>
            If no color is found <literal>[]</literal> is returned.
        </para>
        <para>
            The list of all known colors is given by <link linkend="color_list">color_list</link>.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
rgb=name2rgb("gold")
rgb2name(rgb)
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="color">color</link>
            </member>
            <member>
                <link linkend="color_list">color_list</link>
            </member>
            <member>
                <link linkend="rgb2name">rgb2name</link>
            </member>
        </simplelist>
    </refsection>
    <refsection>
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>6.0.0</revnumber>
                <revremark>
                    Function <function>name2rgb</function> can now handle a single string and a matrix of strings.
                </revremark>
            </revision>
        </revhistory>
    </refsection>
</refentry>
