|
Krita Source Code Documentation
|
The Palette class Palette is a resource object that stores organised color data. It's purpose is to allow artists to save colors and store them. More...
#include <Palette.h>
Inheritance diagram for Palette:Public Slots | |
| void | addEntry (Swatch entry, QString groupName=QString()) |
| add a color entry to a group. Color is appended to the end. | |
| void | addGroup (QString name) |
| Palette content can be organized in groups. This method allows to add a new group in palette. | |
| Q_DECL_DEPRECATED void | changeGroupName (QString oldGroupName, QString newGroupName) |
| changeGroupName change the group name. | |
| int | colorsCountGroup (QString name) |
| colorsCountGroup | |
| int | colorsCountTotal () |
number of filled colors (swatches) in palette NOTE: same as numberOfEntries() | |
| Q_DECL_DEPRECATED Swatch * | colorSetEntryByIndex (int index) |
| colorSetEntryByIndex get the colorsetEntry from the global index. | |
| Q_DECL_DEPRECATED Swatch * | colorSetEntryFromGroup (int index, const QString &groupName) |
| colorSetEntryFromGroup | |
| int | columnCount () |
| Palettes are defined in grids. The number of column define grid width. The number of rows will depend of columns and total number of entries. | |
| QString | comment () |
| the comment or description associated with the palette. | |
| Swatch * | entryByIndex (int index) |
| get color (swatch) from the global index. | |
| Swatch * | entryByIndexFromGroup (int index, const QString &groupName) |
| get color (swatch) from the given group index. | |
| QStringList | groupNames () const |
| Palette content can be organized in groups. | |
| void | moveGroup (const QString &groupName, const QString &groupNameInsertBefore=QString()) |
Move the group groupName to position before group groupNameInsertBefore. | |
| int | numberOfEntries () const |
number of filled colors (swatches) in palette NOTE: same as colorsCountTotal() | |
| void | removeEntry (int index) |
| Remove the color entry at the given index in this palette. | |
| void | removeEntryFromGroup (int index, const QString &groupName) |
| Remove the color entry at the given index in the given group. | |
| void | removeGroup (QString name, bool keepColors=true) |
| Palette content can be organized in groups. This method allows to remove an existing group from palette. | |
| void | renameGroup (QString oldGroupName, QString newGroupName) |
| rename a group | |
| int | rowCount () |
| The number of rows in the palette grid. If the palette has groups, the row count is defined by the groups' row count. Otherwise, it's determined by the number of columns and entries. | |
| int | rowCountGroup (QString name) |
| The number of rows defined in the given group. | |
| bool | save () |
| save the palette | |
| void | setColumnCount (int columns) |
| Palettes are defined in grids. The number of column define grid width, this value can be defined. The number of rows will depend of columns and total number of entries. | |
| void | setComment (QString comment) |
| the comment or description associated with the palette. | |
| void | setRowCountGroup (int rows, QString name) |
| Set the number of rows defined in the given group. | |
| int | slotCount () |
| number of slots for swatches in palette This includes any empty slots not filled by a color. | |
| int | slotCountGroup (QString name) |
| number of slots for swatches in group This includes any empty slots not filled by a color. | |
Public Member Functions | |
| bool | operator!= (const Palette &other) const |
| bool | operator== (const Palette &other) const |
| Palette (Resource *resource, QObject *parent=0) | |
| ~Palette () override | |
Private Member Functions | |
| KoColorSetSP | colorSet () |
| colorSet | |
Private Attributes | |
| Private *const | d |
Friends | |
| class | PaletteView |
The Palette class Palette is a resource object that stores organised color data. It's purpose is to allow artists to save colors and store them.
An example for printing all the palettes and the entries:
|
explicit |
Definition at line 18 of file Palette.cpp.
References d, krita::Palette::Private::palette, and Resource::resource().
|
override |
add a color entry to a group. Color is appended to the end.
| entry | the entry |
| groupName | the name of the group to add to. |
Definition at line 170 of file Palette.cpp.
References d, Swatch::kisSwatch(), and krita::Palette::Private::palette.
|
slot |
Palette content can be organized in groups. This method allows to add a new group in palette.
| name | The name of the new group to add. |
Definition at line 99 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
changeGroupName change the group name.
DEPRECATED: use renameGroup() instead
| oldGroupName | the old groupname to change. |
| newGroupName | the new name to change it into. |
Definition at line 203 of file Palette.cpp.
References renameGroup(), and warnScript.
|
slot |
colorsCountGroup
| name | of the group to check. Empty is the default group. |
Definition at line 117 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
number of filled colors (swatches) in palette NOTE: same as numberOfEntries()
Definition at line 111 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
private |
colorSet
Definition at line 224 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
colorSetEntryByIndex get the colorsetEntry from the global index.
DEPRECATED: use entryByIndex() instead
| index | the global index |
Definition at line 139 of file Palette.cpp.
References entryByIndex(), and warnScript.
|
slot |
colorSetEntryFromGroup
DEPRECATED: use entryByIndexFromGroup() instead
| index | index in the group. |
| groupName | the name of the group to get the color from. |
Definition at line 155 of file Palette.cpp.
References entryByIndexFromGroup(), and warnScript.
|
slot |
Palettes are defined in grids. The number of column define grid width. The number of rows will depend of columns and total number of entries.
Definition at line 46 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
the comment or description associated with the palette.
Definition at line 81 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
get color (swatch) from the global index.
| index | the global index |
Definition at line 145 of file Palette.cpp.
References columnCount(), d, and krita::Palette::Private::palette.
|
slot |
get color (swatch) from the given group index.
| index | index in the group. |
| groupName | the name of the group to get the color from. |
Definition at line 161 of file Palette.cpp.
References columnCount(), d, and krita::Palette::Private::palette.
|
slot |
Palette content can be organized in groups.
Definition at line 93 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
Move the group groupName to position before group groupNameInsertBefore.
| groupName | group to move. |
| groupNameInsertBefore | reference group for which groupName have to be moved before. |
Definition at line 214 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
number of filled colors (swatches) in palette NOTE: same as colorsCountTotal()
Definition at line 40 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
| bool Palette::operator!= | ( | const Palette & | other | ) | const |
| bool Palette::operator== | ( | const Palette & | other | ) | const |
Definition at line 29 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
Remove the color entry at the given index in this palette.
| index | index in this palette. |
Definition at line 175 of file Palette.cpp.
References columnCount(), d, groupNames(), and krita::Palette::Private::palette.
|
slot |
Remove the color entry at the given index in the given group.
| index | index in the group. |
| groupName | the name of the group to remove the entry from. |
Definition at line 193 of file Palette.cpp.
References columnCount(), d, and krita::Palette::Private::palette.
|
slot |
Palette content can be organized in groups. This method allows to remove an existing group from palette.
| name | The name of the group to remove. |
| keepColors | whether or not to delete all the colors inside, or to move them to the default group. |
Definition at line 105 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
rename a group
| oldGroupName | the old groupname to change. |
| newGroupName | the new name to change it into. |
Definition at line 209 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
The number of rows in the palette grid. If the palette has groups, the row count is defined by the groups' row count. Otherwise, it's determined by the number of columns and entries.
Definition at line 58 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
The number of rows defined in the given group.
| name | of the group to check. |
Definition at line 64 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
save the palette
WARNING: this method does nothing and need to be implemented!
Definition at line 219 of file Palette.cpp.
|
slot |
Palettes are defined in grids. The number of column define grid width, this value can be defined. The number of rows will depend of columns and total number of entries.
| columns | Set the amount of columns this palette should use. |
Definition at line 52 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
the comment or description associated with the palette.
| comment | set the comment or description associated with the palette. |
Definition at line 87 of file Palette.cpp.
References comment(), d, and krita::Palette::Private::palette.
|
slot |
Set the number of rows defined in the given group.
| rows | the amount of rows this group should use. |
| name | of the group to modify. |
Definition at line 72 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
number of slots for swatches in palette This includes any empty slots not filled by a color.
Definition at line 125 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
slot |
number of slots for swatches in group This includes any empty slots not filled by a color.
| name | of the group to check. Empty is the default group. |
Definition at line 131 of file Palette.cpp.
References d, and krita::Palette::Private::palette.
|
friend |