Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 1246

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qcolor.cpp -->
  <title>QColor Class | Qt GUI 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QColor</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#integer-vs-floating-point-precision">Integer vs. Floating Point Precision</a></li>
<li class="level2"><a href="#alpha-blended-drawing">Alpha-Blended Drawing</a></li>
<li class="level2"><a href="#predefined-colors">Predefined Colors</a></li>
<li class="level2"><a href="#the-hsv-color-model">The HSV Color Model</a></li>
<li class="level2"><a href="#the-hsl-color-model">The HSL Color Model</a></li>
<li class="level2"><a href="#the-cmyk-color-model">The CMYK Color Model</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QColor Class</h1>
<!-- $$$QColor-brief -->
<p>The <a href="qcolor.html">QColor</a> class provides colors based on RGB, HSV or CMYK values. <a href="#details">More...</a></p>
<!-- @@@QColor -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QColor&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr></table></div><ul>
<li><a href="qcolor-members.html">List of all members, including inherited members</a></li>
<li><a href="qcolor-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#NameFormat-enum">NameFormat</a></b> { HexRgb, HexArgb }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#Spec-enum">Spec</a></b> { Rgb, Hsv, Cmyk, Hsl, Invalid }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor">QColor</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-1">QColor</a></b>(Qt::GlobalColor <i>color</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-2">QColor</a></b>(int <i>r</i>, int <i>g</i>, int <i>b</i>, int <i>a</i> = 255)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-3">QColor</a></b>(QRgb <i>color</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-4">QColor</a></b>(QRgba64 <i>rgba64</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-5">QColor</a></b>(const QString &amp;<i>name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-6">QColor</a></b>(const char *<i>name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-7">QColor</a></b>(QLatin1String <i>name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-9">QColor</a></b>(const QColor &amp;<i>color</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-10">QColor</a></b>(QColor &amp;&amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#alpha">alpha</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#alphaF">alphaF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#black">black</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#blackF">blackF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#blue">blue</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#blueF">blueF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#convertTo">convertTo</a></b>(Spec <i>colorSpec</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#cyan">cyan</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#cyanF">cyanF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#darker">darker</a></b>(int <i>factor</i> = 200) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getCmyk">getCmyk</a></b>(int *<i>c</i>, int *<i>m</i>, int *<i>y</i>, int *<i>k</i>, int *<i>a</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getCmykF">getCmykF</a></b>(qreal *<i>c</i>, qreal *<i>m</i>, qreal *<i>y</i>, qreal *<i>k</i>, qreal *<i>a</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getHsl">getHsl</a></b>(int *<i>h</i>, int *<i>s</i>, int *<i>l</i>, int *<i>a</i> = Q_NULLPTR) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getHslF">getHslF</a></b>(qreal *<i>h</i>, qreal *<i>s</i>, qreal *<i>l</i>, qreal *<i>a</i> = Q_NULLPTR) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getHsv">getHsv</a></b>(int *<i>h</i>, int *<i>s</i>, int *<i>v</i>, int *<i>a</i> = Q_NULLPTR) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getHsvF">getHsvF</a></b>(qreal *<i>h</i>, qreal *<i>s</i>, qreal *<i>v</i>, qreal *<i>a</i> = Q_NULLPTR) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getRgb">getRgb</a></b>(int *<i>r</i>, int *<i>g</i>, int *<i>b</i>, int *<i>a</i> = Q_NULLPTR) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getRgbF">getRgbF</a></b>(qreal *<i>r</i>, qreal *<i>g</i>, qreal *<i>b</i>, qreal *<i>a</i> = Q_NULLPTR) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#green">green</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#greenF">greenF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hslHue">hslHue</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hslHueF">hslHueF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hslSaturation">hslSaturation</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hslSaturationF">hslSaturationF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hsvHue">hsvHue</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hsvHueF">hsvHueF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hsvSaturation">hsvSaturation</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hsvSaturationF">hsvSaturationF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hue">hue</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hueF">hueF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#isValid">isValid</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#lighter">lighter</a></b>(int <i>factor</i> = 150) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#lightness">lightness</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#lightnessF">lightnessF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#magenta">magenta</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#magentaF">magentaF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#name">name</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#name-1">name</a></b>(NameFormat <i>format</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#red">red</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#redF">redF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgb </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#rgb">rgb</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgba64 </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#rgba64">rgba64</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgb </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#rgba">rgba</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#saturation">saturation</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#saturationF">saturationF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setAlpha">setAlpha</a></b>(int <i>alpha</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setAlphaF">setAlphaF</a></b>(qreal <i>alpha</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setBlue">setBlue</a></b>(int <i>blue</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setBlueF">setBlueF</a></b>(qreal <i>blue</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setCmyk">setCmyk</a></b>(int <i>c</i>, int <i>m</i>, int <i>y</i>, int <i>k</i>, int <i>a</i> = 255)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setCmykF">setCmykF</a></b>(qreal <i>c</i>, qreal <i>m</i>, qreal <i>y</i>, qreal <i>k</i>, qreal <i>a</i> = 1.0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setGreen">setGreen</a></b>(int <i>green</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setGreenF">setGreenF</a></b>(qreal <i>green</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setHsl">setHsl</a></b>(int <i>h</i>, int <i>s</i>, int <i>l</i>, int <i>a</i> = 255)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setHslF">setHslF</a></b>(qreal <i>h</i>, qreal <i>s</i>, qreal <i>l</i>, qreal <i>a</i> = 1.0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setHsv">setHsv</a></b>(int <i>h</i>, int <i>s</i>, int <i>v</i>, int <i>a</i> = 255)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setHsvF">setHsvF</a></b>(qreal <i>h</i>, qreal <i>s</i>, qreal <i>v</i>, qreal <i>a</i> = 1.0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setNamedColor">setNamedColor</a></b>(const QString &amp;<i>name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setNamedColor-1">setNamedColor</a></b>(QLatin1String <i>name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRed">setRed</a></b>(int <i>red</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRedF">setRedF</a></b>(qreal <i>red</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRgb">setRgb</a></b>(int <i>r</i>, int <i>g</i>, int <i>b</i>, int <i>a</i> = 255)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRgb-1">setRgb</a></b>(QRgb <i>rgb</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRgba64">setRgba64</a></b>(QRgba64 <i>rgba</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRgbF">setRgbF</a></b>(qreal <i>r</i>, qreal <i>g</i>, qreal <i>b</i>, qreal <i>a</i> = 1.0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRgba">setRgba</a></b>(QRgb <i>rgba</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Spec </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#spec">spec</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#toCmyk">toCmyk</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#toHsl">toHsl</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#toHsv">toHsv</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#toRgb">toRgb</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#value">value</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#valueF">valueF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#yellow">yellow</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#yellowF">yellowF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-QVariant">operator QVariant</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-not-eq">operator!=</a></b>(const QColor &amp;<i>color</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor &amp;</td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-eq">operator=</a></b>(QColor &amp;&amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor &amp;</td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-eq-1">operator=</a></b>(const QColor &amp;<i>color</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor &amp;</td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-eq-2">operator=</a></b>(Qt::GlobalColor <i>color</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-eq-eq">operator==</a></b>(const QColor &amp;<i>color</i>) const</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#colorNames">colorNames</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromCmyk">fromCmyk</a></b>(int <i>c</i>, int <i>m</i>, int <i>y</i>, int <i>k</i>, int <i>a</i> = 255)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromCmykF">fromCmykF</a></b>(qreal <i>c</i>, qreal <i>m</i>, qreal <i>y</i>, qreal <i>k</i>, qreal <i>a</i> = 1.0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromHsl">fromHsl</a></b>(int <i>h</i>, int <i>s</i>, int <i>l</i>, int <i>a</i> = 255)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromHslF">fromHslF</a></b>(qreal <i>h</i>, qreal <i>s</i>, qreal <i>l</i>, qreal <i>a</i> = 1.0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromHsv">fromHsv</a></b>(int <i>h</i>, int <i>s</i>, int <i>v</i>, int <i>a</i> = 255)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromHsvF">fromHsvF</a></b>(qreal <i>h</i>, qreal <i>s</i>, qreal <i>v</i>, qreal <i>a</i> = 1.0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromRgb">fromRgb</a></b>(QRgb <i>rgb</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromRgb-1">fromRgb</a></b>(int <i>r</i>, int <i>g</i>, int <i>b</i>, int <i>a</i> = 255)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromRgba64">fromRgba64</a></b>(ushort <i>r</i>, ushort <i>g</i>, ushort <i>b</i>, ushort <i>a</i> = USHRT_MAX)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromRgba64-1">fromRgba64</a></b>(QRgba64 <i>rgba64</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromRgbF">fromRgbF</a></b>(qreal <i>r</i>, qreal <i>g</i>, qreal <i>b</i>, qreal <i>a</i> = 1.0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromRgba">fromRgba</a></b>(QRgb <i>rgba</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#isValidColor">isValidColor</a></b>(const QString &amp;<i>name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#isValidColor-1">isValidColor</a></b>(QLatin1String <i>name</i>)</td></tr>
</table></div>
<a name="related-non-members"></a>
<h2 id="related-non-members">Related Non-Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QRgb-typedef">QRgb</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qAlpha">qAlpha</a></b>(QRgb <i>rgba</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qAlpha-1">qAlpha</a></b>(QRgba64 <i>rgba64</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qBlue">qBlue</a></b>(QRgb <i>rgb</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qBlue-1">qBlue</a></b>(QRgba64 <i>rgba64</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qGray">qGray</a></b>(int <i>r</i>, int <i>g</i>, int <i>b</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qGray-1">qGray</a></b>(QRgb <i>rgb</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qGreen">qGreen</a></b>(QRgb <i>rgb</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qGreen-1">qGreen</a></b>(QRgba64 <i>rgba64</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgb </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qPremultiply">qPremultiply</a></b>(QRgb <i>rgb</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgba64 </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qPremultiply-1">qPremultiply</a></b>(QRgba64 <i>rgba64</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qRed">qRed</a></b>(QRgb <i>rgb</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qRed-1">qRed</a></b>(QRgba64 <i>rgba64</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgb </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qRgb">qRgb</a></b>(int <i>r</i>, int <i>g</i>, int <i>b</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgba64 </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qRgba64">qRgba64</a></b>(quint16 <i>r</i>, quint16 <i>g</i>, quint16 <i>b</i>, quint16 <i>a</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgba64 </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qRgba64-1">qRgba64</a></b>(quint64 <i>c</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgb </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qRgba">qRgba</a></b>(int <i>r</i>, int <i>g</i>, int <i>b</i>, int <i>a</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgb </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qUnpremultiply">qUnpremultiply</a></b>(QRgb <i>rgb</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgba64 </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qUnpremultiply-1">qUnpremultiply</a></b>(QRgba64 <i>rgba64</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp;</td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-lt-lt">operator&lt;&lt;</a></b>(QDataStream &amp;<i>stream</i>, const QColor &amp;<i>color</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp;</td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-gt-gt">operator&gt;&gt;</a></b>(QDataStream &amp;<i>stream</i>, QColor &amp;<i>color</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QColor-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qcolor.html">QColor</a> class provides colors based on RGB, HSV or CMYK values.</p>
<p>A color is normally specified in terms of RGB (red, green, and blue) components, but it is also possible to specify it in terms of HSV (hue, saturation, and value) and CMYK (cyan, magenta, yellow and black) components. In addition a color can be specified using a color name. The color name can be any of the SVG 1.0 color names.</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >RGB</th><th >HSV</th><th >CMYK</th></tr></thead>
<tr valign="top" class="odd"><td ><img src="images/qcolor-rgb.png" alt="" /></td><td ><img src="images/qcolor-hsv.png" alt="" /></td><td ><img src="images/qcolor-cmyk.png" alt="" /></td></tr>
</table></div>
<p>The <a href="qcolor.html">QColor</a> constructor creates the color based on RGB values. To create a <a href="qcolor.html">QColor</a> based on either HSV or CMYK values, use the <a href="qcolor.html#toHsv">toHsv</a>() and <a href="qcolor.html#toCmyk">toCmyk</a>() functions respectively. These functions return a copy of the color using the desired format. In addition the static <a href="qcolor.html#fromRgb">fromRgb</a>(), <a href="qcolor.html#fromHsv">fromHsv</a>() and <a href="qcolor.html#fromCmyk">fromCmyk</a>() functions create colors from the specified values. Alternatively, a color can be converted to any of the three formats using the <a href="qcolor.html#convertTo">convertTo</a>() function (returning a copy of the color in the desired format), or any of the <a href="qcolor.html#setRgb">setRgb</a>(), <a href="qcolor.html#setHsv">setHsv</a>() and <a href="qcolor.html#setCmyk">setCmyk</a>() functions altering <i>this</i> color's format. The <a href="qcolor.html#spec">spec</a>() function tells how the color was specified.</p>
<p>A color can be set by passing an RGB string (such as &quot;#112233&quot;), or an ARGB string (such as &quot;#ff112233&quot;) or a color name (such as &quot;blue&quot;), to the <a href="qcolor.html#setNamedColor">setNamedColor</a>() function. The color names are taken from the SVG 1.0 color names. The <a href="qcolor.html#name">name</a>() function returns the name of the color in the format &quot;#RRGGBB&quot;. Colors can also be set using <a href="qcolor.html#setRgb">setRgb</a>(), <a href="qcolor.html#setHsv">setHsv</a>() and <a href="qcolor.html#setCmyk">setCmyk</a>(). To get a lighter or darker color use the <a href="qcolor.html#lighter">lighter</a>() and <a href="qcolor.html#darker">darker</a>() functions respectively.</p>
<p>The <a href="qcolor.html#isValid">isValid</a>() function indicates whether a <a href="qcolor.html">QColor</a> is legal at all. For example, a RGB color with RGB values out of range is illegal. For performance reasons, <a href="qcolor.html">QColor</a> mostly disregards illegal colors, and for that reason, the result of using an invalid color is undefined.</p>
<p>The color components can be retrieved individually, e.g with <a href="qcolor.html#red">red</a>(), <a href="qcolor.html#hue">hue</a>() and <a href="qcolor.html#cyan">cyan</a>(). The values of the color components can also be retrieved in one go using the <a href="qcolor.html#getRgb">getRgb</a>(), <a href="qcolor.html#getHsv">getHsv</a>() and <a href="qcolor.html#getCmyk">getCmyk</a>() functions. Using the RGB color model, the color components can in addition be accessed with <a href="qcolor.html#rgb">rgb</a>().</p>
<p>There are several related non-members: <a href="qcolor.html#QRgb-typedef">QRgb</a> is a typdef for an unsigned int representing the RGB value triplet (r, g, b). Note that it also can hold a value for the alpha-channel (for more information, see the <a href="qcolor.html#alpha-blended-drawing">Alpha-Blended Drawing</a> section). The <a href="qcolor.html#qRed">qRed</a>(), <a href="qcolor.html#qBlue">qBlue</a>() and <a href="qcolor.html#qGreen">qGreen</a>() functions return the respective component of the given <a href="qcolor.html#QRgb-typedef">QRgb</a> value, while the <a href="qcolor.html#qRgb">qRgb</a>() and <a href="qcolor.html#qRgba">qRgba</a>() functions create and return the <a href="qcolor.html#QRgb-typedef">QRgb</a> triplet based on the given component values. Finally, the <a href="qcolor.html#qAlpha">qAlpha</a>() function returns the alpha component of the provided <a href="qcolor.html#QRgb-typedef">QRgb</a>, and the <a href="qcolor.html#qGray">qGray</a>() function calculates and return a gray value based on the given value.</p>
<p><a href="qcolor.html">QColor</a> is platform and device independent. The <a href="../qtwidgets/qcolormap.html">QColormap</a> class maps the color to the hardware.</p>
<p>For more information about painting in general, see the <a href="paintsystem.html">Paint System</a> documentation.</p>
<a name="integer-vs-floating-point-precision"></a>
<h3 >Integer vs. Floating Point Precision</h3>
<p><a href="qcolor.html">QColor</a> supports floating point precision and provides floating point versions of all the color components functions, e.g&#x2e; <a href="qcolor.html#getRgbF">getRgbF</a>(), <a href="qcolor.html#hueF">hueF</a>() and <a href="qcolor.html#fromCmykF">fromCmykF</a>(). Note that since the components are stored using 16-bit integers, there might be minor deviations between the values set using, for example, <a href="qcolor.html#setRgbF">setRgbF</a>() and the values returned by the <a href="qcolor.html#getRgbF">getRgbF</a>() function due to rounding.</p>
<p>While the integer based functions take values in the range 0-255 (except <a href="qcolor.html#hue">hue</a>() which must have values within the range 0-359), the floating point functions accept values in the range 0.0 - 1.0&#x2e;</p>
<a name="alpha-blended-drawing"></a>
<h3 >Alpha-Blended Drawing</h3>
<p><a href="qcolor.html">QColor</a> also support alpha-blended outlining and filling. The alpha channel of a color specifies the transparency effect, 0 represents a fully transparent color, while 255 represents a fully opaque color. For example:</p>
<pre class="cpp">

  <span class="comment">// Specify semi-transparent red</span>
  painter<span class="operator">.</span>setBrush(<span class="type"><a href="qcolor.html#QColor">QColor</a></span>(<span class="number">255</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">127</span>));
  painter<span class="operator">.</span>drawRect(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> width()<span class="operator">/</span><span class="number">2</span><span class="operator">,</span> height());

  <span class="comment">// Specify semi-transparent blue</span>
  painter<span class="operator">.</span>setBrush(<span class="type"><a href="qcolor.html#QColor">QColor</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">255</span><span class="operator">,</span> <span class="number">127</span>));
  painter<span class="operator">.</span>drawRect(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> width()<span class="operator">,</span> height()<span class="operator">/</span><span class="number">2</span>);

</pre>
<p>The code above produces the following output:</p>
<p class="centerAlign"><img src="images/alphafill.png" alt="" /></p><p>The alpha channel of a color can be retrieved and set using the <a href="qcolor.html#alpha">alpha</a>() and <a href="qcolor.html#setAlpha">setAlpha</a>() functions if its value is an integer, and <a href="qcolor.html#alphaF">alphaF</a>() and <a href="qcolor.html#setAlphaF">setAlphaF</a>() if its value is qreal (double). By default, the alpha-channel is set to 255 (opaque). To retrieve and set <i>all</i> the RGB color components (including the alpha-channel) in one go, use the <a href="qcolor.html#rgba">rgba</a>() and <a href="qcolor.html#setRgba">setRgba</a>() functions.</p>
<a name="predefined-colors"></a>
<h3 >Predefined Colors</h3>
<p>There are 20 predefined QColors described by the <a href="../qtcore/qt.html#GlobalColor-enum">Qt::GlobalColor</a> enum, including black, white, primary and secondary colors, darker versions of these colors and three shades of gray. <a href="qcolor.html">QColor</a> also recognizes a variety of color names; the static <a href="qcolor.html#colorNames">colorNames</a>() function returns a <a href="../qtcore/qstringlist.html">QStringList</a> color names that <a href="qcolor.html">QColor</a> knows about.</p>
<p class="centerAlign"><img src="images/qt-colors.png" alt="Qt Colors" /></p><p>Additionally, the <a href="../qtcore/qt.html#GlobalColor-enum">Qt::color0</a>, <a href="../qtcore/qt.html#GlobalColor-enum">Qt::color1</a> and <a href="../qtcore/qt.html#GlobalColor-enum">Qt::transparent</a> colors are used for special purposes.</p>
<p><a href="../qtcore/qt.html#GlobalColor-enum">Qt::color0</a> (zero pixel value) and <a href="../qtcore/qt.html#GlobalColor-enum">Qt::color1</a> (non-zero pixel value) are special colors for drawing in QBitmaps. Painting with <a href="../qtcore/qt.html#GlobalColor-enum">Qt::color0</a> sets the bitmap bits to 0 (transparent; i.e&#x2e;, background), and painting with <a href="../qtcore/qt.html#GlobalColor-enum">Qt::color1</a> sets the bits to 1 (opaque; i.e&#x2e;, foreground).</p>
<p><a href="../qtcore/qt.html#GlobalColor-enum">Qt::transparent</a> is used to indicate a transparent pixel. When painting with this value, a pixel value will be used that is appropriate for the underlying pixel format in use.</p>
<a name="the-hsv-color-model"></a>
<h3 >The HSV Color Model</h3>
<p>The RGB model is hardware-oriented. Its representation is close to what most monitors show. In contrast, HSV represents color in a way more suited to the human perception of color. For example, the relationships &quot;stronger than&quot;, &quot;darker than&quot;, and &quot;the opposite of&quot; are easily expressed in HSV but are much harder to express in RGB.</p>
<p>HSV, like RGB, has three components:</p>
<ul>
<li>H, for hue, is in the range 0 to 359 if the color is chromatic (not gray), or meaningless if it is gray. It represents degrees on the color wheel familiar to most people. Red is 0 (degrees), green is 120, and blue is 240.<p><img src="images/qcolor-hue.png" alt="" /></p>
</li>
<li>S, for saturation, is in the range 0 to 255, and the bigger it is, the stronger the color is. Grayish colors have saturation near 0; very strong colors have saturation near 255.<p><img src="images/qcolor-saturation.png" alt="" /></p>
</li>
<li>V, for value, is in the range 0 to 255 and represents lightness or brightness of the color. 0 is black; 255 is as far from black as possible.<p><img src="images/qcolor-value.png" alt="" /></p>
</li>
</ul>
<p>Here are some examples: pure red is H=0, S=255, V=255; a dark red, moving slightly towards the magenta, could be H=350 (equivalent to -10), S=255, V=180; a grayish light red could have H about 0 (say 350-359 or 0-10), S about 50-100, and S=255.</p>
<p>Qt returns a hue value of -1 for achromatic colors. If you pass a hue value that is too large, Qt forces it into range. Hue 360 or 720 is treated as 0; hue 540 is treated as 180.</p>
<p>In addition to the standard HSV model, Qt provides an alpha-channel to feature <a href="qcolor.html#alpha-blended-drawing">alpha-blended drawing</a>.</p>
<a name="the-hsl-color-model"></a>
<h3 >The HSL Color Model</h3>
<p>HSL is similar to HSV, however instead of the Value parameter, HSL specifies a Lightness parameter.</p>
<a name="the-cmyk-color-model"></a>
<h3 >The CMYK Color Model</h3>
<p>While the RGB and HSV color models are used for display on computer monitors, the CMYK model is used in the four-color printing process of printing presses and some hard-copy devices.</p>
<p>CMYK has four components, all in the range 0-255: cyan (C), magenta (M), yellow (Y) and black (K). Cyan, magenta and yellow are called subtractive colors; the CMYK color model creates color by starting with a white surface and then subtracting color by applying the appropriate components. While combining cyan, magenta and yellow gives the color black, subtracting one or more will yield any other color. When combined in various percentages, these three colors can create the entire spectrum of colors.</p>
<p>Mixing 100 percent of cyan, magenta and yellow <i>does</i> produce black, but the result is unsatisfactory since it wastes ink, increases drying time, and gives a muddy colour when printing. For that reason, black is added in professional printing to provide a solid black tone; hence the term 'four color process'.</p>
<p>In addition to the standard CMYK model, Qt provides an alpha-channel to feature <a href="qcolor.html#alpha-blended-drawing">alpha-blended drawing</a>.</p>
</div>
<p><b>See also </b><a href="qpalette.html">QPalette</a> and <a href="qbrush.html">QBrush</a>.</p>
<!-- @@@QColor -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$NameFormat$$$HexRgb$$$HexArgb -->
<h3 class="fn" id="NameFormat-enum"><a name="NameFormat-enum"></a>enum QColor::<span class="name">NameFormat</span></h3>
<p>How to format the output of the <a href="qcolor.html#name">name</a>() function</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QColor::HexRgb</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">#RRGGBB A &quot;#&quot; character followed by three two-digit hexadecimal numbers (i.e&#x2e; <code>#RRGGBB</code>).</td></tr>
<tr><td class="topAlign"><code>QColor::HexArgb</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">#AARRGGBB A &quot;#&quot; character followed by four two-digit hexadecimal numbers (i.e&#x2e; <code>#AARRGGBB</code>).</td></tr>
</table></div>
<p><b>See also </b><a href="qcolor.html#name">name</a>().</p>
<!-- @@@NameFormat -->
<!-- $$$Spec$$$Invalid$$$Rgb$$$Hsv$$$Cmyk$$$Hsl -->
<h3 class="fn" id="Spec-enum"><a name="Spec-enum"></a>enum QColor::<span class="name">Spec</span></h3>
<p>The type of color specified, either RGB, HSV, CMYK or HSL.</p>
<div class="table"><table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><code>QColor::Rgb</code></td><td class="topAlign tblval"><code>1</code></td></tr>
<tr><td class="topAlign"><code>QColor::Hsv</code></td><td class="topAlign tblval"><code>2</code></td></tr>
<tr><td class="topAlign"><code>QColor::Cmyk</code></td><td class="topAlign tblval"><code>3</code></td></tr>
<tr><td class="topAlign"><code>QColor::Hsl</code></td><td class="topAlign tblval"><code>4</code></td></tr>
<tr><td class="topAlign"><code>QColor::Invalid</code></td><td class="topAlign tblval"><code>0</code></td></tr>
</table></div>
<p><b>See also </b><a href="qcolor.html#spec">spec</a>() and <a href="qcolor.html#convertTo">convertTo</a>().</p>
<!-- @@@Spec -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QColor[overload1]$$$QColor -->
<h3 class="fn" id="QColor"><a name="QColor"></a>QColor::<span class="name">QColor</span>()</h3>
<p>Constructs an invalid color with the RGB value (0, 0, 0). An invalid color is a color that is not properly set up for the underlying window system.</p>
<p>The alpha value of an invalid color is unspecified.</p>
<p><b>See also </b><a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorQt::GlobalColor -->
<h3 class="fn" id="QColor-1"><a name="QColor-1"></a>QColor::<span class="name">QColor</span>(<span class="type"><a href="../qtcore/qt.html#GlobalColor-enum">Qt::GlobalColor</a></span> <i>color</i>)</h3>
<p>This is an overloaded function.</p>
<p>Constructs a new color with a color value of <i>color</i>.</p>
<p><b>See also </b><a href="qcolor.html#isValid">isValid</a>() and <a href="qcolor.html#predefined-colors">Predefined Colors</a>.</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorintintintint -->
<h3 class="fn" id="QColor-2"><a name="QColor-2"></a>QColor::<span class="name">QColor</span>(<span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i>, <span class="type">int</span> <i>a</i> = 255)</h3>
<p>Constructs a color with the RGB value <i>r</i>, <i>g</i>, <i>b</i>, and the alpha-channel (transparency) value of <i>a</i>.</p>
<p>The color is left invalid if any of the arguments are invalid.</p>
<p><b>See also </b><a href="qcolor.html#setRgba">setRgba</a>() and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorQRgb -->
<h3 class="fn" id="QColor-3"><a name="QColor-3"></a>QColor::<span class="name">QColor</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>color</i>)</h3>
<p>Constructs a color with the value <i>color</i>. The alpha component is ignored and set to solid.</p>
<p><b>See also </b><a href="qcolor.html#fromRgb">fromRgb</a>() and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorQRgba64 -->
<h3 class="fn" id="QColor-4"><a name="QColor-4"></a>QColor::<span class="name">QColor</span>(<span class="type"><a href="qrgba64.html">QRgba64</a></span> <i>rgba64</i>)</h3>
<p>Constructs a color with the value <i>rgba64</i>.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qcolor.html#fromRgba64">fromRgba64</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorconstQString& -->
<h3 class="fn" id="QColor-5"><a name="QColor-5"></a>QColor::<span class="name">QColor</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>name</i>)</h3>
<p>Constructs a named color in the same way as <a href="qcolor.html#setNamedColor">setNamedColor</a>() using the given <i>name</i>.</p>
<p>The color is left invalid if the <i>name</i> cannot be parsed.</p>
<p><b>See also </b><a href="qcolor.html#setNamedColor">setNamedColor</a>(), <a href="qcolor.html#name">name</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorconstchar* -->
<h3 class="fn" id="QColor-6"><a name="QColor-6"></a>QColor::<span class="name">QColor</span>(const <span class="type">char</span> *<i>name</i>)</h3>
<p>Constructs a named color in the same way as <a href="qcolor.html#setNamedColor">setNamedColor</a>() using the given <i>name</i>.</p>
<p>This is an overloaded function.</p>
<p><b>See also </b><a href="qcolor.html#setNamedColor">setNamedColor</a>(), <a href="qcolor.html#name">name</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorQLatin1String -->
<h3 class="fn" id="QColor-7"><a name="QColor-7"></a>QColor::<span class="name">QColor</span>(<span class="type"><a href="../qtcore/qlatin1string.html">QLatin1String</a></span> <i>name</i>)</h3>
<p>Constructs a named color in the same way as <a href="qcolor.html#setNamedColor">setNamedColor</a>() using the given <i>name</i>.</p>
<p>This is an overloaded function.</p>
<p>This function was introduced in  Qt 5.8.</p>
<p><b>See also </b><a href="qcolor.html#setNamedColor">setNamedColor</a>(), <a href="qcolor.html#name">name</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorconstQColor& -->
<h3 class="fn" id="QColor-9"><a name="QColor-9"></a>QColor::<span class="name">QColor</span>(const <span class="type"><a href="qcolor.html#QColor">QColor</a></span> &amp;<i>color</i>)</h3>
<p>Constructs a color that is a copy of <i>color</i>.</p>
<p><b>See also </b><a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorQColor&& -->
<h3 class="fn" id="QColor-10"><a name="QColor-10"></a>QColor::<span class="name">QColor</span>(<span class="type"><a href="qcolor.html#QColor">QColor</a></span> &amp;&amp;<i>other</i>)</h3>
<p>Move-copy constructor.</p><!-- @@@QColor -->
<!-- $$$alpha[overload1]$$$alpha -->
<h3 class="fn" id="alpha"><a name="alpha"></a><span class="type">int</span> QColor::<span class="name">alpha</span>() const</h3>
<p>Returns the alpha color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setAlpha">setAlpha</a>(), <a href="qcolor.html#alphaF">alphaF</a>(), and <a href="qcolor.html#alpha-blended-drawing">Alpha-Blended Drawing</a>.</p>
<!-- @@@alpha -->
<!-- $$$alphaF[overload1]$$$alphaF -->
<h3 class="fn" id="alphaF"><a name="alphaF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">alphaF</span>() const</h3>
<p>Returns the alpha color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setAlphaF">setAlphaF</a>(), <a href="qcolor.html#alpha">alpha</a>(), and <a href="qcolor.html#alpha-blended-drawing">Alpha-Blended Drawing</a>.</p>
<!-- @@@alphaF -->
<!-- $$$black[overload1]$$$black -->
<h3 class="fn" id="black"><a name="black"></a><span class="type">int</span> QColor::<span class="name">black</span>() const</h3>
<p>Returns the black color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#blackF">blackF</a>(), <a href="qcolor.html#getCmyk">getCmyk</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@black -->
<!-- $$$blackF[overload1]$$$blackF -->
<h3 class="fn" id="blackF"><a name="blackF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">blackF</span>() const</h3>
<p>Returns the black color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#black">black</a>(), <a href="qcolor.html#getCmykF">getCmykF</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@blackF -->
<!-- $$$blue[overload1]$$$blue -->
<h3 class="fn" id="blue"><a name="blue"></a><span class="type">int</span> QColor::<span class="name">blue</span>() const</h3>
<p>Returns the blue color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setBlue">setBlue</a>(), <a href="qcolor.html#blueF">blueF</a>(), and <a href="qcolor.html#getRgb">getRgb</a>().</p>
<!-- @@@blue -->
<!-- $$$blueF[overload1]$$$blueF -->
<h3 class="fn" id="blueF"><a name="blueF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">blueF</span>() const</h3>
<p>Returns the blue color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setBlueF">setBlueF</a>(), <a href="qcolor.html#blue">blue</a>(), and <a href="qcolor.html#getRgbF">getRgbF</a>().</p>
<!-- @@@blueF -->
<!-- $$$colorNames[overload1]$$$colorNames -->
<h3 class="fn" id="colorNames"><a name="colorNames"></a><code>[static] </code><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QColor::<span class="name">colorNames</span>()</h3>
<p>Returns a <a href="../qtcore/qstringlist.html">QStringList</a> containing the color names Qt knows about.</p>
<p><b>See also </b><a href="qcolor.html#predefined-colors">Predefined Colors</a>.</p>
<!-- @@@colorNames -->
<!-- $$$convertTo[overload1]$$$convertToSpec -->
<h3 class="fn" id="convertTo"><a name="convertTo"></a><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">convertTo</span>(<span class="type"><a href="qcolor.html#Spec-enum">Spec</a></span> <i>colorSpec</i>) const</h3>
<p>Creates a copy of <i>this</i> color in the format specified by <i>colorSpec</i>.</p>
<p><b>See also </b><a href="qcolor.html#spec">spec</a>(), <a href="qcolor.html#toCmyk">toCmyk</a>(), <a href="qcolor.html#toHsv">toHsv</a>(), <a href="qcolor.html#toRgb">toRgb</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@convertTo -->
<!-- $$$cyan[overload1]$$$cyan -->
<h3 class="fn" id="cyan"><a name="cyan"></a><span class="type">int</span> QColor::<span class="name">cyan</span>() const</h3>
<p>Returns the cyan color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#cyanF">cyanF</a>(), <a href="qcolor.html#getCmyk">getCmyk</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@cyan -->
<!-- $$$cyanF[overload1]$$$cyanF -->
<h3 class="fn" id="cyanF"><a name="cyanF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">cyanF</span>() const</h3>
<p>Returns the cyan color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#cyan">cyan</a>(), <a href="qcolor.html#getCmykF">getCmykF</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@cyanF -->
<!-- $$$darker[overload1]$$$darkerint -->
<h3 class="fn" id="darker"><a name="darker"></a><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">darker</span>(<span class="type">int</span> <i>factor</i> = 200) const</h3>
<p>Returns a darker (or lighter) color, but does not change this object.</p>
<p>If the <i>factor</i> is greater than 100, this functions returns a darker color. Setting <i>factor</i> to 300 returns a color that has one-third the brightness. If the <i>factor</i> is less than 100, the return color is lighter, but we recommend using the <a href="qcolor.html#lighter">lighter</a>() function for this purpose. If the <i>factor</i> is 0 or negative, the return value is unspecified.</p>
<p>The function converts the current RGB color to HSV, divides the value (V) component by <i>factor</i> and converts the color back to RGB.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qcolor.html#lighter">lighter</a>() and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@darker -->
<!-- $$$fromCmyk[overload1]$$$fromCmykintintintintint -->
<h3 class="fn" id="fromCmyk"><a name="fromCmyk"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromCmyk</span>(<span class="type">int</span> <i>c</i>, <span class="type">int</span> <i>m</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>k</i>, <span class="type">int</span> <i>a</i> = 255)</h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the given CMYK color values: <i>c</i> (cyan), <i>m</i> (magenta), <i>y</i> (yellow), <i>k</i> (black), and <i>a</i> (alpha-channel, i.e&#x2e; transparency).</p>
<p>All the values must be in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#toCmyk">toCmyk</a>(), <a href="qcolor.html#fromCmykF">fromCmykF</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@fromCmyk -->
<!-- $$$fromCmykF[overload1]$$$fromCmykFqrealqrealqrealqrealqreal -->
<h3 class="fn" id="fromCmykF"><a name="fromCmykF"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromCmykF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>c</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>m</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>k</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0)</h3>
<p>This is an overloaded function.</p>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the given CMYK color values: <i>c</i> (cyan), <i>m</i> (magenta), <i>y</i> (yellow), <i>k</i> (black), and <i>a</i> (alpha-channel, i.e&#x2e; transparency).</p>
<p>All the values must be in the range 0.0-1.0&#x2e;</p>
<p><b>See also </b><a href="qcolor.html#toCmyk">toCmyk</a>(), <a href="qcolor.html#fromCmyk">fromCmyk</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@fromCmykF -->
<!-- $$$fromHsl[overload1]$$$fromHslintintintint -->
<h3 class="fn" id="fromHsl"><a name="fromHsl"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromHsl</span>(<span class="type">int</span> <i>h</i>, <span class="type">int</span> <i>s</i>, <span class="type">int</span> <i>l</i>, <span class="type">int</span> <i>a</i> = 255)</h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the HSV color values, <i>h</i> (hue), <i>s</i> (saturation), <i>l</i> (lightness), and <i>a</i> (alpha-channel, i.e&#x2e; transparency).</p>
<p>The value of <i>s</i>, <i>l</i>, and <i>a</i> must all be in the range 0-255; the value of <i>h</i> must be in the range 0-359.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#toHsl">toHsl</a>(), <a href="qcolor.html#fromHslF">fromHslF</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromHsl -->
<!-- $$$fromHslF[overload1]$$$fromHslFqrealqrealqrealqreal -->
<h3 class="fn" id="fromHslF"><a name="fromHslF"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromHslF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>s</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>l</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0)</h3>
<p>This is an overloaded function.</p>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the HSV color values, <i>h</i> (hue), <i>s</i> (saturation), <i>l</i> (lightness), and <i>a</i> (alpha-channel, i.e&#x2e; transparency).</p>
<p>All the values must be in the range 0.0-1.0&#x2e;</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#toHsl">toHsl</a>(), <a href="qcolor.html#fromHsl">fromHsl</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromHslF -->
<!-- $$$fromHsv[overload1]$$$fromHsvintintintint -->
<h3 class="fn" id="fromHsv"><a name="fromHsv"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromHsv</span>(<span class="type">int</span> <i>h</i>, <span class="type">int</span> <i>s</i>, <span class="type">int</span> <i>v</i>, <span class="type">int</span> <i>a</i> = 255)</h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the HSV color values, <i>h</i> (hue), <i>s</i> (saturation), <i>v</i> (value), and <i>a</i> (alpha-channel, i.e&#x2e; transparency).</p>
<p>The value of <i>s</i>, <i>v</i>, and <i>a</i> must all be in the range 0-255; the value of <i>h</i> must be in the range 0-359.</p>
<p><b>See also </b><a href="qcolor.html#toHsv">toHsv</a>(), <a href="qcolor.html#fromHsvF">fromHsvF</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@fromHsv -->
<!-- $$$fromHsvF[overload1]$$$fromHsvFqrealqrealqrealqreal -->
<h3 class="fn" id="fromHsvF"><a name="fromHsvF"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromHsvF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>s</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0)</h3>
<p>This is an overloaded function.</p>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the HSV color values, <i>h</i> (hue), <i>s</i> (saturation), <i>v</i> (value), and <i>a</i> (alpha-channel, i.e&#x2e; transparency).</p>
<p>All the values must be in the range 0.0-1.0&#x2e;</p>
<p><b>See also </b><a href="qcolor.html#toHsv">toHsv</a>(), <a href="qcolor.html#fromHsv">fromHsv</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@fromHsvF -->
<!-- $$$fromRgb[overload1]$$$fromRgbQRgb -->
<h3 class="fn" id="fromRgb"><a name="fromRgb"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromRgb</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i>)</h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the given <a href="qcolor.html#QRgb-typedef">QRgb</a> value <i>rgb</i>.</p>
<p>The alpha component of <i>rgb</i> is ignored (i.e&#x2e; it is automatically set to 255), use the <a href="qcolor.html#fromRgba">fromRgba</a>() function to include the alpha-channel specified by the given <a href="qcolor.html#QRgb-typedef">QRgb</a> value.</p>
<p><b>See also </b><a href="qcolor.html#fromRgba">fromRgba</a>(), <a href="qcolor.html#fromRgbF">fromRgbF</a>(), <a href="qcolor.html#toRgb">toRgb</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromRgb -->
<!-- $$$fromRgb$$$fromRgbintintintint -->
<h3 class="fn" id="fromRgb-1"><a name="fromRgb-1"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromRgb</span>(<span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i>, <span class="type">int</span> <i>a</i> = 255)</h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the RGB color values, <i>r</i> (red), <i>g</i> (green), <i>b</i> (blue), and <i>a</i> (alpha-channel, i.e&#x2e; transparency).</p>
<p>All the values must be in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#toRgb">toRgb</a>(), <a href="qcolor.html#fromRgba64">fromRgba64</a>(), <a href="qcolor.html#fromRgbF">fromRgbF</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromRgb -->
<!-- $$$fromRgba64[overload1]$$$fromRgba64ushortushortushortushort -->
<h3 class="fn" id="fromRgba64"><a name="fromRgba64"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromRgba64</span>(<span class="type"><a href="../qtcore/qtglobal.html#ushort-typedef">ushort</a></span> <i>r</i>, <span class="type"><a href="../qtcore/qtglobal.html#ushort-typedef">ushort</a></span> <i>g</i>, <span class="type"><a href="../qtcore/qtglobal.html#ushort-typedef">ushort</a></span> <i>b</i>, <span class="type"><a href="../qtcore/qtglobal.html#ushort-typedef">ushort</a></span> <i>a</i> = USHRT_MAX)</h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the RGBA64 color values, <i>r</i> (red), <i>g</i> (green), <i>b</i> (blue), and <i>a</i> (alpha-channel, i.e&#x2e; transparency).</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qcolor.html#fromRgb">fromRgb</a>(), <a href="qcolor.html#fromRgbF">fromRgbF</a>(), <a href="qcolor.html#toRgb">toRgb</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromRgba64 -->
<!-- $$$fromRgba64$$$fromRgba64QRgba64 -->
<h3 class="fn" id="fromRgba64-1"><a name="fromRgba64-1"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromRgba64</span>(<span class="type"><a href="qrgba64.html">QRgba64</a></span> <i>rgba64</i>)</h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the given <a href="qrgba64.html">QRgba64</a> value <i>rgba64</i>.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qcolor.html#fromRgb">fromRgb</a>(), <a href="qcolor.html#fromRgbF">fromRgbF</a>(), <a href="qcolor.html#toRgb">toRgb</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromRgba64 -->
<!-- $$$fromRgbF[overload1]$$$fromRgbFqrealqrealqrealqreal -->
<h3 class="fn" id="fromRgbF"><a name="fromRgbF"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromRgbF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>r</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>g</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>b</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0)</h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the RGB color values, <i>r</i> (red), <i>g</i> (green), <i>b</i> (blue), and <i>a</i> (alpha-channel, i.e&#x2e; transparency).</p>
<p>All the values must be in the range 0.0-1.0&#x2e;</p>
<p><b>See also </b><a href="qcolor.html#fromRgb">fromRgb</a>(), <a href="qcolor.html#fromRgba64">fromRgba64</a>(), <a href="qcolor.html#toRgb">toRgb</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromRgbF -->
<!-- $$$fromRgba[overload1]$$$fromRgbaQRgb -->
<h3 class="fn" id="fromRgba"><a name="fromRgba"></a><code>[static] </code><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">fromRgba</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgba</i>)</h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the given <a href="qcolor.html#QRgb-typedef">QRgb</a> value <i>rgba</i>.</p>
<p>Unlike the <a href="qcolor.html#fromRgb">fromRgb</a>() function, the alpha-channel specified by the given <a href="qcolor.html#QRgb-typedef">QRgb</a> value is included.</p>
<p><b>See also </b><a href="qcolor.html#fromRgb">fromRgb</a>(), <a href="qcolor.html#fromRgba64">fromRgba64</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromRgba -->
<!-- $$$getCmyk[overload1]$$$getCmykint*int*int*int*int* -->
<h3 class="fn" id="getCmyk"><a name="getCmyk"></a><span class="type">void</span> QColor::<span class="name">getCmyk</span>(<span class="type">int</span> *<i>c</i>, <span class="type">int</span> *<i>m</i>, <span class="type">int</span> *<i>y</i>, <span class="type">int</span> *<i>k</i>, <span class="type">int</span> *<i>a</i> = Q_NULLPTR)</h3>
<p>Sets the contents pointed to by <i>c</i>, <i>m</i>, <i>y</i>, <i>k</i>, and <i>a</i>, to the cyan, magenta, yellow, black, and alpha-channel (transparency) components of the color's CMYK value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#cyan">cyan</a>(), <a href="qcolor.html#magenta">magenta</a>(), <a href="qcolor.html#yellow">yellow</a>(), <a href="qcolor.html#black">black</a>() and <a href="qcolor.html#alpha">alpha</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#setCmyk">setCmyk</a>() and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@getCmyk -->
<!-- $$$getCmykF[overload1]$$$getCmykFqreal*qreal*qreal*qreal*qreal* -->
<h3 class="fn" id="getCmykF"><a name="getCmykF"></a><span class="type">void</span> QColor::<span class="name">getCmykF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>c</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>m</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>k</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>a</i> = Q_NULLPTR)</h3>
<p>Sets the contents pointed to by <i>c</i>, <i>m</i>, <i>y</i>, <i>k</i>, and <i>a</i>, to the cyan, magenta, yellow, black, and alpha-channel (transparency) components of the color's CMYK value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#cyanF">cyanF</a>(), <a href="qcolor.html#magentaF">magentaF</a>(), <a href="qcolor.html#yellowF">yellowF</a>(), <a href="qcolor.html#blackF">blackF</a>() and <a href="qcolor.html#alphaF">alphaF</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#setCmykF">setCmykF</a>() and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@getCmykF -->
<!-- $$$getHsl[overload1]$$$getHslint*int*int*int* -->
<h3 class="fn" id="getHsl"><a name="getHsl"></a><span class="type">void</span> QColor::<span class="name">getHsl</span>(<span class="type">int</span> *<i>h</i>, <span class="type">int</span> *<i>s</i>, <span class="type">int</span> *<i>l</i>, <span class="type">int</span> *<i>a</i> = Q_NULLPTR) const</h3>
<p>Sets the contents pointed to by <i>h</i>, <i>s</i>, <i>l</i>, and <i>a</i>, to the hue, saturation, lightness, and alpha-channel (transparency) components of the color's HSL value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#hslHue">hslHue</a>(), <a href="qcolor.html#hslSaturation">hslSaturation</a>(), <a href="qcolor.html#lightness">lightness</a>() and <a href="qcolor.html#alpha">alpha</a>() functions.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#setHsl">setHsl</a>().</p>
<!-- @@@getHsl -->
<!-- $$$getHslF[overload1]$$$getHslFqreal*qreal*qreal*qreal* -->
<h3 class="fn" id="getHslF"><a name="getHslF"></a><span class="type">void</span> QColor::<span class="name">getHslF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>h</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>s</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>l</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>a</i> = Q_NULLPTR) const</h3>
<p>Sets the contents pointed to by <i>h</i>, <i>s</i>, <i>l</i>, and <i>a</i>, to the hue, saturation, lightness, and alpha-channel (transparency) components of the color's HSL value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#hslHueF">hslHueF</a>(), <a href="qcolor.html#hslSaturationF">hslSaturationF</a>(), <a href="qcolor.html#lightnessF">lightnessF</a>() and <a href="qcolor.html#alphaF">alphaF</a>() functions.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#setHsl">setHsl</a>().</p>
<!-- @@@getHslF -->
<!-- $$$getHsv[overload1]$$$getHsvint*int*int*int* -->
<h3 class="fn" id="getHsv"><a name="getHsv"></a><span class="type">void</span> QColor::<span class="name">getHsv</span>(<span class="type">int</span> *<i>h</i>, <span class="type">int</span> *<i>s</i>, <span class="type">int</span> *<i>v</i>, <span class="type">int</span> *<i>a</i> = Q_NULLPTR) const</h3>
<p>Sets the contents pointed to by <i>h</i>, <i>s</i>, <i>v</i>, and <i>a</i>, to the hue, saturation, value, and alpha-channel (transparency) components of the color's HSV value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#hue">hue</a>(), <a href="qcolor.html#saturation">saturation</a>(), <a href="qcolor.html#value">value</a>() and <a href="qcolor.html#alpha">alpha</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#setHsv">setHsv</a>() and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@getHsv -->
<!-- $$$getHsvF[overload1]$$$getHsvFqreal*qreal*qreal*qreal* -->
<h3 class="fn" id="getHsvF"><a name="getHsvF"></a><span class="type">void</span> QColor::<span class="name">getHsvF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>h</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>s</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>v</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>a</i> = Q_NULLPTR) const</h3>
<p>Sets the contents pointed to by <i>h</i>, <i>s</i>, <i>v</i>, and <i>a</i>, to the hue, saturation, value, and alpha-channel (transparency) components of the color's HSV value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#hueF">hueF</a>(), <a href="qcolor.html#saturationF">saturationF</a>(), <a href="qcolor.html#valueF">valueF</a>() and <a href="qcolor.html#alphaF">alphaF</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#setHsv">setHsv</a>() and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@getHsvF -->
<!-- $$$getRgb[overload1]$$$getRgbint*int*int*int* -->
<h3 class="fn" id="getRgb"><a name="getRgb"></a><span class="type">void</span> QColor::<span class="name">getRgb</span>(<span class="type">int</span> *<i>r</i>, <span class="type">int</span> *<i>g</i>, <span class="type">int</span> *<i>b</i>, <span class="type">int</span> *<i>a</i> = Q_NULLPTR) const</h3>
<p>Sets the contents pointed to by <i>r</i>, <i>g</i>, <i>b</i>, and <i>a</i>, to the red, green, blue, and alpha-channel (transparency) components of the color's RGB value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#red">red</a>(), <a href="qcolor.html#green">green</a>(), <a href="qcolor.html#blue">blue</a>() and <a href="qcolor.html#alpha">alpha</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#rgb">rgb</a>() and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@getRgb -->
<!-- $$$getRgbF[overload1]$$$getRgbFqreal*qreal*qreal*qreal* -->
<h3 class="fn" id="getRgbF"><a name="getRgbF"></a><span class="type">void</span> QColor::<span class="name">getRgbF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>r</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>g</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>b</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>a</i> = Q_NULLPTR) const</h3>
<p>Sets the contents pointed to by <i>r</i>, <i>g</i>, <i>b</i>, and <i>a</i>, to the red, green, blue, and alpha-channel (transparency) components of the color's RGB value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#redF">redF</a>(), <a href="qcolor.html#greenF">greenF</a>(), <a href="qcolor.html#blueF">blueF</a>() and <a href="qcolor.html#alphaF">alphaF</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#rgb">rgb</a>() and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@getRgbF -->
<!-- $$$green[overload1]$$$green -->
<h3 class="fn" id="green"><a name="green"></a><span class="type">int</span> QColor::<span class="name">green</span>() const</h3>
<p>Returns the green color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setGreen">setGreen</a>(), <a href="qcolor.html#greenF">greenF</a>(), and <a href="qcolor.html#getRgb">getRgb</a>().</p>
<!-- @@@green -->
<!-- $$$greenF[overload1]$$$greenF -->
<h3 class="fn" id="greenF"><a name="greenF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">greenF</span>() const</h3>
<p>Returns the green color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setGreenF">setGreenF</a>(), <a href="qcolor.html#green">green</a>(), and <a href="qcolor.html#getRgbF">getRgbF</a>().</p>
<!-- @@@greenF -->
<!-- $$$hslHue[overload1]$$$hslHue -->
<h3 class="fn" id="hslHue"><a name="hslHue"></a><span class="type">int</span> QColor::<span class="name">hslHue</span>() const</h3>
<p>Returns the hue color component of this color.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#getHslF">getHslF</a>() and <a href="qcolor.html#getHsl">getHsl</a>().</p>
<!-- @@@hslHue -->
<!-- $$$hslHueF[overload1]$$$hslHueF -->
<h3 class="fn" id="hslHueF"><a name="hslHueF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">hslHueF</span>() const</h3>
<p>Returns the hue color component of this color.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#hue">hue</a>() and <a href="qcolor.html#getHslF">getHslF</a>().</p>
<!-- @@@hslHueF -->
<!-- $$$hslSaturation[overload1]$$$hslSaturation -->
<h3 class="fn" id="hslSaturation"><a name="hslSaturation"></a><span class="type">int</span> QColor::<span class="name">hslSaturation</span>() const</h3>
<p>Returns the saturation color component of this color.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#saturationF">saturationF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hslSaturation -->
<!-- $$$hslSaturationF[overload1]$$$hslSaturationF -->
<h3 class="fn" id="hslSaturationF"><a name="hslSaturationF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">hslSaturationF</span>() const</h3>
<p>Returns the saturation color component of this color.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#saturationF">saturationF</a>() and <a href="qcolor.html#getHslF">getHslF</a>().</p>
<!-- @@@hslSaturationF -->
<!-- $$$hsvHue[overload1]$$$hsvHue -->
<h3 class="fn" id="hsvHue"><a name="hsvHue"></a><span class="type">int</span> QColor::<span class="name">hsvHue</span>() const</h3>
<p>Returns the hue color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#hueF">hueF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hsvHue -->
<!-- $$$hsvHueF[overload1]$$$hsvHueF -->
<h3 class="fn" id="hsvHueF"><a name="hsvHueF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">hsvHueF</span>() const</h3>
<p>Returns the hue color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#hue">hue</a>(), <a href="qcolor.html#getHsvF">getHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hsvHueF -->
<!-- $$$hsvSaturation[overload1]$$$hsvSaturation -->
<h3 class="fn" id="hsvSaturation"><a name="hsvSaturation"></a><span class="type">int</span> QColor::<span class="name">hsvSaturation</span>() const</h3>
<p>Returns the saturation color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#saturationF">saturationF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hsvSaturation -->
<!-- $$$hsvSaturationF[overload1]$$$hsvSaturationF -->
<h3 class="fn" id="hsvSaturationF"><a name="hsvSaturationF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">hsvSaturationF</span>() const</h3>
<p>Returns the saturation color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#saturation">saturation</a>(), <a href="qcolor.html#getHsvF">getHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hsvSaturationF -->
<!-- $$$hue[overload1]$$$hue -->
<h3 class="fn" id="hue"><a name="hue"></a><span class="type">int</span> QColor::<span class="name">hue</span>() const</h3>
<p>Returns the hue color component of this color.</p>
<p>The color is implicitly converted to HSV.</p>
<p><b>See also </b><a href="qcolor.html#hsvHue">hsvHue</a>(), <a href="qcolor.html#hueF">hueF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hue -->
<!-- $$$hueF[overload1]$$$hueF -->
<h3 class="fn" id="hueF"><a name="hueF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">hueF</span>() const</h3>
<p>Returns the hue color component of this color.</p>
<p>The color is implicitly converted to HSV.</p>
<p><b>See also </b><a href="qcolor.html#hsvHueF">hsvHueF</a>(), <a href="qcolor.html#hue">hue</a>(), <a href="qcolor.html#getHsvF">getHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hueF -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn" id="isValid"><a name="isValid"></a><span class="type">bool</span> QColor::<span class="name">isValid</span>() const</h3>
<p>Returns <code>true</code> if the color is valid; otherwise returns <code>false</code>.</p>
<!-- @@@isValid -->
<!-- $$$isValidColor[overload1]$$$isValidColorconstQString& -->
<h3 class="fn" id="isValidColor"><a name="isValidColor"></a><code>[static] </code><span class="type">bool</span> QColor::<span class="name">isValidColor</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>name</i>)</h3>
<p>Returns <code>true</code> if the <i>name</i> is a valid color name and can be used to construct a valid <a href="qcolor.html">QColor</a> object, otherwise returns false.</p>
<p>It uses the same algorithm used in <a href="qcolor.html#setNamedColor">setNamedColor</a>().</p>
<p>This function was introduced in  Qt 4.7.</p>
<p><b>See also </b><a href="qcolor.html#setNamedColor">setNamedColor</a>().</p>
<!-- @@@isValidColor -->
<!-- $$$isValidColor$$$isValidColorQLatin1String -->
<h3 class="fn" id="isValidColor-1"><a name="isValidColor-1"></a><code>[static] </code><span class="type">bool</span> QColor::<span class="name">isValidColor</span>(<span class="type"><a href="../qtcore/qlatin1string.html">QLatin1String</a></span> <i>name</i>)</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in  Qt 5.8.</p>
<!-- @@@isValidColor -->
<!-- $$$lighter[overload1]$$$lighterint -->
<h3 class="fn" id="lighter"><a name="lighter"></a><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">lighter</span>(<span class="type">int</span> <i>factor</i> = 150) const</h3>
<p>Returns a lighter (or darker) color, but does not change this object.</p>
<p>If the <i>factor</i> is greater than 100, this functions returns a lighter color. Setting <i>factor</i> to 150 returns a color that is 50% brighter. If the <i>factor</i> is less than 100, the return color is darker, but we recommend using the <a href="qcolor.html#darker">darker</a>() function for this purpose. If the <i>factor</i> is 0 or negative, the return value is unspecified.</p>
<p>The function converts the current RGB color to HSV, multiplies the value (V) component by <i>factor</i> and converts the color back to RGB.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qcolor.html#darker">darker</a>() and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@lighter -->
<!-- $$$lightness[overload1]$$$lightness -->
<h3 class="fn" id="lightness"><a name="lightness"></a><span class="type">int</span> QColor::<span class="name">lightness</span>() const</h3>
<p>Returns the lightness color component of this color.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#lightnessF">lightnessF</a>() and <a href="qcolor.html#getHsl">getHsl</a>().</p>
<!-- @@@lightness -->
<!-- $$$lightnessF[overload1]$$$lightnessF -->
<h3 class="fn" id="lightnessF"><a name="lightnessF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">lightnessF</span>() const</h3>
<p>Returns the lightness color component of this color.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#value">value</a>() and <a href="qcolor.html#getHslF">getHslF</a>().</p>
<!-- @@@lightnessF -->
<!-- $$$magenta[overload1]$$$magenta -->
<h3 class="fn" id="magenta"><a name="magenta"></a><span class="type">int</span> QColor::<span class="name">magenta</span>() const</h3>
<p>Returns the magenta color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#magentaF">magentaF</a>(), <a href="qcolor.html#getCmyk">getCmyk</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@magenta -->
<!-- $$$magentaF[overload1]$$$magentaF -->
<h3 class="fn" id="magentaF"><a name="magentaF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">magentaF</span>() const</h3>
<p>Returns the magenta color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#magenta">magenta</a>(), <a href="qcolor.html#getCmykF">getCmykF</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@magentaF -->
<!-- $$$name[overload1]$$$name -->
<h3 class="fn" id="name"><a name="name"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QColor::<span class="name">name</span>() const</h3>
<p>Returns the name of the color in the format &quot;#RRGGBB&quot;; i.e&#x2e; a &quot;#&quot; character followed by three two-digit hexadecimal numbers.</p>
<p><b>See also </b><a href="qcolor.html#setNamedColor">setNamedColor</a>().</p>
<!-- @@@name -->
<!-- $$$name$$$nameNameFormat -->
<h3 class="fn" id="name-1"><a name="name-1"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QColor::<span class="name">name</span>(<span class="type"><a href="qcolor.html#NameFormat-enum">NameFormat</a></span> <i>format</i>) const</h3>
<p>Returns the name of the color in the specified <i>format</i>.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qcolor.html#setNamedColor">setNamedColor</a>() and <a href="qcolor.html#NameFormat-enum">NameFormat</a>.</p>
<!-- @@@name -->
<!-- $$$red[overload1]$$$red -->
<h3 class="fn" id="red"><a name="red"></a><span class="type">int</span> QColor::<span class="name">red</span>() const</h3>
<p>Returns the red color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setRed">setRed</a>(), <a href="qcolor.html#redF">redF</a>(), and <a href="qcolor.html#getRgb">getRgb</a>().</p>
<!-- @@@red -->
<!-- $$$redF[overload1]$$$redF -->
<h3 class="fn" id="redF"><a name="redF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">redF</span>() const</h3>
<p>Returns the red color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setRedF">setRedF</a>(), <a href="qcolor.html#red">red</a>(), and <a href="qcolor.html#getRgbF">getRgbF</a>().</p>
<!-- @@@redF -->
<!-- $$$rgb[overload1]$$$rgb -->
<h3 class="fn" id="rgb"><a name="rgb"></a><span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> QColor::<span class="name">rgb</span>() const</h3>
<p>Returns the RGB value of the color. The alpha value is opaque.</p>
<p><b>See also </b><a href="qcolor.html#setRgb">setRgb</a>(), <a href="qcolor.html#getRgb">getRgb</a>(), and <a href="qcolor.html#rgba">rgba</a>().</p>
<!-- @@@rgb -->
<!-- $$$rgba64[overload1]$$$rgba64 -->
<h3 class="fn" id="rgba64"><a name="rgba64"></a><span class="type"><a href="qrgba64.html">QRgba64</a></span> QColor::<span class="name">rgba64</span>() const</h3>
<p>Returns the RGB64 value of the color, including its alpha.</p>
<p>For an invalid color, the alpha value of the returned color is unspecified.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qcolor.html#setRgba64">setRgba64</a>(), <a href="qcolor.html#rgba">rgba</a>(), and <a href="qcolor.html#rgb">rgb</a>().</p>
<!-- @@@rgba64 -->
<!-- $$$rgba[overload1]$$$rgba -->
<h3 class="fn" id="rgba"><a name="rgba"></a><span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> QColor::<span class="name">rgba</span>() const</h3>
<p>Returns the RGB value of the color, including its alpha.</p>
<p>For an invalid color, the alpha value of the returned color is unspecified.</p>
<p><b>See also </b><a href="qcolor.html#setRgba">setRgba</a>(), <a href="qcolor.html#rgb">rgb</a>(), and <a href="qcolor.html#rgba64">rgba64</a>().</p>
<!-- @@@rgba -->
<!-- $$$saturation[overload1]$$$saturation -->
<h3 class="fn" id="saturation"><a name="saturation"></a><span class="type">int</span> QColor::<span class="name">saturation</span>() const</h3>
<p>Returns the saturation color component of this color.</p>
<p>The color is implicitly converted to HSV.</p>
<p><b>See also </b><a href="qcolor.html#hsvSaturation">hsvSaturation</a>(), <a href="qcolor.html#saturationF">saturationF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@saturation -->
<!-- $$$saturationF[overload1]$$$saturationF -->
<h3 class="fn" id="saturationF"><a name="saturationF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">saturationF</span>() const</h3>
<p>Returns the saturation color component of this color.</p>
<p>The color is implicitly converted to HSV.</p>
<p><b>See also </b><a href="qcolor.html#hsvSaturationF">hsvSaturationF</a>(), <a href="qcolor.html#saturation">saturation</a>(), <a href="qcolor.html#getHsvF">getHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@saturationF -->
<!-- $$$setAlpha[overload1]$$$setAlphaint -->
<h3 class="fn" id="setAlpha"><a name="setAlpha"></a><span class="type">void</span> QColor::<span class="name">setAlpha</span>(<span class="type">int</span> <i>alpha</i>)</h3>
<p>Sets the alpha of this color to <i>alpha</i>. Integer alpha is specified in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#alpha">alpha</a>(), <a href="qcolor.html#alphaF">alphaF</a>(), and <a href="qcolor.html#alpha-blended-drawing">Alpha-Blended Drawing</a>.</p>
<!-- @@@setAlpha -->
<!-- $$$setAlphaF[overload1]$$$setAlphaFqreal -->
<h3 class="fn" id="setAlphaF"><a name="setAlphaF"></a><span class="type">void</span> QColor::<span class="name">setAlphaF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>alpha</i>)</h3>
<p>Sets the alpha of this color to <i>alpha</i>. qreal alpha is specified in the range 0.0-1.0&#x2e;</p>
<p><b>See also </b><a href="qcolor.html#alphaF">alphaF</a>(), <a href="qcolor.html#alpha">alpha</a>(), and <a href="qcolor.html#alpha-blended-drawing">Alpha-Blended Drawing</a>.</p>
<!-- @@@setAlphaF -->
<!-- $$$setBlue[overload1]$$$setBlueint -->
<h3 class="fn" id="setBlue"><a name="setBlue"></a><span class="type">void</span> QColor::<span class="name">setBlue</span>(<span class="type">int</span> <i>blue</i>)</h3>
<p>Sets the blue color component of this color to <i>blue</i>. Integer components are specified in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#blue">blue</a>(), <a href="qcolor.html#blueF">blueF</a>(), and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@setBlue -->
<!-- $$$setBlueF[overload1]$$$setBlueFqreal -->
<h3 class="fn" id="setBlueF"><a name="setBlueF"></a><span class="type">void</span> QColor::<span class="name">setBlueF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>blue</i>)</h3>
<p>Sets the blue color component of this color to <i>blue</i>. Float components are specified in the range 0.0-1.0&#x2e;</p>
<p><b>See also </b><a href="qcolor.html#blueF">blueF</a>(), <a href="qcolor.html#blue">blue</a>(), and <a href="qcolor.html#setRgbF">setRgbF</a>().</p>
<!-- @@@setBlueF -->
<!-- $$$setCmyk[overload1]$$$setCmykintintintintint -->
<h3 class="fn" id="setCmyk"><a name="setCmyk"></a><span class="type">void</span> QColor::<span class="name">setCmyk</span>(<span class="type">int</span> <i>c</i>, <span class="type">int</span> <i>m</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>k</i>, <span class="type">int</span> <i>a</i> = 255)</h3>
<p>Sets the color to CMYK values, <i>c</i> (cyan), <i>m</i> (magenta), <i>y</i> (yellow), <i>k</i> (black), and <i>a</i> (alpha-channel, i.e&#x2e; transparency).</p>
<p>All the values must be in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#getCmyk">getCmyk</a>(), <a href="qcolor.html#setCmykF">setCmykF</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@setCmyk -->
<!-- $$$setCmykF[overload1]$$$setCmykFqrealqrealqrealqrealqreal -->
<h3 class="fn" id="setCmykF"><a name="setCmykF"></a><span class="type">void</span> QColor::<span class="name">setCmykF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>c</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>m</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>k</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0)</h3>
<p>This is an overloaded function.</p>
<p>Sets the color to CMYK values, <i>c</i> (cyan), <i>m</i> (magenta), <i>y</i> (yellow), <i>k</i> (black), and <i>a</i> (alpha-channel, i.e&#x2e; transparency).</p>
<p>All the values must be in the range 0.0-1.0&#x2e;</p>
<p><b>See also </b><a href="qcolor.html#getCmykF">getCmykF</a>(), <a href="qcolor.html#setCmyk">setCmyk</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@setCmykF -->
<!-- $$$setGreen[overload1]$$$setGreenint -->
<h3 class="fn" id="setGreen"><a name="setGreen"></a><span class="type">void</span> QColor::<span class="name">setGreen</span>(<span class="type">int</span> <i>green</i>)</h3>
<p>Sets the green color component of this color to <i>green</i>. Integer components are specified in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#green">green</a>(), <a href="qcolor.html#greenF">greenF</a>(), and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@setGreen -->
<!-- $$$setGreenF[overload1]$$$setGreenFqreal -->
<h3 class="fn" id="setGreenF"><a name="setGreenF"></a><span class="type">void</span> QColor::<span class="name">setGreenF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>green</i>)</h3>
<p>Sets the green color component of this color to <i>green</i>. Float components are specified in the range 0.0-1.0&#x2e;</p>
<p><b>See also </b><a href="qcolor.html#greenF">greenF</a>(), <a href="qcolor.html#green">green</a>(), and <a href="qcolor.html#setRgbF">setRgbF</a>().</p>
<!-- @@@setGreenF -->
<!-- $$$setHsl[overload1]$$$setHslintintintint -->
<h3 class="fn" id="setHsl"><a name="setHsl"></a><span class="type">void</span> QColor::<span class="name">setHsl</span>(<span class="type">int</span> <i>h</i>, <span class="type">int</span> <i>s</i>, <span class="type">int</span> <i>l</i>, <span class="type">int</span> <i>a</i> = 255)</h3>
<p>Sets a HSL color value; <i>h</i> is the hue, <i>s</i> is the saturation, <i>l</i> is the lightness and <i>a</i> is the alpha component of the HSL color.</p>
<p>The saturation, value and alpha-channel values must be in the range 0-255, and the hue value must be greater than -1.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#getHsl">getHsl</a>() and <a href="qcolor.html#setHslF">setHslF</a>().</p>
<!-- @@@setHsl -->
<!-- $$$setHslF[overload1]$$$setHslFqrealqrealqrealqreal -->
<h3 class="fn" id="setHslF"><a name="setHslF"></a><span class="type">void</span> QColor::<span class="name">setHslF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>s</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>l</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0)</h3>
<p>Sets a HSL color lightness; <i>h</i> is the hue, <i>s</i> is the saturation, <i>l</i> is the lightness and <i>a</i> is the alpha component of the HSL color.</p>
<p>All the values must be in the range 0.0-1.0&#x2e;</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#getHslF">getHslF</a>() and <a href="qcolor.html#setHsl">setHsl</a>().</p>
<!-- @@@setHslF -->
<!-- $$$setHsv[overload1]$$$setHsvintintintint -->
<h3 class="fn" id="setHsv"><a name="setHsv"></a><span class="type">void</span> QColor::<span class="name">setHsv</span>(<span class="type">int</span> <i>h</i>, <span class="type">int</span> <i>s</i>, <span class="type">int</span> <i>v</i>, <span class="type">int</span> <i>a</i> = 255)</h3>
<p>Sets a HSV color value; <i>h</i> is the hue, <i>s</i> is the saturation, <i>v</i> is the value and <i>a</i> is the alpha component of the HSV color.</p>
<p>The saturation, value and alpha-channel values must be in the range 0-255, and the hue value must be greater than -1.</p>
<p><b>See also </b><a href="qcolor.html#getHsv">getHsv</a>(), <a href="qcolor.html#setHsvF">setHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@setHsv -->
<!-- $$$setHsvF[overload1]$$$setHsvFqrealqrealqrealqreal -->
<h3 class="fn" id="setHsvF"><a name="setHsvF"></a><span class="type">void</span> QColor::<span class="name">setHsvF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>s</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0)</h3>
<p>Sets a HSV color value; <i>h</i> is the hue, <i>s</i> is the saturation, <i>v</i> is the value and <i>a</i> is the alpha component of the HSV color.</p>
<p>All the values must be in the range 0.0-1.0&#x2e;</p>
<p><b>See also </b><a href="qcolor.html#getHsvF">getHsvF</a>(), <a href="qcolor.html#setHsv">setHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@setHsvF -->
<!-- $$$setNamedColor[overload1]$$$setNamedColorconstQString& -->
<h3 class="fn" id="setNamedColor"><a name="setNamedColor"></a><span class="type">void</span> QColor::<span class="name">setNamedColor</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>name</i>)</h3>
<p>Sets the RGB value of this <a href="qcolor.html">QColor</a> to <i>name</i>, which may be in one of these formats:</p>
<ul>
<li>#RGB (each of R, G, and B is a single hex digit)</li>
<li>#RRGGBB</li>
<li>#AARRGGBB (Since 5.2)</li>
<li>#RRRGGGBBB</li>
<li>#RRRRGGGGBBBB</li>
<li>A name from the list of colors defined in the list of <a href="http://www.w3.org/TR/SVG/types.html#ColorKeywords">SVG color keyword names</a> provided by the World Wide Web Consortium; for example, &quot;steelblue&quot; or &quot;gainsboro&quot;. These color names work on all platforms. Note that these color names are <i>not</i> the same as defined by the <a href="../qtcore/qt.html#GlobalColor-enum">Qt::GlobalColor</a> enums, e.g&#x2e; &quot;green&quot; and <a href="../qtcore/qt.html#GlobalColor-enum">Qt::green</a> does not refer to the same color.</li>
<li><code>transparent</code> - representing the absence of a color.</li>
</ul>
<p>The color is invalid if <i>name</i> cannot be parsed.</p>
<p><b>See also </b><a href="qcolor.html#QColor">QColor</a>(), <a href="qcolor.html#name">name</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@setNamedColor -->
<!-- $$$setNamedColor$$$setNamedColorQLatin1String -->
<h3 class="fn" id="setNamedColor-1"><a name="setNamedColor-1"></a><span class="type">void</span> QColor::<span class="name">setNamedColor</span>(<span class="type"><a href="../qtcore/qlatin1string.html">QLatin1String</a></span> <i>name</i>)</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in  Qt 5.8.</p>
<!-- @@@setNamedColor -->
<!-- $$$setRed[overload1]$$$setRedint -->
<h3 class="fn" id="setRed"><a name="setRed"></a><span class="type">void</span> QColor::<span class="name">setRed</span>(<span class="type">int</span> <i>red</i>)</h3>
<p>Sets the red color component of this color to <i>red</i>. Integer components are specified in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#red">red</a>(), <a href="qcolor.html#redF">redF</a>(), and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@setRed -->
<!-- $$$setRedF[overload1]$$$setRedFqreal -->
<h3 class="fn" id="setRedF"><a name="setRedF"></a><span class="type">void</span> QColor::<span class="name">setRedF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>red</i>)</h3>
<p>Sets the red color component of this color to <i>red</i>. Float components are specified in the range 0.0-1.0&#x2e;</p>
<p><b>See also </b><a href="qcolor.html#redF">redF</a>(), <a href="qcolor.html#red">red</a>(), and <a href="qcolor.html#setRgbF">setRgbF</a>().</p>
<!-- @@@setRedF -->
<!-- $$$setRgb[overload1]$$$setRgbintintintint -->
<h3 class="fn" id="setRgb"><a name="setRgb"></a><span class="type">void</span> QColor::<span class="name">setRgb</span>(<span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i>, <span class="type">int</span> <i>a</i> = 255)</h3>
<p>Sets the RGB value to <i>r</i>, <i>g</i>, <i>b</i> and the alpha value to <i>a</i>.</p>
<p>All the values must be in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#rgb">rgb</a>(), <a href="qcolor.html#getRgb">getRgb</a>(), and <a href="qcolor.html#setRgbF">setRgbF</a>().</p>
<!-- @@@setRgb -->
<!-- $$$setRgb$$$setRgbQRgb -->
<h3 class="fn" id="setRgb-1"><a name="setRgb-1"></a><span class="type">void</span> QColor::<span class="name">setRgb</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i>)</h3>
<p>This is an overloaded function.</p>
<p>Sets the RGB value to <i>rgb</i>. The alpha value is set to opaque.</p>
<!-- @@@setRgb -->
<!-- $$$setRgba64[overload1]$$$setRgba64QRgba64 -->
<h3 class="fn" id="setRgba64"><a name="setRgba64"></a><span class="type">void</span> QColor::<span class="name">setRgba64</span>(<span class="type"><a href="qrgba64.html">QRgba64</a></span> <i>rgba</i>)</h3>
<p>Sets the RGB64 value to <i>rgba</i>, including its alpha.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qcolor.html#setRgba">setRgba</a>() and <a href="qcolor.html#rgba64">rgba64</a>().</p>
<!-- @@@setRgba64 -->
<!-- $$$setRgbF[overload1]$$$setRgbFqrealqrealqrealqreal -->
<h3 class="fn" id="setRgbF"><a name="setRgbF"></a><span class="type">void</span> QColor::<span class="name">setRgbF</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>r</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>g</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>b</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0)</h3>
<p>Sets the color channels of this color to <i>r</i> (red), <i>g</i> (green), <i>b</i> (blue) and <i>a</i> (alpha, transparency).</p>
<p>All values must be in the range 0.0-1.0&#x2e;</p>
<p><b>See also </b><a href="qcolor.html#rgb">rgb</a>(), <a href="qcolor.html#getRgbF">getRgbF</a>(), and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@setRgbF -->
<!-- $$$setRgba[overload1]$$$setRgbaQRgb -->
<h3 class="fn" id="setRgba"><a name="setRgba"></a><span class="type">void</span> QColor::<span class="name">setRgba</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgba</i>)</h3>
<p>Sets the RGB value to <i>rgba</i>, including its alpha.</p>
<p><b>See also </b><a href="qcolor.html#rgba">rgba</a>(), <a href="qcolor.html#rgb">rgb</a>(), and <a href="qcolor.html#setRgba64">setRgba64</a>().</p>
<!-- @@@setRgba -->
<!-- $$$spec[overload1]$$$spec -->
<h3 class="fn" id="spec"><a name="spec"></a><span class="type"><a href="qcolor.html#Spec-enum">Spec</a></span> QColor::<span class="name">spec</span>() const</h3>
<p>Returns how the color was specified.</p>
<p><b>See also </b><a href="qcolor.html#Spec-enum">Spec</a> and <a href="qcolor.html#convertTo">convertTo</a>().</p>
<!-- @@@spec -->
<!-- $$$toCmyk[overload1]$$$toCmyk -->
<h3 class="fn" id="toCmyk"><a name="toCmyk"></a><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">toCmyk</span>() const</h3>
<p>Creates and returns a CMYK <a href="qcolor.html">QColor</a> based on this color.</p>
<p><b>See also </b><a href="qcolor.html#fromCmyk">fromCmyk</a>(), <a href="qcolor.html#convertTo">convertTo</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@toCmyk -->
<!-- $$$toHsl[overload1]$$$toHsl -->
<h3 class="fn" id="toHsl"><a name="toHsl"></a><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">toHsl</span>() const</h3>
<p>Creates and returns an HSL <a href="qcolor.html">QColor</a> based on this color.</p>
<p><b>See also </b><a href="qcolor.html#fromHsl">fromHsl</a>(), <a href="qcolor.html#convertTo">convertTo</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@toHsl -->
<!-- $$$toHsv[overload1]$$$toHsv -->
<h3 class="fn" id="toHsv"><a name="toHsv"></a><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">toHsv</span>() const</h3>
<p>Creates and returns an HSV <a href="qcolor.html">QColor</a> based on this color.</p>
<p><b>See also </b><a href="qcolor.html#fromHsv">fromHsv</a>(), <a href="qcolor.html#convertTo">convertTo</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@toHsv -->
<!-- $$$toRgb[overload1]$$$toRgb -->
<h3 class="fn" id="toRgb"><a name="toRgb"></a><span class="type"><a href="qcolor.html#QColor">QColor</a></span> QColor::<span class="name">toRgb</span>() const</h3>
<p>Create and returns an RGB <a href="qcolor.html">QColor</a> based on this color.</p>
<p><b>See also </b><a href="qcolor.html#fromRgb">fromRgb</a>(), <a href="qcolor.html#convertTo">convertTo</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@toRgb -->
<!-- $$$value[overload1]$$$value -->
<h3 class="fn" id="value"><a name="value"></a><span class="type">int</span> QColor::<span class="name">value</span>() const</h3>
<p>Returns the value color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#valueF">valueF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@value -->
<!-- $$$valueF[overload1]$$$valueF -->
<h3 class="fn" id="valueF"><a name="valueF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">valueF</span>() const</h3>
<p>Returns the value color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#value">value</a>(), <a href="qcolor.html#getHsvF">getHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@valueF -->
<!-- $$$yellow[overload1]$$$yellow -->
<h3 class="fn" id="yellow"><a name="yellow"></a><span class="type">int</span> QColor::<span class="name">yellow</span>() const</h3>
<p>Returns the yellow color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#yellowF">yellowF</a>(), <a href="qcolor.html#getCmyk">getCmyk</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@yellow -->
<!-- $$$yellowF[overload1]$$$yellowF -->
<h3 class="fn" id="yellowF"><a name="yellowF"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">yellowF</span>() const</h3>
<p>Returns the yellow color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#yellow">yellow</a>(), <a href="qcolor.html#getCmykF">getCmykF</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@yellowF -->
<!-- $$$operator QVariant[overload1]$$$operator QVariant -->
<h3 class="fn" id="operator-QVariant"><a name="operator-QVariant"></a>QColor::<span class="name">operator QVariant</span>() const</h3>
<p>Returns the color as a <a href="../qtcore/qvariant.html">QVariant</a></p>
<!-- @@@operator QVariant -->
<!-- $$$operator!=[overload1]$$$operator!=constQColor& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QColor::<span class="name">operator!=</span>(const <span class="type"><a href="qcolor.html#QColor">QColor</a></span> &amp;<i>color</i>) const</h3>
<p>Returns <code>true</code> if this color has a different RGB and alpha values from <i>color</i>; otherwise returns <code>false</code>.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=QColor&& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qcolor.html#QColor">QColor</a></span> &amp;QColor::<span class="name">operator=</span>(<span class="type"><a href="qcolor.html#QColor">QColor</a></span> &amp;&amp;<i>other</i>)</h3>
<p>Move-assignment operator.</p><!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQColor& -->
<h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qcolor.html#QColor">QColor</a></span> &amp;QColor::<span class="name">operator=</span>(const <span class="type"><a href="qcolor.html#QColor">QColor</a></span> &amp;<i>color</i>)</h3>
<p>Assigns a copy of <i>color</i> to this color, and returns a reference to it.</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=Qt::GlobalColor -->
<h3 class="fn" id="operator-eq-2"><a name="operator-eq-2"></a><span class="type"><a href="qcolor.html#QColor">QColor</a></span> &amp;QColor::<span class="name">operator=</span>(<span class="type"><a href="../qtcore/qt.html#GlobalColor-enum">Qt::GlobalColor</a></span> <i>color</i>)</h3>
<p>This is an overloaded function.</p>
<p>Assigns a copy of <i>color</i> and returns a reference to this color.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQColor& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QColor::<span class="name">operator==</span>(const <span class="type"><a href="qcolor.html#QColor">QColor</a></span> &amp;<i>color</i>) const</h3>
<p>Returns <code>true</code> if this color has the same RGB and alpha values as <i>color</i>; otherwise returns <code>false</code>.</p>
<!-- @@@operator== -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$QRgb -->
<h3 class="fn" id="QRgb-typedef"><a name="QRgb-typedef"></a>typedef <span class="name">QRgb</span></h3>
<p>An ARGB quadruplet on the format #AARRGGBB, equivalent to an unsigned int.</p>
<p>The type also holds a value for the alpha-channel. The default alpha channel is <code>ff</code>, i.e opaque. For more information, see the <a href="qcolor.html#alpha-blended-drawing">Alpha-Blended Drawing</a> section.</p>
<p><b>See also </b><a href="qcolor.html#rgb">QColor::rgb</a>() and <a href="qcolor.html#rgba">QColor::rgba</a>().</p>
<!-- @@@QRgb -->
<!-- $$$qAlpha[overload1]$$$qAlphaQRgb -->
<h3 class="fn" id="qAlpha"><a name="qAlpha"></a><span class="type">int</span> <span class="name">qAlpha</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgba</i>)</h3>
<p>Returns the alpha component of the ARGB quadruplet <i>rgba</i>.</p>
<p><b>See also </b><a href="qcolor.html#qRgb">qRgb</a>() and <a href="qcolor.html#alpha">QColor::alpha</a>().</p>
<!-- @@@qAlpha -->
<!-- $$$qAlpha$$$qAlphaQRgba64 -->
<h3 class="fn" id="qAlpha-1"><a name="qAlpha-1"></a><span class="type"><a href="../qtcore/qtglobal.html#uint-typedef">uint</a></span> <span class="name">qAlpha</span>(<span class="type"><a href="qrgba64.html">QRgba64</a></span> <i>rgba64</i>)</h3>
<p>Returns the alpha component of <i>rgba64</i> as an 8-bit value.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qrgba64.html#alpha8">QRgba64::alpha8</a>() and <a href="qcolor.html#alpha">QColor::alpha</a>().</p>
<!-- @@@qAlpha -->
<!-- $$$qBlue[overload1]$$$qBlueQRgb -->
<h3 class="fn" id="qBlue"><a name="qBlue"></a><span class="type">int</span> <span class="name">qBlue</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i>)</h3>
<p>Returns the blue component of the ARGB quadruplet <i>rgb</i>.</p>
<p><b>See also </b><a href="qcolor.html#qRgb">qRgb</a>() and <a href="qcolor.html#blue">QColor::blue</a>().</p>
<!-- @@@qBlue -->
<!-- $$$qBlue$$$qBlueQRgba64 -->
<h3 class="fn" id="qBlue-1"><a name="qBlue-1"></a><span class="type"><a href="../qtcore/qtglobal.html#uint-typedef">uint</a></span> <span class="name">qBlue</span>(<span class="type"><a href="qrgba64.html">QRgba64</a></span> <i>rgba64</i>)</h3>
<p>Returns the blue component of <i>rgba64</i> as an 8-bit value.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qrgba64.html#blue8">QRgba64::blue8</a>() and <a href="qcolor.html#blue">QColor::blue</a>().</p>
<!-- @@@qBlue -->
<!-- $$$qGray[overload1]$$$qGrayintintint -->
<h3 class="fn" id="qGray"><a name="qGray"></a><span class="type">int</span> <span class="name">qGray</span>(<span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i>)</h3>
<p>Returns a gray value (0 to 255) from the (<i>r</i>, <i>g</i>, <i>b</i>) triplet.</p>
<p>The gray value is calculated using the formula (<i>r</i> * 11 + <i>g</i> * 16 + <i>b</i> * 5)/32.</p>
<!-- @@@qGray -->
<!-- $$$qGray$$$qGrayQRgb -->
<h3 class="fn" id="qGray-1"><a name="qGray-1"></a><span class="type">int</span> <span class="name">qGray</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i>)</h3>
<p>This is an overloaded function.</p>
<p>Returns a gray value (0 to 255) from the given ARGB quadruplet <i>rgb</i>.</p>
<p>The gray value is calculated using the formula (R * 11 + G * 16 + B * 5)/32; the alpha-channel is ignored.</p>
<!-- @@@qGray -->
<!-- $$$qGreen[overload1]$$$qGreenQRgb -->
<h3 class="fn" id="qGreen"><a name="qGreen"></a><span class="type">int</span> <span class="name">qGreen</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i>)</h3>
<p>Returns the green component of the ARGB quadruplet <i>rgb</i>.</p>
<p><b>See also </b><a href="qcolor.html#qRgb">qRgb</a>() and <a href="qcolor.html#green">QColor::green</a>().</p>
<!-- @@@qGreen -->
<!-- $$$qGreen$$$qGreenQRgba64 -->
<h3 class="fn" id="qGreen-1"><a name="qGreen-1"></a><span class="type"><a href="../qtcore/qtglobal.html#uint-typedef">uint</a></span> <span class="name">qGreen</span>(<span class="type"><a href="qrgba64.html">QRgba64</a></span> <i>rgba64</i>)</h3>
<p>Returns the green component of <i>rgba64</i> as an 8-bit value.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qrgba64.html#green8">QRgba64::green8</a>() and <a href="qcolor.html#green">QColor::green</a>().</p>
<!-- @@@qGreen -->
<!-- $$$qPremultiply[overload1]$$$qPremultiplyQRgb -->
<h3 class="fn" id="qPremultiply"><a name="qPremultiply"></a><span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <span class="name">qPremultiply</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i>)</h3>
<p>Converts an unpremultiplied ARGB quadruplet <i>rgb</i> into a premultiplied ARGB quadruplet.</p>
<p>This function was introduced in  Qt 5.3.</p>
<p><b>See also </b><a href="qcolor.html#qUnpremultiply">qUnpremultiply</a>().</p>
<!-- @@@qPremultiply -->
<!-- $$$qPremultiply$$$qPremultiplyQRgba64 -->
<h3 class="fn" id="qPremultiply-1"><a name="qPremultiply-1"></a><span class="type"><a href="qrgba64.html">QRgba64</a></span> <span class="name">qPremultiply</span>(<span class="type"><a href="qrgba64.html">QRgba64</a></span> <i>rgba64</i>)</h3>
<p>Converts an unpremultiplied <a href="qrgba64.html">QRgba64</a> quadruplet <i>rgba64</i> into a premultiplied <a href="qrgba64.html">QRgba64</a> quadruplet.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qrgba64.html#premultiplied">QRgba64::premultiplied</a>() and <a href="qcolor.html#qUnpremultiply">qUnpremultiply</a>().</p>
<!-- @@@qPremultiply -->
<!-- $$$qRed[overload1]$$$qRedQRgb -->
<h3 class="fn" id="qRed"><a name="qRed"></a><span class="type">int</span> <span class="name">qRed</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i>)</h3>
<p>Returns the red component of the ARGB quadruplet <i>rgb</i>.</p>
<p><b>See also </b><a href="qcolor.html#qRgb">qRgb</a>() and <a href="qcolor.html#red">QColor::red</a>().</p>
<!-- @@@qRed -->
<!-- $$$qRed$$$qRedQRgba64 -->
<h3 class="fn" id="qRed-1"><a name="qRed-1"></a><span class="type"><a href="../qtcore/qtglobal.html#uint-typedef">uint</a></span> <span class="name">qRed</span>(<span class="type"><a href="qrgba64.html">QRgba64</a></span> <i>rgba64</i>)</h3>
<p>Returns the red component of <i>rgba64</i> as an 8-bit value.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qrgba64.html#red8">QRgba64::red8</a>() and <a href="qcolor.html#red">QColor::red</a>().</p>
<!-- @@@qRed -->
<!-- $$$qRgb[overload1]$$$qRgbintintint -->
<h3 class="fn" id="qRgb"><a name="qRgb"></a><span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <span class="name">qRgb</span>(<span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i>)</h3>
<p>Returns the ARGB quadruplet (255, <i>r</i>, <i>g</i>, <i>b</i>).</p>
<p><b>See also </b><a href="qcolor.html#qRgba">qRgba</a>(), <a href="qcolor.html#qRed">qRed</a>(), <a href="qcolor.html#qGreen">qGreen</a>(), and <a href="qcolor.html#qBlue">qBlue</a>().</p>
<!-- @@@qRgb -->
<!-- $$$qRgba64[overload1]$$$qRgba64quint16quint16quint16quint16 -->
<h3 class="fn" id="qRgba64"><a name="qRgba64"></a><span class="type"><a href="qrgba64.html">QRgba64</a></span> <span class="name">qRgba64</span>(<span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> <i>r</i>, <span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> <i>g</i>, <span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> <i>b</i>, <span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> <i>a</i>)</h3>
<p>Returns the <a href="qrgba64.html">QRgba64</a> quadruplet (<i>r</i>, <i>g</i>, <i>b</i>, <i>a</i>).</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qcolor.html#qRgba">qRgba</a>().</p>
<!-- @@@qRgba64 -->
<!-- $$$qRgba64$$$qRgba64quint64 -->
<h3 class="fn" id="qRgba64-1"><a name="qRgba64-1"></a><span class="type"><a href="qrgba64.html">QRgba64</a></span> <span class="name">qRgba64</span>(<span class="type"><a href="../qtcore/qtglobal.html#quint64-typedef">quint64</a></span> <i>c</i>)</h3>
<p>Returns <i>c</i> as a <a href="qrgba64.html">QRgba64</a> struct.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qcolor.html#qRgba">qRgba</a>().</p>
<!-- @@@qRgba64 -->
<!-- $$$qRgba[overload1]$$$qRgbaintintintint -->
<h3 class="fn" id="qRgba"><a name="qRgba"></a><span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <span class="name">qRgba</span>(<span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i>, <span class="type">int</span> <i>a</i>)</h3>
<p>Returns the ARGB quadruplet (<i>a</i>, <i>r</i>, <i>g</i>, <i>b</i>).</p>
<p><b>See also </b><a href="qcolor.html#qRgb">qRgb</a>(), <a href="qcolor.html#qRed">qRed</a>(), <a href="qcolor.html#qGreen">qGreen</a>(), and <a href="qcolor.html#qBlue">qBlue</a>().</p>
<!-- @@@qRgba -->
<!-- $$$qUnpremultiply[overload1]$$$qUnpremultiplyQRgb -->
<h3 class="fn" id="qUnpremultiply"><a name="qUnpremultiply"></a><span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <span class="name">qUnpremultiply</span>(<span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i>)</h3>
<p>Converts a premultiplied ARGB quadruplet <i>rgb</i> into an unpremultiplied ARGB quadruplet.</p>
<p>This function was introduced in  Qt 5.3.</p>
<p><b>See also </b><a href="qcolor.html#qPremultiply">qPremultiply</a>().</p>
<!-- @@@qUnpremultiply -->
<!-- $$$qUnpremultiply$$$qUnpremultiplyQRgba64 -->
<h3 class="fn" id="qUnpremultiply-1"><a name="qUnpremultiply-1"></a><span class="type"><a href="qrgba64.html">QRgba64</a></span> <span class="name">qUnpremultiply</span>(<span class="type"><a href="qrgba64.html">QRgba64</a></span> <i>rgba64</i>)</h3>
<p>Converts a premultiplied <a href="qrgba64.html">QRgba64</a> quadruplet <i>rgba64</i> into an unpremultiplied <a href="qrgba64.html">QRgba64</a> quadruplet.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qrgba64.html#unpremultiplied">QRgba64::unpremultiplied</a>() and <a href="qcolor.html#qPremultiply">qPremultiply</a>().</p>
<!-- @@@qUnpremultiply -->
<!-- $$$operator<<[overload1]$$$operator<<QDataStream&constQColor& -->
<h3 class="fn" id="operator-lt-lt"><a name="operator-lt-lt"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<span class="name">operator&lt;&lt;</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>stream</i>, const <span class="type"><a href="qcolor.html#QColor">QColor</a></span> &amp;<i>color</i>)</h3>
<p>Writes the <i>color</i> to the <i>stream</i>.</p>
<p><b>See also </b><a href="../qtcore/datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>[overload1]$$$operator>>QDataStream&QColor& -->
<h3 class="fn" id="operator-gt-gt"><a name="operator-gt-gt"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<span class="name">operator&gt;&gt;</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>stream</i>, <span class="type"><a href="qcolor.html#QColor">QColor</a></span> &amp;<i>color</i>)</h3>
<p>Reads the <i>color</i> from the <i>stream</i>.</p>
<p><b>See also </b><a href="../qtcore/datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator>> -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>