Changeset View
Changeset View
Standalone View
Standalone View
libs/pigment/resources/KoColorSet.h
Context not available. | |||||
86 | 86 | | |||
---|---|---|---|---|---|
87 | void setColumnCount(int columns); | 87 | void setColumnCount(int columns); | ||
88 | int columnCount(); | 88 | int columnCount(); | ||
89 | /** | ||||
90 | * @brief comment | ||||
91 | * @return the comment. | ||||
92 | */ | ||||
93 | QString comment(); | ||||
89 | 94 | | |||
90 | public: | 95 | public: | ||
91 | 96 | | |||
92 | void add(const KoColorSetEntry &); | 97 | /** | ||
93 | void remove(const KoColorSetEntry &); | 98 | * @brief add Add a color to the palette. | ||
94 | void removeAt(quint32 index); | 99 | * @param groupName color to add the group to. If empty, it will be added to the unsorted. | ||
95 | KoColorSetEntry getColor(quint32 index); | 100 | */ | ||
96 | qint32 nColors(); | 101 | void add(const KoColorSetEntry &, QString groupName = QString()); | ||
102 | | ||||
103 | /** | ||||
104 | * @brief insertBefore insert color before index into group. | ||||
105 | * @param index | ||||
106 | * @param groupName name of the group that the color goes into. | ||||
107 | * @return new index of index after the prepending. | ||||
108 | */ | ||||
109 | quint32 insertBefore(const KoColorSetEntry &, qint32 index, QString groupName = QString()); | ||||
110 | | ||||
111 | void remove(const KoColorSetEntry &);//unsure | ||||
112 | /** | ||||
113 | * @brief removeAt remove the color at this index. | ||||
114 | * @param index index to remove at | ||||
115 | * @param groupName group in which the color is. | ||||
116 | */ | ||||
117 | void removeAt(quint32 index, QString groupName = QString()); | ||||
118 | | ||||
119 | /** | ||||
120 | * @brief getColorGlobal | ||||
121 | * A function for getting a color based on a global index. Useful for itterating through all color entries. | ||||
122 | * @param globalIndex the global index over the whole palette. | ||||
123 | * @return the entry. | ||||
124 | */ | ||||
125 | KoColorSetEntry getColorGlobal(quint32 globalIndex); | ||||
126 | /** | ||||
127 | * @brief getColorGroup | ||||
128 | * A function for getting the color from a specific group. | ||||
129 | * @param groupName the name of the group, will give unosrted when not defined. | ||||
130 | * @param index the index within the group. | ||||
131 | * @return the entry | ||||
132 | */ | ||||
133 | KoColorSetEntry getColorGroup(quint32 index, QString groupName = QString()); | ||||
134 | | ||||
135 | QString findGroupByGlobalIndex(quint32 globalIndex, quint32 *index); | ||||
136 | QString findGroupByColorName(QString name, quint32 *index); | ||||
137 | QString findGroupByID(QString id,quint32 *index); | ||||
138 | | ||||
139 | /** | ||||
140 | * @brief getGroupNames | ||||
141 | * @return returns a list of group names, excluding the unsorted group. | ||||
142 | */ | ||||
143 | QStringList getGroupNames(); | ||||
144 | | ||||
145 | /** | ||||
146 | * @brief nColorsGroup | ||||
147 | * @param groupName string name of the group, when not specified, returns unsorted colors. | ||||
148 | * @return the amount of colors in this group. | ||||
149 | */ | ||||
150 | quint32 nColorsGroup(QString groupName = QString()); | ||||
151 | /** | ||||
152 | * @brief nColors | ||||
153 | * @return total colors in palette. | ||||
154 | */ | ||||
155 | quint32 nColors(); | ||||
156 | | ||||
157 | /** | ||||
158 | * @brief addGroup | ||||
159 | * Adds a new group. | ||||
160 | * @param groupName the name of the new group. When not specified, this will fail. | ||||
161 | * @return whether thegroup was made. | ||||
162 | */ | ||||
163 | bool addGroup(QString groupName = QString()); | ||||
164 | /** | ||||
165 | * @brief removeGroup | ||||
166 | * Remove a group from the KoColorSet | ||||
167 | * @param groupName the name of the group you want to remove. | ||||
168 | * @param keepColors Whether you wish to keep the colorsetentries. These will be added to the unsorted. | ||||
169 | * @return whether it could find the group to remove. | ||||
170 | */ | ||||
171 | bool removeGroup(QString groupName = QString(), bool keepColors = true); | ||||
172 | | ||||
97 | void clear(); | 173 | void clear(); | ||
98 | 174 | | |||
99 | /** | 175 | /** | ||
Context not available. | |||||
105 | * when the two colors' colorspaces don't match. Else it'll use the entry's colorspace. | 181 | * when the two colors' colorspaces don't match. Else it'll use the entry's colorspace. | ||
106 | * @return returns the int of the closest match. | 182 | * @return returns the int of the closest match. | ||
107 | */ | 183 | */ | ||
108 | qint32 getIndexClosestColor(KoColor color, bool useGivenColorSpace = true); | 184 | quint32 getIndexClosestColor(KoColor color, bool useGivenColorSpace = true); | ||
109 | 185 | | |||
110 | /** | 186 | /** | ||
111 | * @brief closestColorName | 187 | * @brief closestColorName | ||
Context not available. |