Krita Source Code Documentation
Loading...
Searching...
No Matches
Swatch Class Reference

The Swatch class is a thin wrapper around the KisSwatch class. More...

#include <Swatch.h>

+ Inheritance diagram for Swatch:

Classes

struct  Private
 

Public Slots

ManagedColorcolor () const
 
QString id () const
 
bool isValid () const
 
QString name () const
 
void setColor (ManagedColor *color)
 
void setId (const QString &id)
 
void setName (const QString &name)
 
void setSpotColor (bool spotColor)
 
bool spotColor () const
 

Public Member Functions

bool operator!= (const Swatch &other) const
 
Swatchoperator= (const Swatch &rhs)
 
bool operator== (const Swatch &other) const
 
 Swatch (const Swatch &rhs, QObject *parent=0)
 
 Swatch (QObject *parent=0)
 
virtual ~Swatch ()
 

Private Member Functions

KisSwatch kisSwatch () const
 
 Swatch (const KisSwatch &kisSwatch, QObject *parent=0)
 

Private Attributes

Private *const d
 

Friends

class Palette
 
class PaletteView
 

Detailed Description

The Swatch class is a thin wrapper around the KisSwatch class.

A Swatch is a single color that is part of a palette, that has a name and an id. A Swatch color can be a spot color.

Definition at line 21 of file Swatch.h.

Constructor & Destructor Documentation

◆ Swatch() [1/3]

Swatch::Swatch ( const KisSwatch & kisSwatch,
QObject * parent = 0 )
private

Definition at line 14 of file Swatch.cpp.

15 : QObject(parent)
16 , d(new Private)
17{
19}
Private *const d
Definition Swatch.h:58
KisSwatch kisSwatch() const
Definition Swatch.cpp:100
KisSwatch swatch
Definition Swatch.cpp:11

References d, kisSwatch(), and Swatch::Private::swatch.

◆ Swatch() [2/3]

Swatch::Swatch ( QObject * parent = 0)
explicit

Definition at line 21 of file Swatch.cpp.

22 : QObject(parent)
23 , d(new Private)
24{
25
26}

◆ ~Swatch()

Swatch::~Swatch ( )
virtual

Definition at line 28 of file Swatch.cpp.

29{
30 delete d;
31}

References d.

◆ Swatch() [3/3]

Swatch::Swatch ( const Swatch & rhs,
QObject * parent = 0 )

Definition at line 33 of file Swatch.cpp.

34 : QObject(parent)
35 , d(new Private)
36{
37 d->swatch = rhs.d->swatch;
38}

References d, and Swatch::Private::swatch.

Member Function Documentation

◆ color

ManagedColor * Swatch::color ( ) const
slot

Definition at line 76 of file Swatch.cpp.

77{
79 return c;
80}
KoColor color() const
Definition KisSwatch.h:30
The ManagedColor class is a class to handle colors that are color managed. A managed color is a color...

References KisSwatch::color(), d, and Swatch::Private::swatch.

◆ id

QString Swatch::id ( ) const
slot

Definition at line 67 of file Swatch.cpp.

68{
69 return d->swatch.id();
70}
QString id() const
Definition KisSwatch.h:27

References d, KisSwatch::id(), and Swatch::Private::swatch.

◆ isValid

bool Swatch::isValid ( ) const
slot

Definition at line 95 of file Swatch.cpp.

96{
97 return d->swatch.isValid();
98}
bool isValid() const
Definition KisSwatch.h:36

References d, KisSwatch::isValid(), and Swatch::Private::swatch.

◆ kisSwatch()

KisSwatch Swatch::kisSwatch ( ) const
private

Definition at line 100 of file Swatch.cpp.

101{
102 return d->swatch;
103}

References d, and Swatch::Private::swatch.

◆ name

QString Swatch::name ( ) const
slot

Definition at line 57 of file Swatch.cpp.

58{
59 return d->swatch.name();
60}
QString name() const
Definition KisSwatch.h:24

References d, KisSwatch::name(), and Swatch::Private::swatch.

◆ operator!=()

bool Swatch::operator!= ( const Swatch & other) const

Definition at line 52 of file Swatch.cpp.

53{
54 return !(operator==(other));
55}
bool operator==(const Swatch &other) const
Definition Swatch.cpp:47

References operator==().

◆ operator=()

Swatch & Swatch::operator= ( const Swatch & rhs)

Definition at line 40 of file Swatch.cpp.

41{
42 if (&rhs == this) return *this;
43 d->swatch = rhs.d->swatch;
44 return *this;
45}

References d, and Swatch::Private::swatch.

◆ operator==()

bool Swatch::operator== ( const Swatch & other) const

Definition at line 47 of file Swatch.cpp.

48{
49 return (d->swatch == other.d->swatch);
50}

References d, and Swatch::Private::swatch.

◆ setColor

void Swatch::setColor ( ManagedColor * color)
slot

Definition at line 81 of file Swatch.cpp.

82{
84}
void setColor(const KoColor &color)
Definition KisSwatch.cpp:32
KoColor color() const
ManagedColor * color() const
Definition Swatch.cpp:76

References ManagedColor::color(), color(), d, KisSwatch::setColor(), and Swatch::Private::swatch.

◆ setId

void Swatch::setId ( const QString & id)
slot

Definition at line 71 of file Swatch.cpp.

72{
73 d->swatch.setId(id);
74}
void setId(const QString &id)
Definition KisSwatch.cpp:26

References d, KisSwatch::setId(), and Swatch::Private::swatch.

◆ setName

void Swatch::setName ( const QString & name)
slot

Definition at line 62 of file Swatch.cpp.

63{
65}
void setName(const QString &name)
Definition KisSwatch.cpp:20
QString name() const
Definition Swatch.cpp:57

References d, name(), KisSwatch::setName(), and Swatch::Private::swatch.

◆ setSpotColor

void Swatch::setSpotColor ( bool spotColor)
slot

Definition at line 90 of file Swatch.cpp.

91{
93}
void setSpotColor(bool spotColor)
Definition KisSwatch.cpp:38
bool spotColor() const
Definition Swatch.cpp:86

References d, KisSwatch::setSpotColor(), spotColor(), and Swatch::Private::swatch.

◆ spotColor

bool Swatch::spotColor ( ) const
slot

Definition at line 86 of file Swatch.cpp.

87{
88 return d->swatch.spotColor();
89}
bool spotColor() const
Definition KisSwatch.h:33

References d, KisSwatch::spotColor(), and Swatch::Private::swatch.

Friends And Related Symbol Documentation

◆ Palette

Palette
friend

Definition at line 26 of file Swatch.h.

◆ PaletteView

friend class PaletteView
friend

Definition at line 27 of file Swatch.h.

Member Data Documentation

◆ d

Private* const Swatch::d
private

Definition at line 58 of file Swatch.h.


The documentation for this class was generated from the following files: