summaryrefslogtreecommitdiff
path: root/docs/reference/pygtk-pangocolor.xml
blob: ec4dcaf7853f87d8dfdf3c5d2476208e6db125a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-pangocolor">
  <refnamediv>
    <refname>pango.Color</refname>
    <refpurpose>an object representing a RGB color</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>pango.Color</classname></ooclass>
      <ooclass><classname>gobject.GBoxed</classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-pangocolor">pango.Color</link></methodname>
	<methodparam><parameter
		       role="keyword">spec</parameter></methodparam>
      </constructorsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Attributes</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	<?dbhtml cellpadding="5"?>
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"red"</entry>
	      <entry>Read</entry>
	      <entry>The red component of the color with a value between 0
and 65535.</entry>
	    </row>

	    <row valign="top">
	      <entry>"green"</entry>
	      <entry>Read</entry>
	      <entry>The green component of the color with a value between 0
and 65535.</entry>
	    </row>

	    <row valign="top">
	      <entry>"blue"</entry>
	      <entry>Read</entry>
	      <entry>The blue component of the color with a value between 0
and 65535.</entry>
	    </row>

	</tbody>
      </tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-pangocolor"><classname>pango.Color</classname></link> object
is a <link
linkend="class-gobjectgboxed"><classname>gobject.GBoxed</classname></link>
type that represents a color with RGB components. Each component value
ranges from 0 to 65535.</para>

  </refsect1>

  <refsect1 id="constructor-pangocolor">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
        <methodname>pango.Color</methodname>
        <methodparam><parameter
                       role="keyword">spec</parameter></methodparam>
      </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
        <term><parameter>spec</parameter>&nbsp;:</term>
        <listitem><simpara>a string specifying the new
color</simpara></listitem>
      </varlistentry>
      <varlistentry>
        <term><emphasis>Returns</emphasis>&nbsp;:</term>
        <listitem><simpara>a new <link
linkend="class-pangocolor"><classname>pango.Color</classname></link>
object.</simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link
linkend="class-pangocolor"><classname>pango.Color</classname></link> using
the color attributes specified by the string
<parameter>spec</parameter>. The string in <parameter>spec</parameter> can
either one of a large set of standard names.  (Taken from the X11
<filename>rgb.txt</filename> file), or it can be a hex value in the form
'<literal>rgb</literal>' '<literal>rrggbb</literal>'
'<literal>rrrgggbbb</literal>' or '<literal>rrrrggggbbbb</literal>' where
'r', 'g' and 'b' are hex digits of the red, green, and blue components of
the color, respectively. (White in the four forms is
'<literal>fff</literal>' '<literal>ffffff</literal>'
'<literal>fffffffff</literal>' and '<literal>ffffffffffff</literal>')</para>

  </refsect1>

</refentry>