Support colorizing of the default palette.

This commit is contained in:
John Preston 2021-09-02 20:47:52 +03:00
parent cf5e41d81e
commit 1180d13a5c
2 changed files with 12 additions and 0 deletions

View file

@ -126,6 +126,11 @@ palette::SetResult palette::setColor(QLatin1String name, QLatin1String from) {
return duplicate ? SetResult::Duplicate : SetResult::Ok;
}
void palette::reset(const colorizer &with) {
clear();
finalize(with);
}
void palette::reset() {
clear();
finalize();
@ -236,6 +241,11 @@ void reset() {
style::internal::resetIcons();
}
void reset(const colorizer &with) {
GetMutable().reset(with);
style::internal::resetIcons();
}
int indexOfColor(color c) {
return GetMutable().indexOfColor(c);
}

View file

@ -31,6 +31,7 @@ public:
};
SetResult setColor(QLatin1String name, uchar r, uchar g, uchar b, uchar a);
SetResult setColor(QLatin1String name, QLatin1String from);
void reset(const colorizer &with);
void reset();
// Created not inited, should be finalized before usage.
@ -66,6 +67,7 @@ palette::SetResult setColor(QLatin1String name, uchar r, uchar g, uchar b, uchar
palette::SetResult setColor(QLatin1String name, QLatin1String from);
void apply(const palette &other);
void reset();
void reset(const colorizer &with);
int indexOfColor(color c);
} // namespace main_palette