Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickcolor_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKCOLOR_P_H
6#define QQUICKCOLOR_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qtquickglobal_p.h>
20#include <private/qv4engine_p.h>
21
22#include <QtCore/qobject.h>
23#include <QtGui/qcolor.h>
24#include <QtQml/qqml.h>
25
27
28class Q_QUICK_EXPORT QQuickColor : public QObject
29{
30 Q_OBJECT
31 QML_NAMED_ELEMENT(Color)
32 QML_SINGLETON
33 QML_ADDED_IN_VERSION(6, 12)
34
35public:
36 explicit QQuickColor(QObject *parent = nullptr);
37
38 Q_INVOKABLE QColor rgba(double r, double g, double b, double a) const;
39 Q_INVOKABLE QColor hsla(double h, double s, double l, double a) const;
40 Q_INVOKABLE QColor hsva(double h, double s, double v, double a) const;
41
42 Q_INVOKABLE QColor fromString(const QString &name) const;
43 Q_INVOKABLE bool equal(const QColor &lhs, const QColor &rhs) const;
44
45 Q_INVOKABLE QColor transparent(const QColor &color, qreal opacity) const;
46 Q_INVOKABLE QColor blend(const QColor &a, const QColor &b, qreal factor) const;
47 Q_INVOKABLE QColor alpha(const QColor &baseColor, double value) const;
48 Q_INVOKABLE QColor darker(const QColor &baseColor, double factor) const;
49 Q_INVOKABLE QColor lighter(const QColor &baseColor, double factor) const;
50 Q_INVOKABLE QColor tint(const QColor &baseColor, const QColor &tintColor) const;
51};
52
53QT_END_NAMESPACE
54
55#endif // QQUICKCOLOR_P_H
Combined button and popup list for selecting options.