mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Palette: Added support for color enable/disable
This commit is contained in:
parent
d1cd2fe543
commit
930c23021e
2 changed files with 7 additions and 1 deletions
|
@ -60,7 +60,10 @@ void Palette::initialize (const Rules& rules)
|
||||||
// Return the next color in the list. Cycle to the beginning if necessary.
|
// Return the next color in the list. Cycle to the beginning if necessary.
|
||||||
Color Palette::next ()
|
Color Palette::next ()
|
||||||
{
|
{
|
||||||
|
if (enabled)
|
||||||
return _colors[_current++ % _colors.size ()];
|
return _colors[_current++ % _colors.size ()];
|
||||||
|
|
||||||
|
return Color ();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -40,6 +40,9 @@ public:
|
||||||
Color next ();
|
Color next ();
|
||||||
int size () const;
|
int size () const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool enabled {true};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector <Color> _colors {};
|
std::vector <Color> _colors {};
|
||||||
int _current {0};
|
int _current {0};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue