# QColor Class Reference

### [com.trolltech.qt.gui package]

### Constructor

- void QColor()
- void QColor(GlobalColor color)
- void QColor(QColor color)
- void QColor(String name)
- void QColor(int r, int g, int b, int a)
- void QColor(unsigned int rgb)

### Constructor Properties

- prototype: The QColor prototype object
- List colorNames()
- QColor fromCmyk(int c, int m, int y, int k, int a)
- QColor fromCmykF(qreal c, qreal m, qreal y, qreal k, qreal a)
- QColor fromHsl(int h, int s, int l, int a)
- QColor fromHslF(qreal h, qreal s, qreal l, qreal a)
- QColor fromHsv(int h, int s, int v, int a)
- QColor fromHsvF(qreal h, qreal s, qreal v, qreal a)
- QColor fromRgb(int r, int g, int b, int a)
- QColor fromRgbF(qreal r, qreal g, qreal b, qreal a)
- QColor fromRgba(unsigned int rgba)
- bool isValidColor(String name)
- Invalid
- Rgb
- Hsv
- Cmyk
- Hsl
- Spec( value )

### Prototype Object Properties

- int alpha()
- qreal alphaF()
- int black()
- qreal blackF()
- int blue()
- qreal blueF()
- QColor convertTo(Spec colorSpec)
- int cyan()
- qreal cyanF()
- QColor darker(int f)
- void getHsl(int h, int s, int l, int a)
- void getHslF(qreal h, qreal s, qreal l, qreal a)
- int green()
- qreal greenF()
- int hslHue()
- qreal hslHueF()
- int hslSaturation()
- qreal hslSaturationF()
- int hsvHue()
- qreal hsvHueF()
- int hsvSaturation()
- qreal hsvSaturationF()
- int hue()
- qreal hueF()
- bool isValid()
- QColor lighter(int f)
- int lightness()
- qreal lightnessF()
- int magenta()
- qreal magentaF()
- String name()
- bool operator_equal(QColor c)
- void readFrom(QDataStream arg__1)
- int red()
- qreal redF()
- unsigned int rgb()
- unsigned int rgba()
- int saturation()
- qreal saturationF()
- void setAlpha(int alpha)
- void setAlphaF(qreal alpha)
- void setBlue(int blue)
- void setBlueF(qreal blue)
- void setCmyk(int c, int m, int y, int k, int a)
- void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a)
- void setGreen(int green)
- void setGreenF(qreal green)
- void setHsl(int h, int s, int l, int a)
- void setHslF(qreal h, qreal s, qreal l, qreal a)
- void setHsv(int h, int s, int v, int a)
- void setHsvF(qreal h, qreal s, qreal v, qreal a)
- void setNamedColor(String name)
- void setRed(int red)
- void setRedF(qreal red)
- void setRgb(int r, int g, int b, int a)
- void setRgbF(qreal r, qreal g, qreal b, qreal a)
- void setRgba(unsigned int rgba)
- Spec spec()
- QColor toCmyk()
- QColor toHsl()
- QColor toHsv()
- QColor toRgb()
- int value()
- qreal valueF()
- void writeTo(QDataStream arg__1)
- int yellow()
- qreal yellowF()

### Instance Properties

QColor objects have no special properties beyond those inherited from the QColor prototype object.