mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 22:47:20 +02:00
Feature - 256-color support
- Integrated new Color object into task. - Debugging needed - the cyan, green, and yellow colors are mixed up!
This commit is contained in:
parent
58730a48b3
commit
ff3b7cf337
11 changed files with 157 additions and 441 deletions
|
@ -494,6 +494,9 @@ int runCustomReport (
|
|||
}
|
||||
|
||||
// Now auto colorize all rows.
|
||||
Color color_due (context.config.get ("color.due", "yellow"));
|
||||
Color color_overdue (context.config.get ("color.overdue", "red"));
|
||||
|
||||
std::string due;
|
||||
bool imminent;
|
||||
bool overdue;
|
||||
|
@ -515,21 +518,14 @@ int runCustomReport (
|
|||
|
||||
if (context.config.get ("color", true) || context.config.get (std::string ("_forcecolor"), false))
|
||||
{
|
||||
Text::color fg = Text::colorCode (tasks[row].get ("fg"));
|
||||
Text::color bg = Text::colorCode (tasks[row].get ("bg"));
|
||||
autoColorize (tasks[row], fg, bg);
|
||||
table.setRowFg (row, fg);
|
||||
table.setRowBg (row, bg);
|
||||
Color c (tasks[row].get ("fg") + " " + tasks[row].get ("bg"));
|
||||
autoColorize (tasks[row], c);
|
||||
table.setRowColor (row, c);
|
||||
|
||||
if (fg == Text::nocolor)
|
||||
if (dueColumn != -1)
|
||||
{
|
||||
if (dueColumn != -1)
|
||||
{
|
||||
if (overdue)
|
||||
table.setCellFg (row, columnCount, Text::colorCode (context.config.get ("color.overdue", "red")));
|
||||
else if (imminent)
|
||||
table.setCellFg (row, columnCount, Text::colorCode (context.config.get ("color.due", "yellow")));
|
||||
}
|
||||
c.blend (overdue ? color_overdue : color_due);
|
||||
table.setCellColor (row, columnCount, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue