Krita Source Code Documentation
Loading...
Searching...
No Matches
Swatch.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-3.0-or-later
3 */
4
5#ifndef SWATCH_H
6#define SWATCH_H
7
8#include "ManagedColor.h"
9
10#include "kritalibkis_export.h"
11#include "libkis.h"
12
13class KisSwatch;
14
21class KRITALIBKIS_EXPORT Swatch : public QObject
22{
23 Q_OBJECT
24
25private:
26 friend class Palette;
27 friend class PaletteView;
28 Swatch(const KisSwatch &kisSwatch, QObject *parent = 0);
29public:
30 explicit Swatch(QObject *parent = 0);
31 virtual ~Swatch();
32 Swatch(const Swatch &rhs, QObject *parent = 0);
33 Swatch &operator=(const Swatch &rhs);
34
35 bool operator==(const Swatch &other) const;
36 bool operator!=(const Swatch &other) const;
37
38public Q_SLOTS:
39 QString name() const;
40 void setName(const QString &name);
41
42 QString id() const;
43 void setId(const QString &id);
44
45 ManagedColor *color() const;
46 void setColor(ManagedColor *color);
47
48 bool spotColor() const;
49 void setSpotColor(bool spotColor);
50
51 bool isValid() const;
52
53private:
54 friend class Palette;
55 KisSwatch kisSwatch() const;
56
57 struct Private;
58 Private *const d;
59};
60
61#endif // SWATCH_H
bool operator==(const KisRegion &lhs, const KisRegion &rhs)
bool operator!=(const KoID &v1, const KoID &v2)
Definition KoID.h:103
The ManagedColor class is a class to handle colors that are color managed. A managed color is a color...
The PaletteView class is a wrapper around a MVC method for handling palettes. This class shows a nice...
Definition PaletteView.h:31
The Palette class Palette is a resource object that stores organised color data. It's purpose is to a...
Definition Palette.h:44
The Swatch class is a thin wrapper around the KisSwatch class.
Definition Swatch.h:22
Private *const d
Definition Swatch.h:58