summaryrefslogtreecommitdiffstats
path: root/basicsuite/Graphical Effects/effect_Colorize.qml
diff options
context:
space:
mode:
Diffstat (limited to 'basicsuite/Graphical Effects/effect_Colorize.qml')
-rw-r--r--basicsuite/Graphical Effects/effect_Colorize.qml34
1 files changed, 34 insertions, 0 deletions
diff --git a/basicsuite/Graphical Effects/effect_Colorize.qml b/basicsuite/Graphical Effects/effect_Colorize.qml
new file mode 100644
index 0000000..c2057ed
--- /dev/null
+++ b/basicsuite/Graphical Effects/effect_Colorize.qml
@@ -0,0 +1,34 @@
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+ id: root
+
+ property real inputX: 0.6;
+ property real feedbackX: effect.hue
+ property string nameX: "Hue"
+
+ property real inputY: 0.7
+ property real feedbackY: effect.saturation
+ property string nameY: "Saturation"
+
+ Image {
+ id: image
+ source: "images/bug.jpg"
+ width: Math.min(root.width, root.height) * 0.8;
+ height: width
+ sourceSize: Qt.size(width, height);
+ anchors.centerIn: parent
+ }
+
+ Colorize {
+ id: effect;
+
+ source: image
+ anchors.fill: source
+ scale: source.height > root.height * 0.8 ? root.height / source.height * 0.8 : 1;
+
+ hue: root.inputX * 2 - 1;
+ saturation: root.inputY * 2 - 1
+ }
+}