Skip to content

PythonQt.QtGui.QColor · declarations 002

Back to PythonQt.QtGui.QColor

hsvSaturation

hsvSaturation() -> int

X.hsvSaturation() -> int

Supplemental documentation: Qt 5 reference:

int QColor::hsvSaturation() const

Returns the HSV saturation color component of this color.

See also saturationF(), hslSaturation(), getHsv(), and The HSV Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

hsvSaturation(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#hsvSaturation

hsvSaturationF

hsvSaturationF() -> float

X.hsvSaturationF() -> float

Supplemental documentation: Qt 5 reference:

qreal QColor::hsvSaturationF() const

Returns the HSV saturation color component of this color.

See also saturation(), hslSaturationF(), getHsvF(), and The HSV Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

hsvSaturationF(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#hsvSaturationF

hue

hue() -> int

X.hue() -> int

Supplemental documentation: Qt 5 reference:

int QColor::hue() const

Returns the HSV hue color component of this color.

The color is implicitly converted to HSV.

See also hsvHue(), hslHue(), hueF(), getHsv(), and The HSV Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

hue(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#hue

hueF

hueF() -> float

X.hueF() -> float

Supplemental documentation: Qt 5 reference:

qreal QColor::hueF() const

Returns the HSV hue color component of this color.

The color is implicitly converted to HSV.

See also hsvHueF(), hslHueF(), hue(), getHsvF(), and The HSV Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

hueF(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#hueF

isValid

isValid() -> bool

X.isValid() -> bool

Supplemental documentation: Qt 5 reference:

bool QColor::isValid() const

Returns true if the color is valid; otherwise returns false.

Upstream PySide2 reference signatures (binding differences may apply):

isValid(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#isValid

isValidColor

isValidColor(name: str) -> bool

X.isValidColor(name) -> bool

Supplemental documentation: Qt 5 reference:

[static] bool QColor::isValidColor(const QString \&name)

Returns true if the name is a valid color name and can be used to construct a valid QColor object, otherwise returns false.

It uses the same algorithm used in setNamedColor().

This function was introduced in Qt 4.7.

See also setNamedColor().

[static] bool QColor::isValidColor(QStringView name)

This is an overloaded function.

This function was introduced in Qt 5.10.

[static] bool QColor::isValidColor(QLatin1String name)

This is an overloaded function.

This function was introduced in Qt 5.8.

Upstream PySide2 reference signatures (binding differences may apply):

isValidColor(name: str) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#isValidColor

lighter

lighter(f: int) -> Any

X.lighter(f) -> PythonQt.QtGui.QColor

Supplemental documentation: Qt 5 reference:

QColor QColor::lighter(int factor \= 150) const

Returns a lighter (or darker) color, but does not change this object.

If the factor is greater than 100, this functions returns a lighter color. Setting factor to 150 returns a color that is 50% brighter. If the factor is less than 100, the return color is darker, but we recommend using the darker() function for this purpose. If the factor is 0 or negative, the return value is unspecified.

The function converts the current color to HSV, multiplies the value (V) component by factor and converts the color back to it's original color spec.

This function was introduced in Qt 4.3.

See also darker() and isValid().

Upstream PySide2 reference signatures (binding differences may apply):

lighter(self, f: int=...) -> PySide2.QtGui.QColor

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#lighter

lightness

lightness() -> int

X.lightness() -> int

Supplemental documentation: Qt 5 reference:

int QColor::lightness() const

Returns the lightness color component of this color.

This function was introduced in Qt 4.6.

See also lightnessF() and getHsl().

Upstream PySide2 reference signatures (binding differences may apply):

lightness(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#lightness

lightnessF

lightnessF() -> float

X.lightnessF() -> float

Supplemental documentation: Qt 5 reference:

qreal QColor::lightnessF() const

Returns the lightness color component of this color.

This function was introduced in Qt 4.6.

See also value() and getHslF().

Upstream PySide2 reference signatures (binding differences may apply):

lightnessF(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#lightnessF

magenta

magenta() -> int

X.magenta() -> int

Supplemental documentation: Qt 5 reference:

int QColor::magenta() const

Returns the magenta color component of this color.

See also magentaF(), getCmyk(), and The CMYK Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

magenta(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#magenta

magentaF

magentaF() -> float

X.magentaF() -> float

Supplemental documentation: Qt 5 reference:

qreal QColor::magentaF() const

Returns the magenta color component of this color.

See also magenta(), getCmykF(), and The CMYK Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

magentaF(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#magentaF

name

name(format: Any) -> str

X.name(format) -> str

Supplemental documentation: Qt 5 reference:

QString QColor::name() const

Returns the name of the color in the format "#RRGGBB"; i.e. a "#" character followed by three two-digit hexadecimal numbers.

See also setNamedColor().

QString QColor::name(QColor::NameFormat format) const

Returns the name of the color in the specified format.

This function was introduced in Qt 5.2.

See also setNamedColor() and NameFormat.

Upstream PySide2 reference signatures (binding differences may apply):

name(self) -> str
name(self, format: PySide2.QtGui.QColor.NameFormat) -> str

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#name

red

red() -> int

X.red() -> int

Supplemental documentation: Qt 5 reference:

int QColor::red() const

Returns the red color component of this color.

See also setRed(), redF(), and getRgb().

Upstream PySide2 reference signatures (binding differences may apply):

red(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#red

redF

redF() -> float

X.redF() -> float

Supplemental documentation: Qt 5 reference:

qreal QColor::redF() const

Returns the red color component of this color.

See also setRedF(), red(), and getRgbF().

Upstream PySide2 reference signatures (binding differences may apply):

redF(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#redF

rgb

rgb() -> int

X.rgb() -> int

Supplemental documentation: Qt 5 reference:

QRgb QColor::rgb() const

Returns the RGB value of the color. The alpha value is opaque.

See also setRgb(), getRgb(), and rgba().

Upstream PySide2 reference signatures (binding differences may apply):

rgb(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#rgb

rgba

rgba() -> int

X.rgba() -> int

Supplemental documentation: Qt 5 reference:

QRgb QColor::rgba() const

Returns the RGB value of the color, including its alpha.

For an invalid color, the alpha value of the returned color is unspecified.

See also setRgba(), rgb(), and rgba64().

Upstream PySide2 reference signatures (binding differences may apply):

rgba(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#rgba

rgba64

rgba64() -> Any

X.rgba64() -> PythonQt.QtGui.QRgba64

Supplemental documentation: Qt 5 reference:

QRgba64 QColor::rgba64() const

Returns the RGB64 value of the color, including its alpha.

For an invalid color, the alpha value of the returned color is unspecified.

This function was introduced in Qt 5.6.

See also setRgba64(), rgba(), and rgb().

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#rgba64

saturation

saturation() -> int

X.saturation() -> int

Supplemental documentation: Qt 5 reference:

int QColor::saturation() const

Returns the HSV saturation color component of this color.

The color is implicitly converted to HSV.

See also hsvSaturation(), hslSaturation(), saturationF(), getHsv(), and The HSV Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

saturation(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#saturation

saturationF

saturationF() -> float

X.saturationF() -> float

Supplemental documentation: Qt 5 reference:

qreal QColor::saturationF() const

Returns the HSV saturation color component of this color.

The color is implicitly converted to HSV.

See also hsvSaturationF(), hslSaturationF(), saturation(), getHsvF(), and The HSV Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

saturationF(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#saturationF

setAlpha

setAlpha(alpha: int) -> None

X.setAlpha(alpha)

Supplemental documentation: Qt 5 reference:

void QColor::setAlpha(int alpha)

Sets the alpha of this color to alpha. Integer alpha is specified in the range 0-255.

See also alpha(), alphaF(), and Alpha-Blended Drawing.

Upstream PySide2 reference signatures (binding differences may apply):

setAlpha(self, alpha: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setAlpha

setAlphaF

setAlphaF(alpha: float) -> None

X.setAlphaF(alpha)

Supplemental documentation: Qt 5 reference:

void QColor::setAlphaF(qreal alpha)

Sets the alpha of this color to alpha. qreal alpha is specified in the range 0.0-1.0.

See also alphaF(), alpha(), and Alpha-Blended Drawing.

Upstream PySide2 reference signatures (binding differences may apply):

setAlphaF(self, alpha: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setAlphaF

setBlue

setBlue(blue: int) -> None

X.setBlue(blue)

Supplemental documentation: Qt 5 reference:

void QColor::setBlue(int blue)

Sets the blue color component of this color to blue. Integer components are specified in the range 0-255.

See also blue(), blueF(), and setRgb().

Upstream PySide2 reference signatures (binding differences may apply):

setBlue(self, blue: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setBlue

setBlueF

setBlueF(blue: float) -> None

X.setBlueF(blue)

Supplemental documentation: Qt 5 reference:

void QColor::setBlueF(qreal blue)

Sets the blue color component of this color to blue. If blue lies outside the 0.0-1.0 range, the color model will be changed to ExtendedRgb.

See also blueF(), blue(), and setRgbF().

Upstream PySide2 reference signatures (binding differences may apply):

setBlueF(self, blue: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setBlueF

setCmyk

setCmyk(c: int, m: int, y: int, k: int, a: int) -> None

X.setCmyk(c, m, y, k, a)

Supplemental documentation: Qt 5 reference:

void QColor::setCmyk(int c, int m, int y, int k, int a \= 255)

Sets the color to CMYK values, c (cyan), m (magenta), y (yellow), k (black), and a (alpha-channel, i.e. transparency).

All the values must be in the range 0-255.

See also getCmyk(), setCmykF(), and The CMYK Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

setCmyk(self, c: int, m: int, y: int, k: int, a: int=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setCmyk

setCmykF

setCmykF(c: float, m: float, y: float, k: float, a: float) -> None

X.setCmykF(c, m, y, k, a)

Supplemental documentation: Qt 5 reference:

void QColor::setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a \= 1.0)

This is an overloaded function.

Sets the color to CMYK values, c (cyan), m (magenta), y (yellow), k (black), and a (alpha-channel, i.e. transparency).

All the values must be in the range 0.0-1.0.

See also getCmykF(), setCmyk(), and The CMYK Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

setCmykF(self, c: float, m: float, y: float, k: float, a: float=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setCmykF

setGreen

setGreen(green: int) -> None

X.setGreen(green)

Supplemental documentation: Qt 5 reference:

void QColor::setGreen(int green)

Sets the green color component of this color to green. Integer components are specified in the range 0-255.

See also green(), greenF(), and setRgb().

Upstream PySide2 reference signatures (binding differences may apply):

setGreen(self, green: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setGreen

setGreenF

setGreenF(green: float) -> None

X.setGreenF(green)

Supplemental documentation: Qt 5 reference:

void QColor::setGreenF(qreal green)

Sets the green color component of this color to green. If green lies outside the 0.0-1.0 range, the color model will be changed to ExtendedRgb.

See also greenF(), green(), and setRgbF().

Upstream PySide2 reference signatures (binding differences may apply):

setGreenF(self, green: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setGreenF

setHsl

setHsl(h: int, s: int, l: int, a: int) -> None

X.setHsl(h, s, l, a)

Supplemental documentation: Qt 5 reference:

void QColor::setHsl(int h, int s, int l, int a \= 255)

Sets a HSL color value; h is the hue, s is the saturation, l is the lightness and a is the alpha component of the HSL color.

The saturation, value and alpha-channel values must be in the range 0-255, and the hue value must be greater than -1.

This function was introduced in Qt 4.6.

See also getHsl() and setHslF().

Upstream PySide2 reference signatures (binding differences may apply):

setHsl(self, h: int, s: int, l: int, a: int=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setHsl

setHslF

setHslF(h: float, s: float, l: float, a: float) -> None

X.setHslF(h, s, l, a)

Supplemental documentation: Qt 5 reference:

void QColor::setHslF(qreal h, qreal s, qreal l, qreal a \= 1.0)

Sets a HSL color lightness; h is the hue, s is the saturation, l is the lightness and a is the alpha component of the HSL color.

All the values must be in the range 0.0-1.0.

This function was introduced in Qt 4.6.

See also getHslF() and setHsl().

Upstream PySide2 reference signatures (binding differences may apply):

setHslF(self, h: float, s: float, l: float, a: float=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setHslF

setHsv

setHsv(h: int, s: int, v: int, a: int) -> None

X.setHsv(h, s, v, a)

Supplemental documentation: Qt 5 reference:

void QColor::setHsv(int h, int s, int v, int a \= 255)

Sets a HSV color value; h is the hue, s is the saturation, v is the value and a is the alpha component of the HSV color.

The saturation, value and alpha-channel values must be in the range 0-255, and the hue value must be greater than -1.

See also getHsv(), setHsvF(), and The HSV Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

setHsv(self, h: int, s: int, v: int, a: int=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setHsv

setHsvF

setHsvF(h: float, s: float, v: float, a: float) -> None

X.setHsvF(h, s, v, a)

Supplemental documentation: Qt 5 reference:

void QColor::setHsvF(qreal h, qreal s, qreal v, qreal a \= 1.0)

Sets a HSV color value; h is the hue, s is the saturation, v is the value and a is the alpha component of the HSV color.

All the values must be in the range 0.0-1.0.

See also getHsvF(), setHsv(), and The HSV Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

setHsvF(self, h: float, s: float, v: float, a: float=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setHsvF

setNamedColor

setNamedColor(name: str) -> None

X.setNamedColor(name)

Supplemental documentation: Qt 5 reference:

void QColor::setNamedColor(const QString \&name)

Sets the RGB value of this QColor to name, which may be in one of these formats:

  • RGB (each of R, G, and B is a single hex digit)

  • RRGGBB

  • AARRGGBB (Since 5.2)

  • RRRGGGBBB

  • RRRRGGGGBBBB

  • A name from the list of colors defined in the list of SVG color keyword names provided by the World Wide Web Consortium; for example, "steelblue" or "gainsboro". These color names work on all platforms. Note that these color names are not the same as defined by the Qt::GlobalColor enums, e.g. "green" and Qt::green does not refer to the same color.
  • transparent - representing the absence of a color.

The color is invalid if name cannot be parsed.

See also QColor(), name(), and isValid().

void QColor::setNamedColor(QStringView name)

This is an overloaded function.

This function was introduced in Qt 5.10.

void QColor::setNamedColor(QLatin1String name)

This is an overloaded function.

This function was introduced in Qt 5.8.

Upstream PySide2 reference signatures (binding differences may apply):

setNamedColor(self, name: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setNamedColor

setRed

setRed(red: int) -> None

X.setRed(red)

Supplemental documentation: Qt 5 reference:

void QColor::setRed(int red)

Sets the red color component of this color to red. Integer components are specified in the range 0-255.

See also red(), redF(), and setRgb().

Upstream PySide2 reference signatures (binding differences may apply):

setRed(self, red: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setRed

setRedF

setRedF(red: float) -> None

X.setRedF(red)

Supplemental documentation: Qt 5 reference:

void QColor::setRedF(qreal red)

Sets the red color component of this color to red. If red lies outside the 0.0-1.0 range, the color model will be changed to ExtendedRgb.

See also redF(), red(), and setRgbF().

Upstream PySide2 reference signatures (binding differences may apply):

setRedF(self, red: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setRedF

setRgb

setRgb(r: Any, g: Any, b: Any, a: Any) -> None

X.setRgb(r, g, b, a)

Supplemental documentation: Qt 5 reference:

void QColor::setRgb(int r, int g, int b, int a \= 255)

Sets the RGB value to r, g, b and the alpha value to a.

All the values must be in the range 0-255.

See also rgb(), getRgb(), and setRgbF().

void QColor::setRgb(QRgb rgb)

This is an overloaded function.

Sets the RGB value to rgb. The alpha value is set to opaque.

Upstream PySide2 reference signatures (binding differences may apply):

setRgb(self, r: int, g: int, b: int, a: int=...) -> None
setRgb(self, rgb: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setRgb

setRgbF

setRgbF(r: float, g: float, b: float, a: float) -> None

X.setRgbF(r, g, b, a)

Supplemental documentation: Qt 5 reference:

void QColor::setRgbF(qreal r, qreal g, qreal b, qreal a \= 1.0)

Sets the color channels of this color to r (red), g (green), b (blue) and a (alpha, transparency).

The alpha value must be in the range 0.0-1.0. If any of the other values are outside the range of 0.0-1.0 the color model will be set as ExtendedRgb.

See also rgb(), getRgbF(), and setRgb().

Upstream PySide2 reference signatures (binding differences may apply):

setRgbF(self, r: float, g: float, b: float, a: float=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setRgbF

setRgba

setRgba(rgba: int) -> None

X.setRgba(rgba)

Supplemental documentation: Qt 5 reference:

void QColor::setRgba(QRgb rgba)

Sets the RGB value to rgba, including its alpha.

See also rgba(), rgb(), and setRgba64().

Upstream PySide2 reference signatures (binding differences may apply):

setRgba(self, rgba: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setRgba

setRgba64

setRgba64(rgba: Any) -> Any

X.setRgba64(rgba)

Supplemental documentation: Qt 5 reference:

void QColor::setRgba64(QRgba64 rgba)

Sets the RGB64 value to rgba, including its alpha.

This function was introduced in Qt 5.6.

See also setRgba() and rgba64().

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#setRgba64

spec

spec() -> Any

X.spec()

Supplemental documentation: Qt 5 reference:

QColor::Spec QColor::spec() const

Returns how the color was specified.

See also Spec and convertTo().

Upstream PySide2 reference signatures (binding differences may apply):

spec(self) -> PySide2.QtGui.QColor.Spec

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#spec

toCmyk

toCmyk() -> Any

X.toCmyk() -> PythonQt.QtGui.QColor

Supplemental documentation: Qt 5 reference:

QColor QColor::toCmyk() const

Creates and returns a CMYK QColor based on this color.

See also fromCmyk(), convertTo(), isValid(), and The CMYK Color Model.

Upstream PySide2 reference signatures (binding differences may apply):

toCmyk(self) -> PySide2.QtGui.QColor

Source: https://doc.qt.io/archives/qt-5.15/qcolor.html#toCmyk