mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
helper: Added createPalette, and a Palette interface change
This commit is contained in:
parent
6567639465
commit
21166a044f
6 changed files with 32 additions and 16 deletions
|
@ -537,6 +537,22 @@ std::vector <Range> combineHolidaysAndExclusions (
|
|||
return addRanges (range, results, exclusionRanges);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Palette createPalette (const Rules& rules)
|
||||
{
|
||||
Palette p;
|
||||
auto colors = rules.all ("theme.palette.color");
|
||||
if (colors.size ())
|
||||
{
|
||||
p.clear ();
|
||||
for (auto& c : colors)
|
||||
p.add (Color (rules.get (c)));
|
||||
}
|
||||
|
||||
p.enabled = rules.getBoolean ("color");
|
||||
return p;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Extract the tags from a set of intervals, and using a rotating color palette,
|
||||
// map unique tags to color.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue