diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2015-02-15 10:51:51 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2015-02-18 15:56:27 +0000 |
commit | 6f264b755501fd322d1e357187b42120210a7ba3 (patch) | |
tree | 0ea8915de1e41bed87c62deffa19d61a0e6ff288 /src/quick/util/qquickglobal.cpp | |
parent | 3fcb6ccac0baa34b820534184f863884e072cfb2 (diff) |
Add Qt.hsva() function
This is more convenient than the alternative hsla() function in many
cases as color pickers in other applications default to the HSV color
space e.g. GIMP, kcolorchooser.
[ChangeLog][QtQml] Added Qt.hsva() function
Change-Id: Id5c1a78173757bf9842b164d90b31682e9a41749
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/quick/util/qquickglobal.cpp')
-rw-r--r-- | src/quick/util/qquickglobal.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index ad2be02334..6aa7bedc5b 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -98,6 +98,11 @@ public: return QVariant(QColor::fromHslF(h, s, l, a)); } + QVariant fromHsvF(double h, double s, double v, double a) + { + return QVariant(QColor::fromHsvF(h, s, v, a)); + } + QVariant lighter(const QVariant &var, qreal factor) { QColor color = var.value<QColor>(); |