/usr/share/doc/libgtk-3-doc/gdk3/gdk3-Colors.html is in libgtk-3-doc 3.4.2-0ubuntu0.9.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Colors</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GDK 3 Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk3-Pixbufs.html" title="Pixbufs">
<link rel="next" href="gdk3-RGBA-Colors.html" title="RGBA Colors">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk3-Pixbufs.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK 3 Reference Manual</th>
<td><a accesskey="n" href="gdk3-RGBA-Colors.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gdk3-Colors.synopsis" class="shortcut">Top</a>
|
<a href="#gdk3-Colors.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gdk3-Colors"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk3-Colors.top_of_page"></a>Colors</span></h2>
<p>Colors — Manipulation of colors</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gdk3-Colors.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <gdk/gdk.h>
<a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor">GdkColor</a>;
<a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="returnvalue">GdkColor</span></a> * <a class="link" href="gdk3-Colors.html#gdk-color-copy" title="gdk_color_copy ()">gdk_color_copy</a> (<em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);
<span class="returnvalue">void</span> <a class="link" href="gdk3-Colors.html#gdk-color-free" title="gdk_color_free ()">gdk_color_free</a> (<em class="parameter"><code><a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gdk3-Colors.html#gdk-color-parse" title="gdk_color_parse ()">gdk_color_parse</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *spec</code></em>,
<em class="parameter"><code><a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gdk3-Colors.html#gdk-color-equal" title="gdk_color_equal ()">gdk_color_equal</a> (<em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *colora</code></em>,
<em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *colorb</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="gdk3-Colors.html#gdk-color-hash" title="gdk_color_hash ()">gdk_color_hash</a> (<em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="gdk3-Colors.html#gdk-color-to-string" title="gdk_color_to_string ()">gdk_color_to_string</a> (<em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gdk3-Colors.description"></a><h2>Description</h2>
<p>
A <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> represents a color.
</p>
<p>
When working with cairo, it is often more convenient
to use a <a class="link" href="gdk3-RGBA-Colors.html#GdkRGBA" title="GdkRGBA"><span class="type">GdkRGBA</span></a> instead.
</p>
</div>
<div class="refsect1">
<a name="gdk3-Colors.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GdkColor"></a><h3>GdkColor</h3>
<pre class="programlisting">typedef struct {
guint32 pixel;
guint16 red;
guint16 green;
guint16 blue;
} GdkColor;
</pre>
<p>
The <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> structure is used to describe a color,
similar to the XColor struct used in the X11 drawing API.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><span class="type">guint32</span> <em class="structfield"><code><a name="GdkColor.pixel"></a>pixel</code></em>;</span></p></td>
<td>For allocated colors, the pixel value used to
draw this color on the screen. Not used anymore.</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">guint16</span> <em class="structfield"><code><a name="GdkColor.red"></a>red</code></em>;</span></p></td>
<td>The red component of the color. This is
a value between 0 and 65535, with 65535 indicating
full intensity</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">guint16</span> <em class="structfield"><code><a name="GdkColor.green"></a>green</code></em>;</span></p></td>
<td>The green component of the color</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">guint16</span> <em class="structfield"><code><a name="GdkColor.blue"></a>blue</code></em>;</span></p></td>
<td>The blue component of the color</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-color-copy"></a><h3>gdk_color_copy ()</h3>
<pre class="programlisting"><a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="returnvalue">GdkColor</span></a> * gdk_color_copy (<em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);</pre>
<p>
Makes a copy of a color structure.
</p>
<p>
The result must be freed using <a class="link" href="gdk3-Colors.html#gdk-color-free" title="gdk_color_free ()"><code class="function">gdk_color_free()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
<td>a <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a copy of <em class="parameter"><code>color</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-color-free"></a><h3>gdk_color_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gdk_color_free (<em class="parameter"><code><a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);</pre>
<p>
Frees a color structure created with <a class="link" href="gdk3-Colors.html#gdk-color-copy" title="gdk_color_copy ()"><code class="function">gdk_color_copy()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
<td>a <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-color-parse"></a><h3>gdk_color_parse ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gdk_color_parse (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *spec</code></em>,
<em class="parameter"><code><a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);</pre>
<p>
Parses a textual specification of a color and fill in the
<em class="structfield"><code>red</code></em>, <em class="structfield"><code>green</code></em>,
and <em class="structfield"><code>blue</code></em> fields of a <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a>
structure.
</p>
<p>
The string can either one of a large set of standard names
(taken from the X11 <code class="filename">rgb.txt</code> file), or
it can be a hex value in the form '#rgb' '#rrggbb'
'#rrrgggbbb' or '#rrrrggggbbbb' 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
'#fff', '#ffffff', '#fffffffff' and
'#ffffffffffff').
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>spec</code></em> :</span></p></td>
<td>the string specifying the color</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
<td>the <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> to fill in. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the parsing succeeded</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-color-equal"></a><h3>gdk_color_equal ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gdk_color_equal (<em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *colora</code></em>,
<em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *colorb</code></em>);</pre>
<p>
Compares two colors.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>colora</code></em> :</span></p></td>
<td>a <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>colorb</code></em> :</span></p></td>
<td>another <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the two colors compare equal</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-color-hash"></a><h3>gdk_color_hash ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gdk_color_hash (<em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);</pre>
<p>
A hash function suitable for using for a hash
table that stores <a href="gdk3-Colors.html#GdkColor"><span class="type">GdkColors</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
<td>a <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The hash function applied to <em class="parameter"><code>color</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-color-to-string"></a><h3>gdk_color_to_string ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gdk_color_to_string (<em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);</pre>
<p>
Returns a textual specification of <em class="parameter"><code>color</code></em> in the hexadecimal form
<code class="literal">#rrrrggggbbbb</code>, where <code class="literal">r</code>,
<code class="literal">g</code> and <code class="literal">b</code> are hex digits
representing the red, green and blue components respectively.
</p>
<p>
The returned string can be parsed by <a class="link" href="gdk3-Colors.html#gdk-color-parse" title="gdk_color_parse ()"><code class="function">gdk_color_parse()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
<td>a <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a newly-allocated text string</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|