From 438ae4766ae5245884a004acbf465125c97813f5 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sat, 17 Mar 2012 19:16:38 -0700 Subject: Library for ansi color management. Having now experienced the unbelievable difference it makes to have one's voluminous debugging output effectively color-coded, I had to librarize the ansi codes in order to use them. This could all go in the standard library, or as soon as I can easily make use of compiler dependencies, a separate library altogether. For now it hides away in scala.tools.util.color. --- test/files/run/color.check | 693 +++++++++++++++++++++++++++++++++++++++++++++ test/files/run/color.scala | 33 +++ 2 files changed, 726 insertions(+) create mode 100644 test/files/run/color.check create mode 100644 test/files/run/color.scala (limited to 'test') diff --git a/test/files/run/color.check b/test/files/run/color.check new file mode 100644 index 0000000000..598cc145f0 --- /dev/null +++ b/test/files/run/color.check @@ -0,0 +1,693 @@ + +1 color +the quick brown fox Black +the quick brown fox Red +the quick brown fox Green +the quick brown fox Yellow +the quick brown fox Blue +the quick brown fox Magenta +the quick brown fox Cyan +the quick brown fox White + +1 effect +the quick brown fox Reset +the quick brown fox Bright +the quick brown fox Faint +the quick brown fox Italic +the quick brown fox Underline +the quick brown fox Blink +the quick brown fox Inverse +the quick brown fox Hidden +the quick brown fox Strikethrough + +1 color 1 effect +the quick brown fox Bright Black +the quick brown fox Underline Black +the quick brown fox Inverse Black +the quick brown fox Bright Red +the quick brown fox Underline Red +the quick brown fox Inverse Red +the quick brown fox Bright Green +the quick brown fox Underline Green +the quick brown fox Inverse Green +the quick brown fox Bright Yellow +the quick brown fox Underline Yellow +the quick brown fox Inverse Yellow +the quick brown fox Bright Blue +the quick brown fox Underline Blue +the quick brown fox Inverse Blue +the quick brown fox Bright Magenta +the quick brown fox Underline Magenta +the quick brown fox Inverse Magenta +the quick brown fox Bright Cyan +the quick brown fox Underline Cyan +the quick brown fox Inverse Cyan +the quick brown fox Bright White +the quick brown fox Underline White +the quick brown fox Inverse White + +2 colors 0 effects +the quick brown fox Black (on Black background) +the quick brown fox Red (on Black background) +the quick brown fox Green (on Black background) +the quick brown fox Yellow (on Black background) +the quick brown fox Blue (on Black background) +the quick brown fox Magenta (on Black background) +the quick brown fox Cyan (on Black background) +the quick brown fox White (on Black background) +the quick brown fox Black (on Red background) +the quick brown fox Red (on Red background) +the quick brown fox Green (on Red background) +the quick brown fox Yellow (on Red background) +the quick brown fox Blue (on Red background) +the quick brown fox Magenta (on Red background) +the quick brown fox Cyan (on Red background) +the quick brown fox White (on Red background) +the quick brown fox Black (on Green background) +the quick brown fox Red (on Green background) +the quick brown fox Green (on Green background) +the quick brown fox Yellow (on Green background) +the quick brown fox Blue (on Green background) +the quick brown fox Magenta (on Green background) +the quick brown fox Cyan (on Green background) +the quick brown fox White (on Green background) +the quick brown fox Black (on Yellow background) +the quick brown fox Red (on Yellow background) +the quick brown fox Green (on Yellow background) +the quick brown fox Yellow (on Yellow background) +the quick brown fox Blue (on Yellow background) +the quick brown fox Magenta (on Yellow background) +the quick brown fox Cyan (on Yellow background) +the quick brown fox White (on Yellow background) +the quick brown fox Black (on Blue background) +the quick brown fox Red (on Blue background) +the quick brown fox Green (on Blue background) +the quick brown fox Yellow (on Blue background) +the quick brown fox Blue (on Blue background) +the quick brown fox Magenta (on Blue background) +the quick brown fox Cyan (on Blue background) +the quick brown fox White (on Blue background) +the quick brown fox Black (on Magenta background) +the quick brown fox Red (on Magenta background) +the quick brown fox Green (on Magenta background) +the quick brown fox Yellow (on Magenta background) +the quick brown fox Blue (on Magenta background) +the quick brown fox Magenta (on Magenta background) +the quick brown fox Cyan (on Magenta background) +the quick brown fox White (on Magenta background) +the quick brown fox Black (on Cyan background) +the quick brown fox Red (on Cyan background) +the quick brown fox Green (on Cyan background) +the quick brown fox Yellow (on Cyan background) +the quick brown fox Blue (on Cyan background) +the quick brown fox Magenta (on Cyan background) +the quick brown fox Cyan (on Cyan background) +the quick brown fox White (on Cyan background) +the quick brown fox Black (on White background) +the quick brown fox Red (on White background) +the quick brown fox Green (on White background) +the quick brown fox Yellow (on White background) +the quick brown fox Blue (on White background) +the quick brown fox Magenta (on White background) +the quick brown fox Cyan (on White background) +the quick brown fox White (on White background) + +2 colors 1 effect +the quick brown fox Bright Black (on Black background) +the quick brown fox Underline Black (on Black background) +the quick brown fox Inverse Black (on Black background) +the quick brown fox Bright Red (on Black background) +the quick brown fox Underline Red (on Black background) +the quick brown fox Inverse Red (on Black background) +the quick brown fox Bright Green (on Black background) +the quick brown fox Underline Green (on Black background) +the quick brown fox Inverse Green (on Black background) +the quick brown fox Bright Yellow (on Black background) +the quick brown fox Underline Yellow (on Black background) +the quick brown fox Inverse Yellow (on Black background) +the quick brown fox Bright Blue (on Black background) +the quick brown fox Underline Blue (on Black background) +the quick brown fox Inverse Blue (on Black background) +the quick brown fox Bright Magenta (on Black background) +the quick brown fox Underline Magenta (on Black background) +the quick brown fox Inverse Magenta (on Black background) +the quick brown fox Bright Cyan (on Black background) +the quick brown fox Underline Cyan (on Black background) +the quick brown fox Inverse Cyan (on Black background) +the quick brown fox Bright White (on Black background) +the quick brown fox Underline White (on Black background) +the quick brown fox Inverse White (on Black background) +the quick brown fox Bright Black (on Red background) +the quick brown fox Underline Black (on Red background) +the quick brown fox Inverse Black (on Red background) +the quick brown fox Bright Red (on Red background) +the quick brown fox Underline Red (on Red background) +the quick brown fox Inverse Red (on Red background) +the quick brown fox Bright Green (on Red background) +the quick brown fox Underline Green (on Red background) +the quick brown fox Inverse Green (on Red background) +the quick brown fox Bright Yellow (on Red background) +the quick brown fox Underline Yellow (on Red background) +the quick brown fox Inverse Yellow (on Red background) +the quick brown fox Bright Blue (on Red background) +the quick brown fox Underline Blue (on Red background) +the quick brown fox Inverse Blue (on Red background) +the quick brown fox Bright Magenta (on Red background) +the quick brown fox Underline Magenta (on Red background) +the quick brown fox Inverse Magenta (on Red background) +the quick brown fox Bright Cyan (on Red background) +the quick brown fox Underline Cyan (on Red background) +the quick brown fox Inverse Cyan (on Red background) +the quick brown fox Bright White (on Red background) +the quick brown fox Underline White (on Red background) +the quick brown fox Inverse White (on Red background) +the quick brown fox Bright Black (on Green background) +the quick brown fox Underline Black (on Green background) +the quick brown fox Inverse Black (on Green background) +the quick brown fox Bright Red (on Green background) +the quick brown fox Underline Red (on Green background) +the quick brown fox Inverse Red (on Green background) +the quick brown fox Bright Green (on Green background) +the quick brown fox Underline Green (on Green background) +the quick brown fox Inverse Green (on Green background) +the quick brown fox Bright Yellow (on Green background) +the quick brown fox Underline Yellow (on Green background) +the quick brown fox Inverse Yellow (on Green background) +the quick brown fox Bright Blue (on Green background) +the quick brown fox Underline Blue (on Green background) +the quick brown fox Inverse Blue (on Green background) +the quick brown fox Bright Magenta (on Green background) +the quick brown fox Underline Magenta (on Green background) +the quick brown fox Inverse Magenta (on Green background) +the quick brown fox Bright Cyan (on Green background) +the quick brown fox Underline Cyan (on Green background) +the quick brown fox Inverse Cyan (on Green background) +the quick brown fox Bright White (on Green background) +the quick brown fox Underline White (on Green background) +the quick brown fox Inverse White (on Green background) +the quick brown fox Bright Black (on Yellow background) +the quick brown fox Underline Black (on Yellow background) +the quick brown fox Inverse Black (on Yellow background) +the quick brown fox Bright Red (on Yellow background) +the quick brown fox Underline Red (on Yellow background) +the quick brown fox Inverse Red (on Yellow background) +the quick brown fox Bright Green (on Yellow background) +the quick brown fox Underline Green (on Yellow background) +the quick brown fox Inverse Green (on Yellow background) +the quick brown fox Bright Yellow (on Yellow background) +the quick brown fox Underline Yellow (on Yellow background) +the quick brown fox Inverse Yellow (on Yellow background) +the quick brown fox Bright Blue (on Yellow background) +the quick brown fox Underline Blue (on Yellow background) +the quick brown fox Inverse Blue (on Yellow background) +the quick brown fox Bright Magenta (on Yellow background) +the quick brown fox Underline Magenta (on Yellow background) +the quick brown fox Inverse Magenta (on Yellow background) +the quick brown fox Bright Cyan (on Yellow background) +the quick brown fox Underline Cyan (on Yellow background) +the quick brown fox Inverse Cyan (on Yellow background) +the quick brown fox Bright White (on Yellow background) +the quick brown fox Underline White (on Yellow background) +the quick brown fox Inverse White (on Yellow background) +the quick brown fox Bright Black (on Blue background) +the quick brown fox Underline Black (on Blue background) +the quick brown fox Inverse Black (on Blue background) +the quick brown fox Bright Red (on Blue background) +the quick brown fox Underline Red (on Blue background) +the quick brown fox Inverse Red (on Blue background) +the quick brown fox Bright Green (on Blue background) +the quick brown fox Underline Green (on Blue background) +the quick brown fox Inverse Green (on Blue background) +the quick brown fox Bright Yellow (on Blue background) +the quick brown fox Underline Yellow (on Blue background) +the quick brown fox Inverse Yellow (on Blue background) +the quick brown fox Bright Blue (on Blue background) +the quick brown fox Underline Blue (on Blue background) +the quick brown fox Inverse Blue (on Blue background) +the quick brown fox Bright Magenta (on Blue background) +the quick brown fox Underline Magenta (on Blue background) +the quick brown fox Inverse Magenta (on Blue background) +the quick brown fox Bright Cyan (on Blue background) +the quick brown fox Underline Cyan (on Blue background) +the quick brown fox Inverse Cyan (on Blue background) +the quick brown fox Bright White (on Blue background) +the quick brown fox Underline White (on Blue background) +the quick brown fox Inverse White (on Blue background) +the quick brown fox Bright Black (on Magenta background) +the quick brown fox Underline Black (on Magenta background) +the quick brown fox Inverse Black (on Magenta background) +the quick brown fox Bright Red (on Magenta background) +the quick brown fox Underline Red (on Magenta background) +the quick brown fox Inverse Red (on Magenta background) +the quick brown fox Bright Green (on Magenta background) +the quick brown fox Underline Green (on Magenta background) +the quick brown fox Inverse Green (on Magenta background) +the quick brown fox Bright Yellow (on Magenta background) +the quick brown fox Underline Yellow (on Magenta background) +the quick brown fox Inverse Yellow (on Magenta background) +the quick brown fox Bright Blue (on Magenta background) +the quick brown fox Underline Blue (on Magenta background) +the quick brown fox Inverse Blue (on Magenta background) +the quick brown fox Bright Magenta (on Magenta background) +the quick brown fox Underline Magenta (on Magenta background) +the quick brown fox Inverse Magenta (on Magenta background) +the quick brown fox Bright Cyan (on Magenta background) +the quick brown fox Underline Cyan (on Magenta background) +the quick brown fox Inverse Cyan (on Magenta background) +the quick brown fox Bright White (on Magenta background) +the quick brown fox Underline White (on Magenta background) +the quick brown fox Inverse White (on Magenta background) +the quick brown fox Bright Black (on Cyan background) +the quick brown fox Underline Black (on Cyan background) +the quick brown fox Inverse Black (on Cyan background) +the quick brown fox Bright Red (on Cyan background) +the quick brown fox Underline Red (on Cyan background) +the quick brown fox Inverse Red (on Cyan background) +the quick brown fox Bright Green (on Cyan background) +the quick brown fox Underline Green (on Cyan background) +the quick brown fox Inverse Green (on Cyan background) +the quick brown fox Bright Yellow (on Cyan background) +the quick brown fox Underline Yellow (on Cyan background) +the quick brown fox Inverse Yellow (on Cyan background) +the quick brown fox Bright Blue (on Cyan background) +the quick brown fox Underline Blue (on Cyan background) +the quick brown fox Inverse Blue (on Cyan background) +the quick brown fox Bright Magenta (on Cyan background) +the quick brown fox Underline Magenta (on Cyan background) +the quick brown fox Inverse Magenta (on Cyan background) +the quick brown fox Bright Cyan (on Cyan background) +the quick brown fox Underline Cyan (on Cyan background) +the quick brown fox Inverse Cyan (on Cyan background) +the quick brown fox Bright White (on Cyan background) +the quick brown fox Underline White (on Cyan background) +the quick brown fox Inverse White (on Cyan background) +the quick brown fox Bright Black (on White background) +the quick brown fox Underline Black (on White background) +the quick brown fox Inverse Black (on White background) +the quick brown fox Bright Red (on White background) +the quick brown fox Underline Red (on White background) +the quick brown fox Inverse Red (on White background) +the quick brown fox Bright Green (on White background) +the quick brown fox Underline Green (on White background) +the quick brown fox Inverse Green (on White background) +the quick brown fox Bright Yellow (on White background) +the quick brown fox Underline Yellow (on White background) +the quick brown fox Inverse Yellow (on White background) +the quick brown fox Bright Blue (on White background) +the quick brown fox Underline Blue (on White background) +the quick brown fox Inverse Blue (on White background) +the quick brown fox Bright Magenta (on White background) +the quick brown fox Underline Magenta (on White background) +the quick brown fox Inverse Magenta (on White background) +the quick brown fox Bright Cyan (on White background) +the quick brown fox Underline Cyan (on White background) +the quick brown fox Inverse Cyan (on White background) +the quick brown fox Bright White (on White background) +the quick brown fox Underline White (on White background) +the quick brown fox Inverse White (on White background) + +2 colors 2 effects +the quick brown fox Bright Underline Black (on Black background) +the quick brown fox Bright Inverse Black (on Black background) +the quick brown fox Underline Bright Black (on Black background) +the quick brown fox Underline Inverse Black (on Black background) +the quick brown fox Inverse Bright Black (on Black background) +the quick brown fox Inverse Underline Black (on Black background) +the quick brown fox Bright Underline Red (on Black background) +the quick brown fox Bright Inverse Red (on Black background) +the quick brown fox Underline Bright Red (on Black background) +the quick brown fox Underline Inverse Red (on Black background) +the quick brown fox Inverse Bright Red (on Black background) +the quick brown fox Inverse Underline Red (on Black background) +the quick brown fox Bright Underline Green (on Black background) +the quick brown fox Bright Inverse Green (on Black background) +the quick brown fox Underline Bright Green (on Black background) +the quick brown fox Underline Inverse Green (on Black background) +the quick brown fox Inverse Bright Green (on Black background) +the quick brown fox Inverse Underline Green (on Black background) +the quick brown fox Bright Underline Yellow (on Black background) +the quick brown fox Bright Inverse Yellow (on Black background) +the quick brown fox Underline Bright Yellow (on Black background) +the quick brown fox Underline Inverse Yellow (on Black background) +the quick brown fox Inverse Bright Yellow (on Black background) +the quick brown fox Inverse Underline Yellow (on Black background) +the quick brown fox Bright Underline Blue (on Black background) +the quick brown fox Bright Inverse Blue (on Black background) +the quick brown fox Underline Bright Blue (on Black background) +the quick brown fox Underline Inverse Blue (on Black background) +the quick brown fox Inverse Bright Blue (on Black background) +the quick brown fox Inverse Underline Blue (on Black background) +the quick brown fox Bright Underline Magenta (on Black background) +the quick brown fox Bright Inverse Magenta (on Black background) +the quick brown fox Underline Bright Magenta (on Black background) +the quick brown fox Underline Inverse Magenta (on Black background) +the quick brown fox Inverse Bright Magenta (on Black background) +the quick brown fox Inverse Underline Magenta (on Black background) +the quick brown fox Bright Underline Cyan (on Black background) +the quick brown fox Bright Inverse Cyan (on Black background) +the quick brown fox Underline Bright Cyan (on Black background) +the quick brown fox Underline Inverse Cyan (on Black background) +the quick brown fox Inverse Bright Cyan (on Black background) +the quick brown fox Inverse Underline Cyan (on Black background) +the quick brown fox Bright Underline White (on Black background) +the quick brown fox Bright Inverse White (on Black background) +the quick brown fox Underline Bright White (on Black background) +the quick brown fox Underline Inverse White (on Black background) +the quick brown fox Inverse Bright White (on Black background) +the quick brown fox Inverse Underline White (on Black background) +the quick brown fox Bright Underline Black (on Red background) +the quick brown fox Bright Inverse Black (on Red background) +the quick brown fox Underline Bright Black (on Red background) +the quick brown fox Underline Inverse Black (on Red background) +the quick brown fox Inverse Bright Black (on Red background) +the quick brown fox Inverse Underline Black (on Red background) +the quick brown fox Bright Underline Red (on Red background) +the quick brown fox Bright Inverse Red (on Red background) +the quick brown fox Underline Bright Red (on Red background) +the quick brown fox Underline Inverse Red (on Red background) +the quick brown fox Inverse Bright Red (on Red background) +the quick brown fox Inverse Underline Red (on Red background) +the quick brown fox Bright Underline Green (on Red background) +the quick brown fox Bright Inverse Green (on Red background) +the quick brown fox Underline Bright Green (on Red background) +the quick brown fox Underline Inverse Green (on Red background) +the quick brown fox Inverse Bright Green (on Red background) +the quick brown fox Inverse Underline Green (on Red background) +the quick brown fox Bright Underline Yellow (on Red background) +the quick brown fox Bright Inverse Yellow (on Red background) +the quick brown fox Underline Bright Yellow (on Red background) +the quick brown fox Underline Inverse Yellow (on Red background) +the quick brown fox Inverse Bright Yellow (on Red background) +the quick brown fox Inverse Underline Yellow (on Red background) +the quick brown fox Bright Underline Blue (on Red background) +the quick brown fox Bright Inverse Blue (on Red background) +the quick brown fox Underline Bright Blue (on Red background) +the quick brown fox Underline Inverse Blue (on Red background) +the quick brown fox Inverse Bright Blue (on Red background) +the quick brown fox Inverse Underline Blue (on Red background) +the quick brown fox Bright Underline Magenta (on Red background) +the quick brown fox Bright Inverse Magenta (on Red background) +the quick brown fox Underline Bright Magenta (on Red background) +the quick brown fox Underline Inverse Magenta (on Red background) +the quick brown fox Inverse Bright Magenta (on Red background) +the quick brown fox Inverse Underline Magenta (on Red background) +the quick brown fox Bright Underline Cyan (on Red background) +the quick brown fox Bright Inverse Cyan (on Red background) +the quick brown fox Underline Bright Cyan (on Red background) +the quick brown fox Underline Inverse Cyan (on Red background) +the quick brown fox Inverse Bright Cyan (on Red background) +the quick brown fox Inverse Underline Cyan (on Red background) +the quick brown fox Bright Underline White (on Red background) +the quick brown fox Bright Inverse White (on Red background) +the quick brown fox Underline Bright White (on Red background) +the quick brown fox Underline Inverse White (on Red background) +the quick brown fox Inverse Bright White (on Red background) +the quick brown fox Inverse Underline White (on Red background) +the quick brown fox Bright Underline Black (on Green background) +the quick brown fox Bright Inverse Black (on Green background) +the quick brown fox Underline Bright Black (on Green background) +the quick brown fox Underline Inverse Black (on Green background) +the quick brown fox Inverse Bright Black (on Green background) +the quick brown fox Inverse Underline Black (on Green background) +the quick brown fox Bright Underline Red (on Green background) +the quick brown fox Bright Inverse Red (on Green background) +the quick brown fox Underline Bright Red (on Green background) +the quick brown fox Underline Inverse Red (on Green background) +the quick brown fox Inverse Bright Red (on Green background) +the quick brown fox Inverse Underline Red (on Green background) +the quick brown fox Bright Underline Green (on Green background) +the quick brown fox Bright Inverse Green (on Green background) +the quick brown fox Underline Bright Green (on Green background) +the quick brown fox Underline Inverse Green (on Green background) +the quick brown fox Inverse Bright Green (on Green background) +the quick brown fox Inverse Underline Green (on Green background) +the quick brown fox Bright Underline Yellow (on Green background) +the quick brown fox Bright Inverse Yellow (on Green background) +the quick brown fox Underline Bright Yellow (on Green background) +the quick brown fox Underline Inverse Yellow (on Green background) +the quick brown fox Inverse Bright Yellow (on Green background) +the quick brown fox Inverse Underline Yellow (on Green background) +the quick brown fox Bright Underline Blue (on Green background) +the quick brown fox Bright Inverse Blue (on Green background) +the quick brown fox Underline Bright Blue (on Green background) +the quick brown fox Underline Inverse Blue (on Green background) +the quick brown fox Inverse Bright Blue (on Green background) +the quick brown fox Inverse Underline Blue (on Green background) +the quick brown fox Bright Underline Magenta (on Green background) +the quick brown fox Bright Inverse Magenta (on Green background) +the quick brown fox Underline Bright Magenta (on Green background) +the quick brown fox Underline Inverse Magenta (on Green background) +the quick brown fox Inverse Bright Magenta (on Green background) +the quick brown fox Inverse Underline Magenta (on Green background) +the quick brown fox Bright Underline Cyan (on Green background) +the quick brown fox Bright Inverse Cyan (on Green background) +the quick brown fox Underline Bright Cyan (on Green background) +the quick brown fox Underline Inverse Cyan (on Green background) +the quick brown fox Inverse Bright Cyan (on Green background) +the quick brown fox Inverse Underline Cyan (on Green background) +the quick brown fox Bright Underline White (on Green background) +the quick brown fox Bright Inverse White (on Green background) +the quick brown fox Underline Bright White (on Green background) +the quick brown fox Underline Inverse White (on Green background) +the quick brown fox Inverse Bright White (on Green background) +the quick brown fox Inverse Underline White (on Green background) +the quick brown fox Bright Underline Black (on Yellow background) +the quick brown fox Bright Inverse Black (on Yellow background) +the quick brown fox Underline Bright Black (on Yellow background) +the quick brown fox Underline Inverse Black (on Yellow background) +the quick brown fox Inverse Bright Black (on Yellow background) +the quick brown fox Inverse Underline Black (on Yellow background) +the quick brown fox Bright Underline Red (on Yellow background) +the quick brown fox Bright Inverse Red (on Yellow background) +the quick brown fox Underline Bright Red (on Yellow background) +the quick brown fox Underline Inverse Red (on Yellow background) +the quick brown fox Inverse Bright Red (on Yellow background) +the quick brown fox Inverse Underline Red (on Yellow background) +the quick brown fox Bright Underline Green (on Yellow background) +the quick brown fox Bright Inverse Green (on Yellow background) +the quick brown fox Underline Bright Green (on Yellow background) +the quick brown fox Underline Inverse Green (on Yellow background) +the quick brown fox Inverse Bright Green (on Yellow background) +the quick brown fox Inverse Underline Green (on Yellow background) +the quick brown fox Bright Underline Yellow (on Yellow background) +the quick brown fox Bright Inverse Yellow (on Yellow background) +the quick brown fox Underline Bright Yellow (on Yellow background) +the quick brown fox Underline Inverse Yellow (on Yellow background) +the quick brown fox Inverse Bright Yellow (on Yellow background) +the quick brown fox Inverse Underline Yellow (on Yellow background) +the quick brown fox Bright Underline Blue (on Yellow background) +the quick brown fox Bright Inverse Blue (on Yellow background) +the quick brown fox Underline Bright Blue (on Yellow background) +the quick brown fox Underline Inverse Blue (on Yellow background) +the quick brown fox Inverse Bright Blue (on Yellow background) +the quick brown fox Inverse Underline Blue (on Yellow background) +the quick brown fox Bright Underline Magenta (on Yellow background) +the quick brown fox Bright Inverse Magenta (on Yellow background) +the quick brown fox Underline Bright Magenta (on Yellow background) +the quick brown fox Underline Inverse Magenta (on Yellow background) +the quick brown fox Inverse Bright Magenta (on Yellow background) +the quick brown fox Inverse Underline Magenta (on Yellow background) +the quick brown fox Bright Underline Cyan (on Yellow background) +the quick brown fox Bright Inverse Cyan (on Yellow background) +the quick brown fox Underline Bright Cyan (on Yellow background) +the quick brown fox Underline Inverse Cyan (on Yellow background) +the quick brown fox Inverse Bright Cyan (on Yellow background) +the quick brown fox Inverse Underline Cyan (on Yellow background) +the quick brown fox Bright Underline White (on Yellow background) +the quick brown fox Bright Inverse White (on Yellow background) +the quick brown fox Underline Bright White (on Yellow background) +the quick brown fox Underline Inverse White (on Yellow background) +the quick brown fox Inverse Bright White (on Yellow background) +the quick brown fox Inverse Underline White (on Yellow background) +the quick brown fox Bright Underline Black (on Blue background) +the quick brown fox Bright Inverse Black (on Blue background) +the quick brown fox Underline Bright Black (on Blue background) +the quick brown fox Underline Inverse Black (on Blue background) +the quick brown fox Inverse Bright Black (on Blue background) +the quick brown fox Inverse Underline Black (on Blue background) +the quick brown fox Bright Underline Red (on Blue background) +the quick brown fox Bright Inverse Red (on Blue background) +the quick brown fox Underline Bright Red (on Blue background) +the quick brown fox Underline Inverse Red (on Blue background) +the quick brown fox Inverse Bright Red (on Blue background) +the quick brown fox Inverse Underline Red (on Blue background) +the quick brown fox Bright Underline Green (on Blue background) +the quick brown fox Bright Inverse Green (on Blue background) +the quick brown fox Underline Bright Green (on Blue background) +the quick brown fox Underline Inverse Green (on Blue background) +the quick brown fox Inverse Bright Green (on Blue background) +the quick brown fox Inverse Underline Green (on Blue background) +the quick brown fox Bright Underline Yellow (on Blue background) +the quick brown fox Bright Inverse Yellow (on Blue background) +the quick brown fox Underline Bright Yellow (on Blue background) +the quick brown fox Underline Inverse Yellow (on Blue background) +the quick brown fox Inverse Bright Yellow (on Blue background) +the quick brown fox Inverse Underline Yellow (on Blue background) +the quick brown fox Bright Underline Blue (on Blue background) +the quick brown fox Bright Inverse Blue (on Blue background) +the quick brown fox Underline Bright Blue (on Blue background) +the quick brown fox Underline Inverse Blue (on Blue background) +the quick brown fox Inverse Bright Blue (on Blue background) +the quick brown fox Inverse Underline Blue (on Blue background) +the quick brown fox Bright Underline Magenta (on Blue background) +the quick brown fox Bright Inverse Magenta (on Blue background) +the quick brown fox Underline Bright Magenta (on Blue background) +the quick brown fox Underline Inverse Magenta (on Blue background) +the quick brown fox Inverse Bright Magenta (on Blue background) +the quick brown fox Inverse Underline Magenta (on Blue background) +the quick brown fox Bright Underline Cyan (on Blue background) +the quick brown fox Bright Inverse Cyan (on Blue background) +the quick brown fox Underline Bright Cyan (on Blue background) +the quick brown fox Underline Inverse Cyan (on Blue background) +the quick brown fox Inverse Bright Cyan (on Blue background) +the quick brown fox Inverse Underline Cyan (on Blue background) +the quick brown fox Bright Underline White (on Blue background) +the quick brown fox Bright Inverse White (on Blue background) +the quick brown fox Underline Bright White (on Blue background) +the quick brown fox Underline Inverse White (on Blue background) +the quick brown fox Inverse Bright White (on Blue background) +the quick brown fox Inverse Underline White (on Blue background) +the quick brown fox Bright Underline Black (on Magenta background) +the quick brown fox Bright Inverse Black (on Magenta background) +the quick brown fox Underline Bright Black (on Magenta background) +the quick brown fox Underline Inverse Black (on Magenta background) +the quick brown fox Inverse Bright Black (on Magenta background) +the quick brown fox Inverse Underline Black (on Magenta background) +the quick brown fox Bright Underline Red (on Magenta background) +the quick brown fox Bright Inverse Red (on Magenta background) +the quick brown fox Underline Bright Red (on Magenta background) +the quick brown fox Underline Inverse Red (on Magenta background) +the quick brown fox Inverse Bright Red (on Magenta background) +the quick brown fox Inverse Underline Red (on Magenta background) +the quick brown fox Bright Underline Green (on Magenta background) +the quick brown fox Bright Inverse Green (on Magenta background) +the quick brown fox Underline Bright Green (on Magenta background) +the quick brown fox Underline Inverse Green (on Magenta background) +the quick brown fox Inverse Bright Green (on Magenta background) +the quick brown fox Inverse Underline Green (on Magenta background) +the quick brown fox Bright Underline Yellow (on Magenta background) +the quick brown fox Bright Inverse Yellow (on Magenta background) +the quick brown fox Underline Bright Yellow (on Magenta background) +the quick brown fox Underline Inverse Yellow (on Magenta background) +the quick brown fox Inverse Bright Yellow (on Magenta background) +the quick brown fox Inverse Underline Yellow (on Magenta background) +the quick brown fox Bright Underline Blue (on Magenta background) +the quick brown fox Bright Inverse Blue (on Magenta background) +the quick brown fox Underline Bright Blue (on Magenta background) +the quick brown fox Underline Inverse Blue (on Magenta background) +the quick brown fox Inverse Bright Blue (on Magenta background) +the quick brown fox Inverse Underline Blue (on Magenta background) +the quick brown fox Bright Underline Magenta (on Magenta background) +the quick brown fox Bright Inverse Magenta (on Magenta background) +the quick brown fox Underline Bright Magenta (on Magenta background) +the quick brown fox Underline Inverse Magenta (on Magenta background) +the quick brown fox Inverse Bright Magenta (on Magenta background) +the quick brown fox Inverse Underline Magenta (on Magenta background) +the quick brown fox Bright Underline Cyan (on Magenta background) +the quick brown fox Bright Inverse Cyan (on Magenta background) +the quick brown fox Underline Bright Cyan (on Magenta background) +the quick brown fox Underline Inverse Cyan (on Magenta background) +the quick brown fox Inverse Bright Cyan (on Magenta background) +the quick brown fox Inverse Underline Cyan (on Magenta background) +the quick brown fox Bright Underline White (on Magenta background) +the quick brown fox Bright Inverse White (on Magenta background) +the quick brown fox Underline Bright White (on Magenta background) +the quick brown fox Underline Inverse White (on Magenta background) +the quick brown fox Inverse Bright White (on Magenta background) +the quick brown fox Inverse Underline White (on Magenta background) +the quick brown fox Bright Underline Black (on Cyan background) +the quick brown fox Bright Inverse Black (on Cyan background) +the quick brown fox Underline Bright Black (on Cyan background) +the quick brown fox Underline Inverse Black (on Cyan background) +the quick brown fox Inverse Bright Black (on Cyan background) +the quick brown fox Inverse Underline Black (on Cyan background) +the quick brown fox Bright Underline Red (on Cyan background) +the quick brown fox Bright Inverse Red (on Cyan background) +the quick brown fox Underline Bright Red (on Cyan background) +the quick brown fox Underline Inverse Red (on Cyan background) +the quick brown fox Inverse Bright Red (on Cyan background) +the quick brown fox Inverse Underline Red (on Cyan background) +the quick brown fox Bright Underline Green (on Cyan background) +the quick brown fox Bright Inverse Green (on Cyan background) +the quick brown fox Underline Bright Green (on Cyan background) +the quick brown fox Underline Inverse Green (on Cyan background) +the quick brown fox Inverse Bright Green (on Cyan background) +the quick brown fox Inverse Underline Green (on Cyan background) +the quick brown fox Bright Underline Yellow (on Cyan background) +the quick brown fox Bright Inverse Yellow (on Cyan background) +the quick brown fox Underline Bright Yellow (on Cyan background) +the quick brown fox Underline Inverse Yellow (on Cyan background) +the quick brown fox Inverse Bright Yellow (on Cyan background) +the quick brown fox Inverse Underline Yellow (on Cyan background) +the quick brown fox Bright Underline Blue (on Cyan background) +the quick brown fox Bright Inverse Blue (on Cyan background) +the quick brown fox Underline Bright Blue (on Cyan background) +the quick brown fox Underline Inverse Blue (on Cyan background) +the quick brown fox Inverse Bright Blue (on Cyan background) +the quick brown fox Inverse Underline Blue (on Cyan background) +the quick brown fox Bright Underline Magenta (on Cyan background) +the quick brown fox Bright Inverse Magenta (on Cyan background) +the quick brown fox Underline Bright Magenta (on Cyan background) +the quick brown fox Underline Inverse Magenta (on Cyan background) +the quick brown fox Inverse Bright Magenta (on Cyan background) +the quick brown fox Inverse Underline Magenta (on Cyan background) +the quick brown fox Bright Underline Cyan (on Cyan background) +the quick brown fox Bright Inverse Cyan (on Cyan background) +the quick brown fox Underline Bright Cyan (on Cyan background) +the quick brown fox Underline Inverse Cyan (on Cyan background) +the quick brown fox Inverse Bright Cyan (on Cyan background) +the quick brown fox Inverse Underline Cyan (on Cyan background) +the quick brown fox Bright Underline White (on Cyan background) +the quick brown fox Bright Inverse White (on Cyan background) +the quick brown fox Underline Bright White (on Cyan background) +the quick brown fox Underline Inverse White (on Cyan background) +the quick brown fox Inverse Bright White (on Cyan background) +the quick brown fox Inverse Underline White (on Cyan background) +the quick brown fox Bright Underline Black (on White background) +the quick brown fox Bright Inverse Black (on White background) +the quick brown fox Underline Bright Black (on White background) +the quick brown fox Underline Inverse Black (on White background) +the quick brown fox Inverse Bright Black (on White background) +the quick brown fox Inverse Underline Black (on White background) +the quick brown fox Bright Underline Red (on White background) +the quick brown fox Bright Inverse Red (on White background) +the quick brown fox Underline Bright Red (on White background) +the quick brown fox Underline Inverse Red (on White background) +the quick brown fox Inverse Bright Red (on White background) +the quick brown fox Inverse Underline Red (on White background) +the quick brown fox Bright Underline Green (on White background) +the quick brown fox Bright Inverse Green (on White background) +the quick brown fox Underline Bright Green (on White background) +the quick brown fox Underline Inverse Green (on White background) +the quick brown fox Inverse Bright Green (on White background) +the quick brown fox Inverse Underline Green (on White background) +the quick brown fox Bright Underline Yellow (on White background) +the quick brown fox Bright Inverse Yellow (on White background) +the quick brown fox Underline Bright Yellow (on White background) +the quick brown fox Underline Inverse Yellow (on White background) +the quick brown fox Inverse Bright Yellow (on White background) +the quick brown fox Inverse Underline Yellow (on White background) +the quick brown fox Bright Underline Blue (on White background) +the quick brown fox Bright Inverse Blue (on White background) +the quick brown fox Underline Bright Blue (on White background) +the quick brown fox Underline Inverse Blue (on White background) +the quick brown fox Inverse Bright Blue (on White background) +the quick brown fox Inverse Underline Blue (on White background) +the quick brown fox Bright Underline Magenta (on White background) +the quick brown fox Bright Inverse Magenta (on White background) +the quick brown fox Underline Bright Magenta (on White background) +the quick brown fox Underline Inverse Magenta (on White background) +the quick brown fox Inverse Bright Magenta (on White background) +the quick brown fox Inverse Underline Magenta (on White background) +the quick brown fox Bright Underline Cyan (on White background) +the quick brown fox Bright Inverse Cyan (on White background) +the quick brown fox Underline Bright Cyan (on White background) +the quick brown fox Underline Inverse Cyan (on White background) +the quick brown fox Inverse Bright Cyan (on White background) +the quick brown fox Inverse Underline Cyan (on White background) +the quick brown fox Bright Underline White (on White background) +the quick brown fox Bright Inverse White (on White background) +the quick brown fox Underline Bright White (on White background) +the quick brown fox Underline Inverse White (on White background) +the quick brown fox Inverse Bright White (on White background) +the quick brown fox Inverse Underline White (on White background) diff --git a/test/files/run/color.scala b/test/files/run/color.scala new file mode 100644 index 0000000000..a0af8477e7 --- /dev/null +++ b/test/files/run/color.scala @@ -0,0 +1,33 @@ +import scala.tools.util.color._ + +object Test { + // The ones which are somewhat widely supported. + def effects = List(Bright, Underline, Inverse) + + def demo(text: String) = { + def to_s(esc: Ansi): String = esc.atoms map { + case x: AnsiBackground => "" + x + case x => "%-10s" format x + } mkString " " + + def show(esc: Ansi) = println("%s %s".format(text in esc, to_s(esc))) + + println("\n1 color") + for (c <- Ansi.colors) show(c) + println("\n1 effect") + for (e <- Ansi.effects) show(e) + println("\n1 color 1 effect") + for (c <- Ansi.colors; e <- effects) show(c / e) + println("\n2 colors 0 effects") + for (c1 <- Ansi.colors ; c2 <- Ansi.colors) show(c2 on c1) + println("\n2 colors 1 effect") + for (c1 <- Ansi.colors ; c2 <- Ansi.colors ; e1 <- effects) show((c2 on c1) / e1) + println("\n2 colors 2 effects") + for (c1 <- Ansi.colors ; c2 <- Ansi.colors ; e1 <- effects ; e2 <- effects ; if e1 != e2) show((c2 on c1) / e1 / e2) + } + + def main(args: Array[String]): Unit = { + val str = if (args.size > 1) args mkString " " else "the quick brown fox" + demo(str) + } +} -- cgit v1.2.3