diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2020-04-08 14:35:21 +0200 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2020-04-14 14:46:19 +0200 |
commit | 53aa259d57e92f48585f95b47a25ee6e16fc2aaa (patch) | |
tree | b3e27b6ee5ca5b8fdfb4d1e084e50ebd151fc0bc /src/quick/util/qquickvaluetypes.cpp | |
parent | 27748dec471a9c9825f5a35d1936bb5d00400b5b (diff) |
Implement Qt.alpha()
Introduces an easy way to get a version of a color with transparency
(e.g. Qt.alpha("red", 0.5)).
[ChangeLog][QML][General] Added Qt.alpha for easily modifying a color's alpha value
Task-number: QTBUG-77635
Change-Id: Ic724e5fa503ca2ae5157a99eed1b5c913a39239f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/util/qquickvaluetypes.cpp')
-rw-r--r-- | src/quick/util/qquickvaluetypes.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/util/qquickvaluetypes.cpp b/src/quick/util/qquickvaluetypes.cpp index 2b86fe5ceb..d836946214 100644 --- a/src/quick/util/qquickvaluetypes.cpp +++ b/src/quick/util/qquickvaluetypes.cpp @@ -68,6 +68,11 @@ QVariant QQuickColorValueType::darker(qreal factor) const return QQml_colorProvider()->darker(this->v, factor); } +QVariant QQuickColorValueType::alpha(qreal value) const +{ + return QQml_colorProvider()->alpha(this->v, value); +} + QVariant QQuickColorValueType::tint(QVariant tintColor) const { return QQml_colorProvider()->tint(this->v, tintColor); |