summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-01-02 19:55:00 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:14:35 +0200
commitbf4bcb572fbd889e7432a9134ea58ce9ed4f127a (patch)
treeeeec0c6d92583e953bd2680829e67c884b25f44b
parent59a02c1ebcc1f2ecaabf4de77dbf4cd44a1af073 (diff)
downloadexternal_gettext-bf4bcb572fbd889e7432a9134ea58ce9ed4f127a.zip
external_gettext-bf4bcb572fbd889e7432a9134ea58ce9ed4f127a.tar.gz
external_gettext-bf4bcb572fbd889e7432a9134ea58ce9ed4f127a.tar.bz2
Improved test output.
-rw-r--r--gettext-tools/src/ChangeLog5
-rw-r--r--gettext-tools/src/color.c101
2 files changed, 106 insertions, 0 deletions
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog
index 7a7de7c..a1e53a5 100644
--- a/gettext-tools/src/ChangeLog
+++ b/gettext-tools/src/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-23 Bruno Haible <bruno@clisp.org>
+
+ * color.c (print_color_test): Print labels before the hue/saturation
+ rectangle. Show also a few lines that mix colors and attributes.
+
2006-12-03 Bruno Haible <bruno@clisp.org>
* msgcat.c: Include color.h.
diff --git a/gettext-tools/src/color.c b/gettext-tools/src/color.c
index b1ce024..cde3752 100644
--- a/gettext-tools/src/color.c
+++ b/gettext-tools/src/color.c
@@ -145,6 +145,7 @@ print_color_test ()
/* Hue from 0 to 1. */
for (row = 0; row <= 17; row++)
{
+ ostream_write_str (stream, row == 0 ? "red: " : " ");
for (col = 0; col <= 64; col++)
{
int r = 255;
@@ -160,6 +161,7 @@ print_color_test ()
/* Hue from 1 to 2. */
for (row = 17; row >= 0; row--)
{
+ ostream_write_str (stream, row == 17 ? "yellow: " : " ");
for (col = 0; col <= 64; col++)
{
int g = 255;
@@ -175,6 +177,7 @@ print_color_test ()
/* Hue from 2 to 3. */
for (row = 0; row <= 17; row++)
{
+ ostream_write_str (stream, row == 0 ? "green: " : " ");
for (col = 0; col <= 64; col++)
{
int g = 255;
@@ -190,6 +193,7 @@ print_color_test ()
/* Hue from 3 to 4. */
for (row = 17; row >= 0; row--)
{
+ ostream_write_str (stream, row == 17 ? "cyan: " : " ");
for (col = 0; col <= 64; col++)
{
int b = 255;
@@ -205,6 +209,7 @@ print_color_test ()
/* Hue from 4 to 5. */
for (row = 0; row <= 17; row++)
{
+ ostream_write_str (stream, row == 0 ? "blue: " : " ");
for (col = 0; col <= 64; col++)
{
int b = 255;
@@ -220,6 +225,8 @@ print_color_test ()
/* Hue from 5 to 6. */
for (row = 17; row >= 0; row--)
{
+ ostream_write_str (stream, row == 17 ? "magenta: " :
+ row == 0 ? "red: " : " ");
for (col = 0; col <= 64; col++)
{
int r = 255;
@@ -279,6 +286,100 @@ print_color_test ()
ostream_write_str (stream, "default \n");
ostream_write_str (stream, "\n");
+ ostream_write_str (stream, "Colors (foreground) mixed with attributes:\n");
+ for (row = 0; row <= 8; row++)
+ {
+ const char *name = colors[row].name;
+ ostream_write_str (stream, name);
+ ostream_write_mem (stream, " ", 7 - strlen (name));
+ term_ostream_set_color (stream, colors[row].c);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_weight (stream, WEIGHT_BOLD);
+ ostream_write_str (stream, "bold");
+ term_ostream_set_weight (stream, WEIGHT_NORMAL);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_posture (stream, POSTURE_ITALIC);
+ ostream_write_str (stream, "italic");
+ term_ostream_set_posture (stream, POSTURE_NORMAL);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_underline (stream, UNDERLINE_ON);
+ ostream_write_str (stream, "underlined");
+ term_ostream_set_underline (stream, UNDERLINE_OFF);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_color (stream, COLOR_DEFAULT);
+ ostream_write_str (stream, "\n ");
+ term_ostream_set_color (stream, colors[row].c);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_weight (stream, WEIGHT_BOLD);
+ term_ostream_set_posture (stream, POSTURE_ITALIC);
+ ostream_write_str (stream, "bold+italic");
+ term_ostream_set_weight (stream, WEIGHT_NORMAL);
+ term_ostream_set_posture (stream, POSTURE_NORMAL);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_weight (stream, WEIGHT_BOLD);
+ term_ostream_set_underline (stream, UNDERLINE_ON);
+ ostream_write_str (stream, "bold+underl");
+ term_ostream_set_weight (stream, WEIGHT_NORMAL);
+ term_ostream_set_underline (stream, UNDERLINE_OFF);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_posture (stream, POSTURE_ITALIC);
+ term_ostream_set_underline (stream, UNDERLINE_ON);
+ ostream_write_str (stream, "italic+underl");
+ term_ostream_set_posture (stream, POSTURE_NORMAL);
+ term_ostream_set_underline (stream, UNDERLINE_OFF);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_color (stream, COLOR_DEFAULT);
+ ostream_write_str (stream, "\n");
+ }
+ ostream_write_str (stream, "\n");
+
+ ostream_write_str (stream, "Colors (background) mixed with attributes:\n");
+ for (row = 0; row <= 8; row++)
+ {
+ const char *name = colors[row].name;
+ ostream_write_str (stream, name);
+ ostream_write_mem (stream, " ", 7 - strlen (name));
+ term_ostream_set_bgcolor (stream, colors[row].c);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_weight (stream, WEIGHT_BOLD);
+ ostream_write_str (stream, "bold");
+ term_ostream_set_weight (stream, WEIGHT_NORMAL);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_posture (stream, POSTURE_ITALIC);
+ ostream_write_str (stream, "italic");
+ term_ostream_set_posture (stream, POSTURE_NORMAL);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_underline (stream, UNDERLINE_ON);
+ ostream_write_str (stream, "underlined");
+ term_ostream_set_underline (stream, UNDERLINE_OFF);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_bgcolor (stream, COLOR_DEFAULT);
+ ostream_write_str (stream, "\n ");
+ term_ostream_set_bgcolor (stream, colors[row].c);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_weight (stream, WEIGHT_BOLD);
+ term_ostream_set_posture (stream, POSTURE_ITALIC);
+ ostream_write_str (stream, "bold+italic");
+ term_ostream_set_weight (stream, WEIGHT_NORMAL);
+ term_ostream_set_posture (stream, POSTURE_NORMAL);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_weight (stream, WEIGHT_BOLD);
+ term_ostream_set_underline (stream, UNDERLINE_ON);
+ ostream_write_str (stream, "bold+underl");
+ term_ostream_set_weight (stream, WEIGHT_NORMAL);
+ term_ostream_set_underline (stream, UNDERLINE_OFF);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_posture (stream, POSTURE_ITALIC);
+ term_ostream_set_underline (stream, UNDERLINE_ON);
+ ostream_write_str (stream, "italic+underl");
+ term_ostream_set_posture (stream, POSTURE_NORMAL);
+ term_ostream_set_underline (stream, UNDERLINE_OFF);
+ ostream_write_str (stream, "|normal|");
+ term_ostream_set_bgcolor (stream, COLOR_DEFAULT);
+ ostream_write_str (stream, "\n");
+ }
+ ostream_write_str (stream, "\n");
+
ostream_free (stream);
}