mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Feature - 256-color support
- Improved blending algorithm. - Added 16- to 256-color upgrade algorithm.
This commit is contained in:
parent
bb2eb5f266
commit
0b187f3ff8
2 changed files with 69 additions and 71 deletions
11
src/Color.h
11
src/Color.h
|
@ -42,7 +42,7 @@
|
|||
class Color
|
||||
{
|
||||
public:
|
||||
enum color_id {nocolor = 0, black, red, blue, green, magenta, cyan, yellow, white};
|
||||
enum color_id {nocolor = 0, black, red, green, yellow, blue, magenta, cyan, white};
|
||||
|
||||
Color ();
|
||||
Color (const Color&);
|
||||
|
@ -53,9 +53,10 @@ public:
|
|||
Color (color_id, color_id, bool, bool, bool); // fg, bg, underline, bold, bright
|
||||
~Color ();
|
||||
Color& operator= (const Color&);
|
||||
operator std::string ();
|
||||
operator int ();
|
||||
operator std::string () const;
|
||||
operator int () const;
|
||||
|
||||
void upgrade ();
|
||||
void blend (const Color&);
|
||||
|
||||
std::string colorize (const std::string&);
|
||||
|
@ -65,8 +66,8 @@ public:
|
|||
|
||||
private:
|
||||
int find (const std::string&);
|
||||
std::string fg ();
|
||||
std::string bg ();
|
||||
std::string fg () const;
|
||||
std::string bg () const;
|
||||
|
||||
private:
|
||||
unsigned int value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue