mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
CmdChart: Switched to use intervalColor
- This should reduce color palette rotation speed
This commit is contained in:
parent
cf8b1aa1d4
commit
225494d360
3 changed files with 13 additions and 13 deletions
|
@ -41,11 +41,15 @@
|
|||
Color intervalColor (
|
||||
const Interval& interval,
|
||||
const Rules& rules,
|
||||
Palette& palette)
|
||||
std::map <std::string, Color>& tag_colors)
|
||||
{
|
||||
Color c;
|
||||
std::string first_tag;
|
||||
for (auto& tag : interval.tags ())
|
||||
{
|
||||
if (first_tag == "")
|
||||
first_tag = tag;
|
||||
|
||||
std::string name = std::string ("tags.") + tag + ".color";
|
||||
if (rules.has (name))
|
||||
c.blend (Color (rules.get (name)));
|
||||
|
@ -54,7 +58,10 @@ Color intervalColor (
|
|||
if (c.nontrivial ())
|
||||
return c;
|
||||
|
||||
return palette.next ();
|
||||
if (interval.tags ().size ())
|
||||
return tag_colors[first_tag];
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue