QColormap#
The QColormap
class maps device independent QColors to device dependent pixel values. More…
Synopsis#
Functions#
Static functions#
def
cleanup
()def
initialize
()def
instance
([screen=-1])
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
Detailed Description#
- class PySide6.QtWidgets.QColormap(colormap)#
- Parameters:
colormap –
PySide6.QtWidgets.QColormap
Constructs a copy of another colormap
.
- PySide6.QtWidgets.QColormap.Mode#
This enum describes how QColormap
maps device independent RGB values to device dependent pixel values.
Constant
Description
QColormap.Direct
Pixel values are derived directly from the RGB values, also known as “True Color.”
QColormap.Indexed
Pixel values represent indexes into a list of available colors, i.e.
QColormap
uses the index of the color that most closely matches an RGB value.QColormap.Gray
Similar to
Indexed
, pixel values represent a list of available gray tones.QColormap
uses the index of the gray tone that most closely matches the computed gray tone of an RGB value.
- static PySide6.QtWidgets.QColormap.cleanup()#
- PySide6.QtWidgets.QColormap.colorAt(pixel)#
- Parameters:
pixel –
uint
- Return type:
Returns a QColor
for the pixel
.
See also
- PySide6.QtWidgets.QColormap.colormap()#
Returns a list of colors which represents the devices colormap for Indexed
and Gray
modes. This function returns an empty list for Direct
mode.
See also
- PySide6.QtWidgets.QColormap.depth()#
- Return type:
int
Returns the depth of the device.
See also
- static PySide6.QtWidgets.QColormap.initialize()#
- static PySide6.QtWidgets.QColormap.instance([screen=-1])#
- Parameters:
screen – int
- Return type:
Returns the colormap for the specified screen
. If screen
is -1, this function returns the colormap for the default screen.
Returns the mode of this colormap.
See also
Mode
- PySide6.QtWidgets.QColormap.pixel(color)#
- Parameters:
color –
PySide6.QtGui.QColor
- Return type:
uint
Returns a device dependent pixel value for the color
.
See also
- PySide6.QtWidgets.QColormap.size()#
- Return type:
int
Returns the size of the colormap for Indexed
and Gray
modes; Returns -1 for Direct
mode.
See also