Krita

Swatch.h
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
15/**
16 * @brief The Swatch class is a thin wrapper around the KisSwatch class.
17 *
18 * A Swatch is a single color that is part of a palette, that has a name
19 * and an id. A Swatch color can be a spot color.
20 */
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
The ManagedColor class is a class to handle colors that are color managed.
The PaletteView class is a wrapper around a MVC method for handling palettes.
Definition PaletteView.h:32
The Palette class Palette is a resource object that stores organised color data.
Definition Palette.h:45
The Swatch class is a thin wrapper around the KisSwatch class.
Definition Swatch.h:22
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.