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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user