CINXE.COM

Gdk.RGBA

<!-- SPDX-FileCopyrightText: GTK Development Team SPDX-License-Identifier: LGPL-2.1-or-later --> <!DOCTYPE html> <html lang="en"> <head> <title>Gdk.RGBA</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8" /> <meta property="og:type" content="website"/> <meta property="og:image:width" content="256"/> <meta property="og:image:height" content="256"/> <meta property="og:image:secure_url" content="gtk-logo.svg"/> <meta property="og:image:alt" content="Gdk-4.0"/> <meta property="og:title" content="Gdk.RGBA"/> <meta property="og:description" content="Reference for Gdk.RGBA"/> <meta name="twitter:title" content="Gdk.RGBA"/> <meta name="twitter:description" content="Reference for Gdk.RGBA"/> <meta name="twitter:card" content="summary"/> <link rel="search" type="application/opensearchdescription+xml" title="Gdk" href="opensearch.xml"> <link rel="stylesheet" href="style.css" type="text/css" /> <script src="urlmap.js"></script> <script src="fzy.js"></script> <script src="search.js"></script> <script src="main.js"></script> <link rel="icon" href="favicon.svg"> <link rel="icon" sizes="192x192" href="favicon-192x192.png"> </head> <body> <div id="body-wrapper" tabindex="-1"> <nav class="sidebar devhelp-hidden"> <div class="section"> <a href="index.html"><img src="gtk-logo.svg" class="logo"/></a> </div> <div class="search section"> <form id="search-form" autocomplete="off"> <input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/> </form> </div> <div class="section namespace"> <h3><a href="index.html">Gdk</a></h3> <p>API Version: 4.0</p> <p>Library Version: 4.17.1</p> </div> <div class="section"> <h5>Type</h5> <div class="links"> <a class="current" href="struct.RGBA.html#description">RGBA</a> </div> </div> <div class="section"> <h5>Instance methods</h5> <div class="links"> <a class="method" href="method.RGBA.copy.html">copy</a> <a class="method" href="method.RGBA.equal.html">equal</a> <a class="method" href="method.RGBA.free.html">free</a> <a class="method" href="method.RGBA.hash.html">hash</a> <a class="method" href="method.RGBA.is_clear.html">is_clear</a> <a class="method" href="method.RGBA.is_opaque.html">is_opaque</a> <a class="method" href="method.RGBA.parse.html">parse</a> <a class="method" href="method.RGBA.to_string.html">to_string</a> </div> </div> <div class="section generator"> <p>Generated by <a href="https://gitlab.gnome.org/GNOME/gi-docgen">gi-docgen</a> 2024.2</p> </div> </nav> <button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button> <section id="main" class="content"> <header> <h3>Struct</h3> <h1><a href="index.html">Gdk</a><span class="sep"></span>RGBA</h1> </header> <section> <summary> <div class="docblock"> <p></p> </div> <div class="toggle-wrapper"> <h4 style="display:flex;" id="description"> Description <a href="#description" class="anchor"></a> <a class="srclink" title="go to source location" href="https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gdk/gdkrgba.c#L38">[src]</a> </h4> <pre><code><div class="highlight"><pre><span></span><span class="k">struct</span><span class="w"> </span><span class="nc">GdkRGBA</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="kt">float</span><span class="w"> </span><span class="n">red</span><span class="p">;</span> <span class="w"> </span><span class="kt">float</span><span class="w"> </span><span class="n">green</span><span class="p">;</span> <span class="w"> </span><span class="kt">float</span><span class="w"> </span><span class="n">blue</span><span class="p">;</span> <span class="w"> </span><span class="kt">float</span><span class="w"> </span><span class="n">alpha</span><span class="p">;</span> <span class="p">}</span> </pre></div> </code></pre> <div class="docblock"> <p>A <code>GdkRGBA</code> is used to represent a color, in a way that is compatible with cairo’s notion of&nbsp;color.</p> <p><code>GdkRGBA</code> is a convenient way to pass colors around. It’s based on cairo’s way to deal with colors and mirrors its behavior. All values are in the range from 0.0 to 1.0 inclusive. So the color (0.0, 0.0, 0.0, 0.0) represents transparent black and (1.0, 1.0, 1.0, 1.0) is opaque white. Other values will be clamped to this range when&nbsp;drawing.</p> </div> <div class="toggle-wrapper"> <h6 style="display:flex;"> Structure members </h6> <div class="docblock"> <dl> <dt><code>red</code></dt> <dd><p>The intensity of the red channel from 0.0 to 1.0&nbsp;inclusive.</p></dd> <dt><code>green</code></dt> <dd><p>The intensity of the green channel from 0.0 to 1.0&nbsp;inclusive.</p></dd> <dt><code>blue</code></dt> <dd><p>The intensity of the blue channel from 0.0 to 1.0&nbsp;inclusive.</p></dd> <dt><code>alpha</code></dt> <dd><p>The opacity of the color from 0.0 for completely translucent to 1.0 for&nbsp;opaque.</p></dd> </dl> </div> </div> <div class="docblock"> </div> </div> </summary> <div class="toggle-wrapper methods"> <h4 id="methods"> Instance methods <a href="#methods" class="anchor"></a> </h4> <div class="docblock"> <div class=""> <h6><a href="method.RGBA.copy.html">gdk_rgba_copy</a></h6> <div class="docblock"> <p>Makes a copy of a <code>GdkRGBA</code>.</p> </div> <div class="docblock"> <p></p> </div> </div> <div class=""> <h6><a href="method.RGBA.equal.html">gdk_rgba_equal</a></h6> <div class="docblock"> <p>Compares two <code>GdkRGBA</code> colors.</p> </div> <div class="docblock"> <p></p> </div> </div> <div class=""> <h6><a href="method.RGBA.free.html">gdk_rgba_free</a></h6> <div class="docblock"> <p>Frees a <code>GdkRGBA</code>.</p> </div> <div class="docblock"> <p></p> </div> </div> <div class=""> <h6><a href="method.RGBA.hash.html">gdk_rgba_hash</a></h6> <div class="docblock"> <p>A hash function suitable for using for a hash table that stores <code>GdkRGBA</code>s.</p> </div> <div class="docblock"> <p></p> </div> </div> <div class=""> <h6><a href="method.RGBA.is_clear.html">gdk_rgba_is_clear</a></h6> <div class="docblock"> <p>Checks if an <code>rgba</code> value is&nbsp;transparent.</p> </div> <div class="docblock"> <p></p> </div> </div> <div class=""> <h6><a href="method.RGBA.is_opaque.html">gdk_rgba_is_opaque</a></h6> <div class="docblock"> <p>Checks if an <code>rgba</code> value is&nbsp;opaque.</p> </div> <div class="docblock"> <p></p> </div> </div> <div class=""> <h6><a href="method.RGBA.parse.html">gdk_rgba_parse</a></h6> <div class="docblock"> <p>Parses a textual representation of a&nbsp;color.</p> </div> <div class="docblock"> <p></p> </div> </div> <div class=""> <h6><a href="method.RGBA.to_string.html">gdk_rgba_to_string</a></h6> <div class="docblock"> <p>Returns a textual specification of <code>rgba</code> in the form <code>rgb(r,g,b)</code> or <code>rgba(r,g,b,a)</code>, where “r”, “g”, “b” and “a” represent the red, green, blue and alpha values respectively. “r”, “g”, and “b” are represented as integers in the range 0 to 255, and “a” is represented as a floating point value in the range 0 to&nbsp;1.</p> </div> <div class="docblock"> <p></p> </div> </div> </div> </div> </section> </section> <div id="toc" class="toc"> <nav aria-labelledby="toc-title"> <p id="toc-title">Content</p> <ul class="toc-list"> <li class="toc-list-item"><a href="#description"><span class="link-text">Description</span></a></li> <li class="toc-list-item"><a href="#methods"><span class="link-text">Methods</span></a></li> </ul> </nav> </div> <section id="search" class="content hidden"></section> <footer> </footer> </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10