CmdChart: Switched to use intervalColor

- This should reduce color palette rotation speed
This commit is contained in:
Paul Beckingham 2016-07-04 15:53:19 -04:00
parent cf8b1aa1d4
commit 225494d360
3 changed files with 13 additions and 13 deletions

View file

@ -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;
}
////////////////////////////////////////////////////////////////////////////////