69 return group->rowCount();
78 group->setRowCount(rows);
96 return d->
palette->swatchGroupNames();
108 return d->
palette->removeGroup(name, keepColors);
121 if (!group)
return 0;
122 return group->colorCount();
135 if (!group)
return 0;
136 return group->slotCount();
141 warnScript <<
"DEPRECATED Palette.colorSetEntryByIndex() - use Palette.entryByIndex() instead";
157 warnScript <<
"DEPRECATED Palette.colorSetEntryFromGroup() - use Palette.entryByIndexFromGroup() instead";
181 Q_FOREACH(
const QString &name,
groupNames()) {
188 row -= g->rowCount();
190 if (!groupFoundIn) {
return; }
191 d->
palette->removeSwatch(col, row, groupFoundIn);
200 d->
palette->removeSwatch(col, row, group);
205 warnScript <<
"DEPRECATED Palette.changeGroupName() - use Palette.renameGroup() instead";
211 d->
palette->changeGroupName(oldGroupName, newGroupName);
216 return d->
palette->moveGroup(groupName, groupNameInsertBefore);
QList< QString > QStringList
The Palette class Palette is a resource object that stores organised color data. It's purpose is to a...
int colorsCountGroup(QString name)
colorsCountGroup
Palette(Resource *resource, QObject *parent=0)
bool operator!=(const Palette &other) const
void moveGroup(const QString &groupName, const QString &groupNameInsertBefore=QString())
Move the group groupName to position before group groupNameInsertBefore.
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....
Swatch * entryByIndexFromGroup(int index, const QString &groupName)
get color (swatch) from the given group index.
void removeEntry(int index)
Remove the color entry at the given index in this palette.
Q_DECL_DEPRECATED void changeGroupName(QString oldGroupName, QString newGroupName)
changeGroupName change the group name.
Swatch * entryByIndex(int index)
get color (swatch) from the global index.
void addGroup(QString name)
Palette content can be organized in groups. This method allows to add a new group in palette.
int slotCountGroup(QString name)
number of slots for swatches in group This includes any empty slots not filled by a color.
int numberOfEntries() const
number of filled colors (swatches) in palette NOTE: same as colorsCountTotal()
Q_DECL_DEPRECATED Swatch * colorSetEntryFromGroup(int index, const QString &groupName)
colorSetEntryFromGroup
Q_DECL_DEPRECATED Swatch * colorSetEntryByIndex(int index)
colorSetEntryByIndex get the colorsetEntry from the global index.
QString comment()
the comment or description associated with the palette.
int colorsCountTotal()
number of filled colors (swatches) in palette NOTE: same as numberOfEntries()
void renameGroup(QString oldGroupName, QString newGroupName)
rename a group
int columnCount()
Palettes are defined in grids. The number of column define grid width. The number of rows will depend...
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.
void removeGroup(QString name, bool keepColors=true)
Palette content can be organized in groups. This method allows to remove an existing group from palet...
bool operator==(const Palette &other) const
KoColorSetSP colorSet()
colorSet
int rowCountGroup(QString name)
The number of rows defined in the given group.
void removeEntryFromGroup(int index, const QString &groupName)
Remove the color entry at the given index in the given group.
void setComment(QString comment)
the comment or description associated with the palette.
void addEntry(Swatch entry, QString groupName=QString())
add a color entry to a group. Color is appended to the end.
int rowCount()
The number of rows in the palette grid. If the palette has groups, the row count is defined by the gr...
QStringList groupNames() const
Palette content can be organized in groups.
KoResourceSP resource() const
The Swatch class is a thin wrapper around the KisSwatch class.
KisSwatch kisSwatch() const
rgba palette[MAX_PALETTE]