mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +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
|
@ -46,18 +46,14 @@ Palette::Palette ()
|
|||
Color ("black on bright cyan"),
|
||||
Color ("black on bright yellow"),
|
||||
};
|
||||
|
||||
_current = 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Palette::initialize (const Rules& rules)
|
||||
void Palette::add (Color c)
|
||||
{
|
||||
auto themeColors = rules.all ("theme.palette.color");
|
||||
if (themeColors.size ())
|
||||
{
|
||||
_colors.clear ();
|
||||
for (auto& entry : themeColors)
|
||||
_colors.push_back (Color (rules.get (entry)));
|
||||
}
|
||||
_colors.push_back (c);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -77,3 +73,10 @@ int Palette::size () const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Palette::clear ()
|
||||
{
|
||||
_colors.clear ();
|
||||
_current = 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue