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 KoColor getCurrentColor() const override;
37 public Q_SLOTS:
38 void setHue(int h);
39 void setValue(int v);
40 void setSaturation(int s);
41 void setHSV(int h, int s, int v);
42 void slotSetColor(const KoColor& ) override;
43 Q_SIGNALS:
44 void colorChanged(const QColor& );
46 private Q_SLOTS:
47 void configurationChanged();
48 private:
49 void tellColorChanged();
50 void generateTriangle();
51 void generateWheel();
52 void updateTriangleCircleParameters();
53 void selectColorAt(int x, int y, bool checkInWheel = true);
54 private:
55 struct Private;
56 Private* const d;
57};
58
59#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 &)