* Bug 16638 fixed: getcolor() rendering debugged
[scilab.git] / scilab / modules / graphics / help / en_US / color_management / getcolor.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  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  * Copyright (C) 2021 - Samuel GOUGEON
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="getcolor">
20     <refnamediv>
21         <refname>getcolor</refname>
22         <refpurpose>opens a dialog to show colors of the current or default colormap</refpurpose>
23     </refnamediv>
24     <refsynopsisdiv>
25         <title>Syntax</title>
26         <synopsis>
27             c = getcolor()
28             c = getcolor(title)
29             c = getcolor(title, cini)
30         </synopsis>
31     </refsynopsisdiv>
32     <refsection>
33         <title>Arguments</title>
34         <variablelist>
35             <varlistentry>
36                 <term>title</term>
37                 <listitem>
38                     <para>string, dialog title.</para>
39                 </listitem>
40             </varlistentry>
41             <varlistentry>
42                 <term>cini</term>
43                 <listitem>
44                     <para>initial selected color index. Default value is 1.</para>
45                 </listitem>
46             </varlistentry>
47             <varlistentry>
48                 <term>c</term>
49                 <listitem>
50                     <para>index of the selected color, or [] if the selection is canceled.</para>
51                 </listitem>
52             </varlistentry>
53         </variablelist>
54     </refsection>
55     <refsection>
56         <title>Description</title>
57         <para>
58             <literal>getcolor</literal> opens a window displaying the palette of the current
59             colormap, or of the default one if no graphical figure exists.
60             The user can click on a color to show its index and its RGB values
61             in the bottom bar.
62             <literal>getcolor</literal> returns the index of the selected color, or [] if the "Cancel"
63             button has been clicked or the window has been closed.
64         </para>
65     </refsection>
66     <refsection>
67         <title>Examples</title>
68         <programlisting role="example"><![CDATA[
69 c = getcolor();
70
71 c = getcolor("Title foo", color("red")); // preselects the red
72
73 c = getcolor("Please choose a color");
74      ]]></programlisting>
75         <para/>
76         <inlinemediaobject>
77             <imageobject>
78                 <imagedata fileref="../../images/getcolor.png"/>
79             </imageobject>
80         </inlinemediaobject>
81         <para/>
82         <screen><![CDATA[
83 --> c = getcolor("Please choose a color")
84  c  =
85    28.
86 ]]></screen>
87     </refsection>
88
89     <refsection role="see also">
90         <title>See also</title>
91         <simplelist type="inline">
92             <member>
93                 <link linkend="uigetcolor">uigetcolor</link>
94             </member>
95             <member>
96                 <link linkend="color_list">color_list</link>
97             </member>
98             <member>
99                 <link linkend="color">color</link>
100             </member>
101             <member>
102                 <link linkend="colormap">colormap</link>
103             </member>
104         </simplelist>
105     </refsection>
106 </refentry>