Class: QgsColorEffect¶
A paint effect which alters the colors (e.g., brightness, contrast) in a source picture.
Class Hierarchy¶
Base classes¶
Base class for visual effects which can be applied to QPicture drawings  | 
Methods
Returns the blend mode for the effect  | 
|
Returns the brightness modification for the effect.  | 
|
Returns the color used for colorizing a picture.  | 
|
Returns whether the effect will colorize a picture.  | 
|
Returns the strength used for colorizing a picture.  | 
|
Returns the contrast modification for the effect.  | 
|
Returns whether the effect will convert a picture to grayscale.  | 
|
Returns the opacity for the effect.  | 
|
Returns the saturation modification for the effect.  | 
|
Sets the blend mode for the effect  | 
|
Sets the brightness modification for the effect.  | 
|
Sets the color used for colorizing a picture.  | 
|
Sets whether the effect should colorize a picture.  | 
|
Sets the strength for colorizing a picture.  | 
|
Sets the contrast modification for the effect.  | 
|
Sets whether the effect should convert a picture to grayscale.  | 
|
Sets the opacity for the effect.  | 
|
Sets the saturation modification for the effect.  | 
Static Methods
Creates a new   | 
- class qgis.core.QgsColorEffect[source]¶
 Bases:
QgsPaintEffect- blendMode(self) QPainter.CompositionMode[source]¶
 Returns the blend mode for the effect
- Return type:
 QPainter.CompositionMode
- Returns:
 blend mode used for drawing the effect on to a destination paint device
See also
- brightness(self) int[source]¶
 Returns the brightness modification for the effect.
- Return type:
 int
- Returns:
 brightness value. Values are between -255 and 255, where 0 represents no change, negative values indicate darkening and positive values indicate lightening
See also
- colorizeColor(self) QColor[source]¶
 Returns the color used for colorizing a picture. This is only used if
colorizeOn()is set toTrue.- Return type:
 QColor
- Returns:
 colorization color
See also
See also
See also
- colorizeOn(self) bool[source]¶
 Returns whether the effect will colorize a picture.
- Return type:
 bool
- Returns:
 Trueif colorization is enabled
See also
See also
See also
- colorizeStrength(self) int[source]¶
 Returns the strength used for colorizing a picture. This is only used if
setColorizeOn()is set toTrue.- Return type:
 int
- Returns:
 colorization strength, between 0 and 100
See also
See also
See also
- contrast(self) int[source]¶
 Returns the contrast modification for the effect.
- Return type:
 int
- Returns:
 contrast value. Values are between -100 and 100, where 0 represents no change, negative values indicate less contrast and positive values indicate greater contrast
See also
- static create(map: Dict[str, Any]) QgsPaintEffect | None[source]¶
 Creates a new
QgsColorEffecteffect from a properties string map.- Parameters:
 map (Dict[str, Any]) – encoded properties string map
- Return type:
 Optional[QgsPaintEffect]
- Returns:
 new QgsColorEffect
- grayscaleMode(self) QgsImageOperation.GrayscaleMode[source]¶
 Returns whether the effect will convert a picture to grayscale.
- Return type:
 - Returns:
 method for grayscale conversion
See also
- opacity(self) float[source]¶
 Returns the opacity for the effect.
- Return type:
 float
- Returns:
 opacity value between 0 and 1 inclusive, where 0 is fully transparent and 1 is fully opaque.
See also
- saturation(self) float[source]¶
 Returns the saturation modification for the effect.
- Return type:
 float
- Returns:
 saturation value. Values are between 0 and 2.0, where 1.0 represents no change, 0.0 represents totally desaturated (grayscale), and positive values indicate greater saturation
See also
- setBlendMode(self, mode: QPainter.CompositionMode)[source]¶
 Sets the blend mode for the effect
- Parameters:
 mode (QPainter.CompositionMode) – blend mode used for drawing the effect on to a destination paint device
See also
- setBrightness(self, brightness: int)[source]¶
 Sets the brightness modification for the effect.
- Parameters:
 brightness (int) – Valid values are between -255 and 255, where 0 represents no change, negative values indicate darkening and positive values indicate lightening
See also
- setColorizeColor(self, colorizeColor: QColor | Qt.GlobalColor)[source]¶
 Sets the color used for colorizing a picture. This is only used if
setColorizeOn()is set toTrue.- Parameters:
 colorizeColor (Union[QColor, Qt.GlobalColor]) – colorization color
See also
See also
See also
- setColorizeOn(self, colorizeOn: bool)[source]¶
 Sets whether the effect should colorize a picture.
- Parameters:
 colorizeOn (bool) – set to
Trueto enable colorization
See also
See also
See also
- setColorizeStrength(self, colorizeStrength: int)[source]¶
 Sets the strength for colorizing a picture. This is only used if
setColorizeOn()is set toTrue.- Parameters:
 colorizeStrength (int) – colorization strength, between 0 and 100
See also
See also
See also
- setContrast(self, contrast: int)[source]¶
 Sets the contrast modification for the effect.
- Parameters:
 contrast (int) – Valid values are between -100 and 100, where 0 represents no change, negative values indicate less contrast and positive values indicate greater contrast
See also
- setGrayscaleMode(self, grayscaleMode: QgsImageOperation.GrayscaleMode)[source]¶
 Sets whether the effect should convert a picture to grayscale.
- Parameters:
 grayscaleMode (QgsImageOperation.GrayscaleMode) – method for grayscale conversion
See also
- setOpacity(self, opacity: float)[source]¶
 Sets the
opacityfor the effect.- Parameters:
 opacity (float) – double between 0 and 1 inclusive, where 0 is fully transparent and 1 is fully opaque
See also
- setSaturation(self, saturation: float)[source]¶
 Sets the saturation modification for the effect.
- Parameters:
 saturation (float) – Valid values are between 0 and 2.0, where 1.0 represents no change, 0.0 represents totally desaturated (grayscale), and positive values indicate greater saturation
See also