| 1 | // Copyright (C) 2017 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QQUICKCOLOR_P_H |
| 5 | #define QQUICKCOLOR_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtCore/qobject.h> |
| 19 | #include <QtGui/qcolor.h> |
| 20 | #include <QtQml/qqml.h> |
| 21 | #include <QtQuickControls2Impl/private/qtquickcontrols2implglobal_p.h> |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | class Q_QUICKCONTROLS2IMPL_EXPORT QQuickColor : public QObject |
| 26 | { |
| 27 | Q_OBJECT |
| 28 | QML_NAMED_ELEMENT(Color) |
| 29 | QML_SINGLETON |
| 30 | QML_ADDED_IN_VERSION(2, 3) |
| 31 | |
| 32 | public: |
| 33 | explicit QQuickColor(QObject *parent = nullptr); |
| 34 | |
| 35 | Q_INVOKABLE QColor transparent(const QColor &color, qreal opacity) const; |
| 36 | Q_INVOKABLE QColor blend(const QColor &a, const QColor &b, qreal factor) const; |
| 37 | }; |
| 38 | |
| 39 | QT_END_NAMESPACE |
| 40 | |
| 41 | #endif // QQUICKCOLOR_P_H |
| 42 | |