mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Bug Fix - #372 Color blending/mapping broken
- Corrected problem in unit test that expected the wrong result. - Fixed Color::Color (const std::string&) so that the foreground and background are now considered two different colors, are upgraded separately, if necessary, and then blended. The problem affected all instances of "<256-color> on <16-color>". Hooray for unit tests.
This commit is contained in:
parent
89ae64c5fb
commit
579ebe6130
3 changed files with 49 additions and 42 deletions
|
@ -102,7 +102,7 @@ int main (int argc, char** argv)
|
|||
t.is (Color::colorize ("foo", "white"), std::string ("\033[37mfoo\033[0m"), "white -> ^[[37m");
|
||||
|
||||
// 16-color backgrounds.
|
||||
t.is (Color::colorize ("foo", "on bright black"), std::string ("\033[90mfoo\033[0m"), "on bright black -> ^[[90m");
|
||||
t.is (Color::colorize ("foo", "on bright black"), std::string ("\033[100mfoo\033[0m"), "on bright black -> ^[[100m");
|
||||
|
||||
t.is (Color::colorize ("foo", "on black"), std::string ("\033[40mfoo\033[0m"), "on black -> ^[[40m");
|
||||
t.is (Color::colorize ("foo", "on red"), std::string ("\033[41mfoo\033[0m"), "on red -> ^[[41m");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue