43 #include <QtGui/qtguiglobal.h>
44 #include <QtGui/qrgb.h>
45 #include <QtCore/qnamespace.h>
46 #include <QtCore/qstringlist.h>
47 #include <QtGui/qrgba64.h>
58 #ifndef QT_NO_DEBUG_STREAM
61 #ifndef QT_NO_DATASTREAM
75 : cspec(
Invalid), ct(USHRT_MAX, 0, 0, 0, 0) {}
77 constexpr
QColor(
int r,
int g,
int b,
int a = 255) noexcept
90 QColor(Spec spec) noexcept;
94 bool isValid()
const noexcept;
108 void setAlpha(
int alpha);
110 float alphaF()
const noexcept;
111 void setAlphaF(
float alpha);
116 void setRed(
int red);
117 void setGreen(
int green);
118 void setBlue(
int blue);
120 float redF()
const noexcept;
121 float greenF()
const noexcept;
122 float blueF()
const noexcept;
123 void setRedF(
float red);
124 void setGreenF(
float green);
125 void setBlueF(
float blue);
127 void getRgb(
int *
r,
int *
g,
int *
b,
int *
a =
nullptr)
const;
128 void setRgb(
int r,
int g,
int b,
int a = 255);
130 void getRgbF(
float *
r,
float *
g,
float *
b,
float *
a =
nullptr)
const;
131 void setRgbF(
float r,
float g,
float b,
float a = 1.0);
134 void setRgba64(
QRgba64 rgba) noexcept;
137 void setRgba(
QRgb rgba) noexcept;
140 void setRgb(
QRgb rgb) noexcept;
142 int hue()
const noexcept;
143 int saturation()
const noexcept;
144 int hsvHue()
const noexcept;
145 int hsvSaturation()
const noexcept;
148 float hueF()
const noexcept;
149 float saturationF()
const noexcept;
150 float hsvHueF()
const noexcept;
151 float hsvSaturationF()
const noexcept;
152 float valueF()
const noexcept;
154 void getHsv(
int *
h,
int *
s,
int *
v,
int *
a =
nullptr)
const;
155 void setHsv(
int h,
int s,
int v,
int a = 255);
157 void getHsvF(
float *
h,
float *
s,
float *
v,
float *
a =
nullptr)
const;
158 void setHsvF(
float h,
float s,
float v,
float a = 1.0);
165 float cyanF()
const noexcept;
166 float magentaF()
const noexcept;
167 float yellowF()
const noexcept;
168 float blackF()
const noexcept;
170 void getCmyk(
int *
c,
int *
m,
int *
y,
int *k,
int *
a =
nullptr)
const;
171 void setCmyk(
int c,
int m,
int y,
int k,
int a = 255);
173 void getCmykF(
float *
c,
float *
m,
float *
y,
float *k,
float *
a =
nullptr)
const;
174 void setCmykF(
float c,
float m,
float y,
float k,
float a = 1.0);
176 int hslHue()
const noexcept;
177 int hslSaturation()
const noexcept;
178 int lightness()
const noexcept;
180 float hslHueF()
const noexcept;
181 float hslSaturationF()
const noexcept;
182 float lightnessF()
const noexcept;
184 void getHsl(
int *
h,
int *
s,
int *
l,
int *
a =
nullptr)
const;
185 void setHsl(
int h,
int s,
int l,
int a = 255);
187 void getHslF(
float *
h,
float *
s,
float *
l,
float *
a =
nullptr)
const;
188 void setHslF(
float h,
float s,
float l,
float a = 1.0);
196 [[nodiscard]]
QColor convertTo(Spec colorSpec)
const noexcept;
201 static
QColor fromRgb(
int r,
int g,
int b,
int a = 255);
202 static
QColor fromRgbF(
float r,
float g,
float b,
float a = 1.0);
207 static
QColor fromHsv(
int h,
int s,
int v,
int a = 255);
208 static
QColor fromHsvF(
float h,
float s,
float v,
float a = 1.0);
210 static
QColor fromCmyk(
int c,
int m,
int y,
int k,
int a = 255);
211 static
QColor fromCmykF(
float c,
float m,
float y,
float k,
float a = 1.0);
213 static
QColor fromHsl(
int h,
int s,
int l,
int a = 255);
214 static
QColor fromHslF(
float h,
float s,
float l,
float a = 1.0);
216 [[nodiscard]]
QColor lighter(
int f = 150)
const noexcept;
217 [[nodiscard]]
QColor darker(
int f = 200)
const noexcept;
230 void invalidate() noexcept;
231 template <typename String>
232 bool setColorFromString(String
name);
241 #ifdef Q_COMPILER_UNIFORM_INIT
285 #ifndef QT_NO_DATASTREAM
290 #ifdef Q_COMPILER_UNIFORM_INIT
293 : cspec(spec), ct(
a1,
a2,
a3, a4, a5) {}
The QColor class provides colors based on RGB, HSV or CMYK values.
constexpr QColor() noexcept
QColor(const char *aname)
constexpr QColor(int r, int g, int b, int a=255) noexcept
bool isValid() const noexcept
void setNamedColor(const QString &name)
The QDataStream class provides serialization of binary data to a QIODevice.
operator>>(QDataStream &ds, qfloat16 &f)
operator<<(QDataStream &ds, qfloat16 f)
The QDebug class provides an output stream for debugging information.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
The QString class provides a Unicode character string.
The QStringList class provides a list of strings.
The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QStrin...
The QVariant class acts like a union for the most common Qt data types.
auto it unsigned count const
constexpr QColor saddlebrown
constexpr QColor firebrick
constexpr QColor darkorange
constexpr QColor lightslategrey
constexpr QColor lightslategray
constexpr QColor forestgreen
constexpr QColor antiquewhite
constexpr QColor sandybrown
constexpr QColor orangered
constexpr QColor darkgray
constexpr QColor darkturquoise
constexpr QColor mediumslateblue
constexpr QColor lightskyblue
constexpr QColor lawngreen
constexpr QColor mediumvioletred
constexpr QColor dodgerblue
constexpr QColor lightgrey
constexpr QColor deepskyblue
constexpr QColor palegoldenrod
constexpr QColor mediumspringgreen
constexpr QColor mediumorchid
constexpr QColor lightcyan
constexpr QColor mediumaquamarine
constexpr QColor darkcyan
constexpr QColor lightgray
constexpr QColor darkslateblue
constexpr QColor lightgreen
constexpr QColor steelblue
constexpr QColor gainsboro
constexpr QColor midnightblue
constexpr QColor palevioletred
constexpr QColor rosybrown
constexpr QColor lightpink
constexpr QColor royalblue
constexpr QColor darkgoldenrod
constexpr QColor slategray
constexpr QColor cornflowerblue
constexpr QColor blanchedalmond
constexpr QColor darkslategray
constexpr QColor mediumblue
constexpr QColor limegreen
constexpr QColor aquamarine
constexpr QColor paleturquoise
constexpr QColor mintcream
constexpr QColor darkblue
constexpr QColor mediumpurple
constexpr QColor cornsilk
constexpr QColor lightsalmon
constexpr QColor greenyellow
constexpr QColor darkmagenta
constexpr QColor yellowgreen
constexpr QColor navajowhite
constexpr QColor slategrey
constexpr QColor powderblue
constexpr QColor lemonchiffon
constexpr QColor whitesmoke
constexpr QColor mistyrose
constexpr QColor aliceblue
constexpr QColor peachpuff
constexpr QColor seagreen
constexpr QColor darkslategrey
constexpr QColor deeppink
constexpr QColor darkolivegreen
constexpr QColor slateblue
constexpr QColor honeydew
constexpr QColor papayawhip
constexpr QColor darkkhaki
constexpr QColor ghostwhite
constexpr QColor cadetblue
constexpr QColor lavenderblush
constexpr QColor turquoise
constexpr QColor darkorchid
constexpr QColor moccasin
constexpr QColor lightblue
constexpr QColor floralwhite
constexpr QColor lightsteelblue
constexpr QColor mediumseagreen
constexpr QColor lightcoral
constexpr QColor blueviolet
constexpr QColor darkgrey
constexpr QColor lightyellow
constexpr QColor indianred
constexpr QColor olivedrab
constexpr QColor darksalmon
constexpr QColor lightseagreen
constexpr QColor lavender
constexpr QColor mediumturquoise
constexpr QColor chocolate
constexpr QColor lightgoldenrodyellow
constexpr QColor chartreuse
constexpr QColor palegreen
constexpr QColor darkviolet
constexpr QColor darkgreen
constexpr QColor burlywood
constexpr QColor goldenrod
constexpr QColor springgreen
constexpr QColor seashell
constexpr QColor darkseagreen
The QColorConstants namespace contains QColor predefined constants.
constexpr QColor DarkYellow
constexpr QColor DarkGreen
constexpr QColor DarkGray
constexpr QColor DarkBlue
constexpr QColor LightGray
constexpr QColor DarkMagenta
constexpr QColor DarkCyan
constexpr QColor Transparent
png_structrp int png_fixed_point red
Q_GUI_EXPORT QDebug operator<<(QDebug, const QColor &)
Q_DECLARE_TYPEINFO(QColor, Q_RELOCATABLE_TYPE)
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QColor &)
#define Q_DECL_CONST_FUNCTION
EGLOutputLayerEXT EGLint EGLAttrib value
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
GLfloat GLfloat GLfloat alpha
QT_BEGIN_NAMESPACE typedef unsigned int QRgb