-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolorwheel.h
executable file
·49 lines (44 loc) · 1.68 KB
/
colorwheel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright 2022-present Contributors to the colorpicker project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/mikaelsundell/colorpicker
#pragma once
#include <QMainWindow>
class ColorwheelPrivate;
class Colorwheel : public QWidget
{
Q_OBJECT
public:
Colorwheel(QWidget* parent = nullptr);
virtual ~Colorwheel();
qreal angle() const;
qreal markerSize() const;
qreal borderOpacity() const;
qreal backgroundOpacity() const;
QList<QPair<QColor, QPair<QString, QString>>> colors();
int mapToSelected(const QPoint& point) const;
QColor mapToColor(const QPoint& point) const;
QColor mapToColor(const QColor& color, const QPoint& point) const;
bool isIQLineVisible() const;
bool isSaturationVisible() const;
bool isLabelsVisible() const;
bool isSegmented() const;
qsizetype selected() const;
bool hasSelection() const;
qreal zoomFactor() const;
public Q_SLOTS:
void setAngle(qreal angle);
void setBackgroundOpacity(qreal opacity);
void setBorderOpacity(qreal opacity);
void setColors(const QList<QPair<QColor, QPair<QString, QString>>> colors, bool selected = true);
void setIQLineVisible(bool visible);
void setLabelsVisible(bool visible);
void setMarkerSize(qreal size);
void setSaturationVisible(bool visible);
void setSegmented(bool segmented);
void setSelected(qsizetype selected);
void setZoomFactor(qreal factor);
protected:
void paintEvent(QPaintEvent *event) override;
private:
QScopedPointer<ColorwheelPrivate> p;
};