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 
13 class 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  */
21 class KRITALIBKIS_EXPORT Swatch
22 {
23 private:
24  friend class Palette;
25  friend class PaletteView;
26  Swatch(const KisSwatch &kisSwatch);
27 public:
28  Swatch();
29  virtual ~Swatch();
30  Swatch(const Swatch &rhs);
31  Swatch &operator=(const Swatch &rhs);
32 
33  QString name() const;
34  void setName(const QString &name);
35 
36  QString id() const;
37  void setId(const QString &id);
38 
39  ManagedColor *color() const;
40  void setColor(ManagedColor *color);
41 
42  bool spotColor() const;
43  void setSpotColor(bool spotColor);
44 
45  bool isValid() const;
46 
47 private:
48  friend class Palette;
49  KisSwatch kisSwatch() const;
50 
51  struct Private;
52  Private *const d;
53 };
54 
55 #endif // SWATCH_H
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:21
The ManagedColor class is a class to handle colors that are color managed.
Definition: ManagedColor.h:45
The PaletteView class is a wrapper around a MVC method for handling palettes. This class shows a nice...
Definition: PaletteView.h:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 04:07:02 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.