- Qt 6.11
- Qt 5 Compatibility APIs: Graphical Effects
- QML Types
- HueSaturation
- Qt 6.11.0 Reference Documentation

# HueSaturation QML Type

Alters the source item colors in the HSL color space. More...

Import Statement: | `import Qt5Compat.GraphicalEffects`
Since: | QtGraphicalEffects 1.0
Inherits: | Item

- List of all members, including inherited members

## Properties

- cached : bool
- hue : real
- lightness : real
- saturation : real
- source : variant

## Detailed Description

HueSaturation is similar to the Colorize effect, but the hue and saturation property values are handled differently. The HueSaturation effect always shifts the hue, saturation, and lightness from the original, instead of setting them.

Source | Effect applied
--- | ---

## Example

The following example shows how to apply the effect.

     import QtQuick
     import Qt5Compat.GraphicalEffects

     Item {
         width: 300
         height: 300

         Image {
             id: bug
             source: "images/bug.jpg"
             sourceSize: Qt.size(parent.width, parent.height)
             smooth: true
             visible: false
         }

         HueSaturation {
             anchors.fill: bug
             source: bug
             hue: -0.3
             saturation: 0.5
             lightness: -0.1
         }
     }

## Property Documentation

### cached : bool

This property allows the effect output pixels to be cached in order to improve the rendering performance.

Every time the source or effect properties are changed, the pixels in the cache must be updated. Memory consumption is increased, because an extra buffer of memory is required for storing the effect output.

It is recommended to disable the cache when the source or the effect properties are animated.

By default, the property is set to `false`.

### hue : real

This property defines the hue value which is added to the source hue value.

The value ranges from -1.0 (decrease) to 1.0 (increase). By default, the property is set to `0.0` (no change).

Output examples with different hue values |  |
--- | --- | ---
hue: -0.3 | hue: 0.0 | hue: 0.3
saturation: 0 | saturation: 0 | saturation: 0
lightness: 0 | lightness: 0 | lightness: 0

### lightness : real

This property defines the lightness value which is added to the source saturation value.

The value ranges from -1.0 (decrease) to 1.0 (increase). By default, the property is set to `0.0` (no change).

Output examples with different lightness values |  |
--- | --- | ---
lightness: -0.5 | lightness: 0.0 | lightness: 0.5
hue: 0 | hue: 0 | hue: 0
saturation: 0 | saturation: 0 | saturation: 0

### saturation : real

This property defines the saturation value value which is added to the source saturation value.

The value ranges from -1.0 (decrease) to 1.0 (increase). By default, the property is set to `0.0` (no change).

Output examples with different saturation values |  |
--- | --- | ---
saturation: -0.8 | saturation: 0.0 | saturation: 1.0
hue: 0 | hue: 0 | hue: 0
lightness: 0 | lightness: 0 | lightness: 0

### source : variant

This property defines the source item that provides the source pixels for the effect.

Note: It is not supported to let the effect include itself, for instance by setting source to the effect's parent.