]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Improved test output.
authorBruno Haible <bruno@clisp.org>
Tue, 2 Jan 2007 19:55:00 +0000 (19:55 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:14:35 +0000 (12:14 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/color.c

index 7a7de7ceffcf1298ccb23705772e4658603076c2..a1e53a5ebc7351ccfb9e3243bcea4643a253000c 100644 (file)
@@ -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.
index b1ce02471954cd5c661a6c8360ec8cbf53aa9d52..cde37528eac917830dec670b5cd6dafe9035567a 100644 (file)
@@ -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);
 }