45 #include <QtGui/qrgb.h> 46 #include <QtCore/qnamespace.h> 47 #include <QtCore/qstringlist.h> 59 #ifndef QT_NO_DEBUG_STREAM 62 #ifndef QT_NO_DATASTREAM 74 QColor(
int r,
int g,
int b,
int a = 255);
84 void setNamedColor(
const QString& name);
92 void setAlpha(
int alpha);
95 void setAlphaF(
qreal alpha);
100 void setRed(
int red);
101 void setGreen(
int green);
102 void setBlue(
int blue);
105 qreal greenF()
const;
107 void setRedF(
qreal red);
108 void setGreenF(
qreal green);
109 void setBlueF(
qreal blue);
111 void getRgb(
int *r,
int *g,
int *b,
int *
a = 0)
const;
112 void setRgb(
int r,
int g,
int b,
int a = 255);
118 void setRgba(
QRgb rgba);
121 void setRgb(
QRgb rgb);
124 int saturation()
const;
126 int hsvSaturation()
const;
130 qreal saturationF()
const;
131 qreal hsvHueF()
const;
132 qreal hsvSaturationF()
const;
133 qreal valueF()
const;
135 void getHsv(
int *h,
int *s,
int *v,
int *
a = 0)
const;
136 void setHsv(
int h,
int s,
int v,
int a = 255);
147 qreal magentaF()
const;
148 qreal yellowF()
const;
149 qreal blackF()
const;
151 void getCmyk(
int *
c,
int *m,
int *y,
int *k,
int *
a = 0);
152 void setCmyk(
int c,
int m,
int y,
int k,
int a = 255);
158 int hslSaturation()
const;
159 int lightness()
const;
161 qreal hslHueF()
const;
162 qreal hslSaturationF()
const;
163 qreal lightnessF()
const;
165 void getHsl(
int *h,
int *s,
int *
l,
int *
a = 0)
const;
166 void setHsl(
int h,
int s,
int l,
int a = 255);
181 static QColor fromRgb(
int r,
int g,
int b,
int a = 255);
184 static QColor fromHsv(
int h,
int s,
int v,
int a = 255);
187 static QColor fromCmyk(
int c,
int m,
int y,
int k,
int a = 255);
190 static QColor fromHsl(
int h,
int s,
int l,
int a = 255);
193 QColor light(
int f = 150)
const;
194 QColor lighter(
int f = 150)
const;
195 QColor dark(
int f = 200)
const;
196 QColor darker(
int f = 200)
const;
208 static void setAllowX11ColorNames(
bool enabled);
212 inline QT3_SUPPORT_CONSTRUCTOR
QColor(
int x,
int y,
int z,
Spec colorSpec)
213 {
if (colorSpec == Hsv) setHsv(x, y, z);
else setRgb(x, y, z); }
215 inline QT3_SUPPORT
void rgb(
int *r,
int *g,
int *b)
const 217 inline QT3_SUPPORT
void hsv(
int *h,
int *s,
int *v)
const 220 inline QT3_SUPPORT
void setRgba(
int r,
int g,
int b,
int a)
221 { setRgb(r, g, b, a); }
222 inline QT3_SUPPORT
void getRgba(
int *r,
int *g,
int *b,
int *a)
const 223 { getRgb(r, g, b, a); }
225 QT3_SUPPORT
uint pixel(
int screen = -1)
const;
228 static bool isValidColor(
const QString &name);
237 bool setColorFromString(
const QString &name);
273 #ifndef QT_NO_DATASTREAM 283 { setRgb(r, g, b, a); }
289 { setNamedColor(aname); }
292 : cspec(acolor.cspec)
The QVariant class acts like a union for the most common Qt data types.
The QDebug class provides an output stream for debugging information.
The QColor class provides colors based on RGB, HSV or CMYK values.
#define QT_END_NAMESPACE
This macro expands to.
ushort hue
Returns the hue color component of this color.
Spec
The type of color specified, either RGB, HSV, CMYK or HSL.
ushort lightness
Returns the lightness color component of this color.
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QColor &)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
long ASN1_INTEGER_get ASN1_INTEGER * a
struct QColor::@220::@221 argb
bool operator!=(QBool b1, bool b2)
ushort red
Returns the red color component of this color.
The QString class provides a Unicode character string.
ushort yellow
Returns the yellow color component of this color.
ushort magenta
Returns the magenta color component of this color.
QColor darker(int f=200) const
Returns a darker (or lighter) color, but does not change this object.
#define QT_BEGIN_NAMESPACE
This macro expands to.
ushort value
Returns the value color component of this color.
ushort saturation
Returns the saturation color component of this color.
QColor dark(int f=200) const
Use darker(factor) instead.
The QStringList class provides a list of strings.
ushort blue
Returns the blue color component of this color.
ushort alpha
Returns the alpha color component of this color.
static bool allowX11ColorNames
Q_GUI_EXPORT QDebug operator<<(QDebug, const QColor &)
ushort black
Returns the black color component of this color.
QColor()
Constructs an invalid color with the RGB value (0, 0, 0).
The QDataStream class provides serialization of binary data to a QIODevice.
bool isValid() const
Returns true if the color is valid; otherwise returns false.
QColor lighter(int f=150) const
Returns a lighter (or darker) color, but does not change this object.
ushort cyan
Returns the cyan color component of this color.
QDataStream & operator<<(QDataStream &out, const QUrl &url)
Writes url url to the stream out and returns a reference to the stream.
ushort green
Returns the green color component of this color.
bool operator==(QBool b1, bool b2)
QColor light(int f=150) const
Use lighter(factor) instead.
Spec spec() const
Returns how the color was specified.
QDataStream & operator>>(QDataStream &in, QUrl &url)
Reads a url into url from the stream in and returns a reference to the stream.