Palette: Added support for color enable/disable

This commit is contained in:
Paul Beckingham 2016-04-23 00:04:55 -04:00
parent d1cd2fe543
commit 930c23021e
2 changed files with 7 additions and 1 deletions

View file

@ -60,7 +60,10 @@ void Palette::initialize (const Rules& rules)
// Return the next color in the list. Cycle to the beginning if necessary.
Color Palette::next ()
{
return _colors[_current++ % _colors.size ()];
if (enabled)
return _colors[_current++ % _colors.size ()];
return Color ();
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -40,6 +40,9 @@ public:
Color next ();
int size () const;
public:
bool enabled {true};
private:
std::vector <Color> _colors {};
int _current {0};