Krita Source Code Documentation
Loading...
Searching...
No Matches
KoTriangleColorSelector.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2008 Cyrille Berger <cberger@cberger.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6
7#ifndef _KO_TRIANGLE_COLOR_SELECTOR_H_
8#define _KO_TRIANGLE_COLOR_SELECTOR_H_
9
10#include <QWidget>
11
12#include "kritawidgets_export.h"
13
15
16class KoColor;
18
19
20class KRITAWIDGETS_EXPORT KoTriangleColorSelector : public KisColorSelectorInterface {
21 Q_OBJECT
22 public:
23 explicit KoTriangleColorSelector(QWidget *parent);
24 explicit KoTriangleColorSelector(const KoColorDisplayRendererInterface *displayRenderer, QWidget *parent);
25 ~KoTriangleColorSelector() override;
26 protected: // events
27 void paintEvent( QPaintEvent * event ) override;
28 void resizeEvent( QResizeEvent * event ) override;
29 void mouseReleaseEvent( QMouseEvent * event ) override;
30 void mousePressEvent( QMouseEvent * event ) override;
31 void mouseMoveEvent( QMouseEvent * event ) override;
32 public:
33 int hue() const;
34 int value() const;
35 int saturation() const;
36 int rotation() const;
37 KoColor getCurrentColor() const override;
38 public Q_SLOTS:
39 void setHue(int h);
40 void setValue(int v);
41 void setSaturation(int s);
42 void setRotation(int angle);
43 void setFollowHue(bool follow);
44 void setHSV(int h, int s, int v);
45 void slotSetColor(const KoColor& ) override;
46 Q_SIGNALS:
47 void colorChanged(const QColor& );
49 private Q_SLOTS:
50 void configurationChanged();
51 private:
52 void tellColorChanged();
53 void generateTriangle();
54 void generateWheel();
55 void updateTriangleCircleParameters();
56 void selectColorAt(int x, int y, bool checkInWheel = true);
57 private:
58 struct Private;
59 Private* const d;
60};
61
62#endif
qreal v
void setSaturation(TReal &r, TReal &g, TReal &b, TReal sat)
virtual void slotSetColor(const KoColor &c)=0
virtual KoColor getCurrentColor() const =0
void colorChanged(const QColor &)