PySide6.QtGui.QRgba64

class QRgba64

The QRgba64 struct contains a 64-bit RGB color.

Details

QRgba64 is a 64-bit data-structure containing four 16-bit color channels: Red, green, blue and alpha.

QRgba64 can be used as a replacement for QRgb when higher precision is needed. In particular a premultiplied QRgba64 can operate on unpremultiplied QRgb without loss of precision except for alpha 0.

See also

QRgb QColor

Synopsis

Methods

Static functions

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

class Shifts
__init__()
alpha()
Return type:

int

Returns the 16-bit alpha channel.

See also

setAlpha()

alpha8()
Return type:

int

Returns the alpha channel as an 8-bit.

blue()
Return type:

int

Returns the 16-bit blue color component.

See also

setBlue()

blue8()
Return type:

int

Returns the blue color component as an 8-bit.

static fromArgb32(rgb)
Parameters:

rgb – int

Return type:

QRgba64

Constructs a QRgba64 value from the 32bit ARGB value rgb.

See also

fromRgba()

static fromRgba(red, green, blue, alpha)
Parameters:
  • red – int

  • green – int

  • blue – int

  • alpha – int

Return type:

QRgba64

Constructs a QRgba64 value from the four 8-bit color channels red, green, blue and alpha.

See also

fromArgb32()

static fromRgba64(c)
Parameters:

c – int

Return type:

QRgba64

Returns c as a QRgba64 struct.

See also

fromArgb32()

static fromRgba64(red, green, blue, alpha)
Parameters:
  • red – int

  • green – int

  • blue – int

  • alpha – int

Return type:

QRgba64

Returns the QRgba64 quadruplet (r, g, b, a).

See also

fromRgba()

green()
Return type:

int

Returns the 16-bit green color component.

See also

setGreen()

green8()
Return type:

int

Returns the green color component as an 8-bit.

isOpaque()
Return type:

bool

Returns whether the color is fully opaque.

isTransparent()
Return type:

bool

Returns whether the color is transparent.

See also

isOpaque() alpha()

operator=(_rgba)
Parameters:

_rgba – int

Return type:

QRgba64

Assigns the value rgba to this instance of QRgba64 and returns it.

premultiplied()
Return type:

QRgba64

Returns the color with the alpha premultiplied.

red()
Return type:

int

Returns the 16-bit red color component.

See also

setRed()

red8()
Return type:

int

Returns the red color component as an 8-bit.

setAlpha(_alpha)
Parameters:

_alpha – int

Sets the alpha of this color to alpha.

See also

alpha()

setBlue(_blue)
Parameters:

_blue – int

Sets the blue color component of this color to blue.

See also

blue()

setGreen(_green)
Parameters:

_green – int

Sets the green color component of this color to green.

See also

green()

setRed(_red)
Parameters:

_red – int

Sets the red color component of this color to red.

See also

red()

toArgb32()
Return type:

int

Returns the color as a 32-bit ARGB value.

See also

fromArgb32()

toRgb16()
Return type:

int

Returns the color as a 16-bit RGB value.

See also

toArgb32()

unpremultiplied()
Return type:

QRgba64

Returns the color with the alpha unpremultiplied.

See also

premultiplied()