]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/color: add more ESC seq.
authorKarel Zak <kzak@redhat.com>
Wed, 17 Feb 2016 11:17:23 +0000 (12:17 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 17 Feb 2016 11:51:15 +0000 (12:51 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
include/color-names.h
lib/color-names.c
lib/terminal-colors.d.5

index f04bc2ee2eb8bb58ad0e973e02147ea04c441246..f21a0ee1ba2c73bb5de01e5d8077d2ee65d28895 100644 (file)
 
 #define UL_COLOR_WHITE         "\033[1;37m"
 
+
+/* maximal lenght of human readable name of ESC seq. */
+#define UL_COLORNAME_MAXSZ     32
+
 extern const char *color_sequence_from_colorname(const char *str);
 
 #endif /* UTIL_LINUX_COLOR_NAMES_H */
index 923b2f039847dcf12dbfb1e3e2419759d3811751..6a302d56a57bcb6649f9947bb963e7997e76484e 100644 (file)
@@ -24,12 +24,15 @@ const char *color_sequence_from_colorname(const char *str)
 {
        static const struct ul_color_name basic_schemes[] = {
                { "black",      UL_COLOR_BLACK           },
+               { "blink",      UL_COLOR_BLINK           },
                { "blue",       UL_COLOR_BLUE            },
+               { "bold",       UL_COLOR_BOLD            },
                { "brown",      UL_COLOR_BROWN           },
                { "cyan",       UL_COLOR_CYAN            },
                { "darkgray",   UL_COLOR_DARK_GRAY       },
                { "gray",       UL_COLOR_GRAY            },
                { "green",      UL_COLOR_GREEN           },
+               { "halfbright", UL_COLOR_HALFBRIGHT      },
                { "lightblue",  UL_COLOR_BOLD_BLUE       },
                { "lightcyan",  UL_COLOR_BOLD_CYAN       },
                { "lightgray,", UL_COLOR_GRAY            },
@@ -38,6 +41,8 @@ const char *color_sequence_from_colorname(const char *str)
                { "lightred",   UL_COLOR_BOLD_RED        },
                { "magenta",    UL_COLOR_MAGENTA         },
                { "red",        UL_COLOR_RED             },
+               { "reset",      UL_COLOR_RESET,          },
+               { "reverse",    UL_COLOR_REVERSE         },
                { "yellow",     UL_COLOR_BOLD_YELLOW     },
        };
        struct ul_color_name key = { .name = (char *) str }, *res;
index 66ecf2c4860278a3cc283dafb00b1b0e922b7669..f4217a5d8d1732a0504b8aafd058e24b4becba0a 100644 (file)
@@ -94,8 +94,10 @@ The
 is a color name, ASCII color sequences or escape sequences.
 
 .SS Color names
-black, blue, brown, cyan, darkgray, gray, green, lightblue, lightcyan
-lightgray, lightgreen, lightmagenta, lightred, magenta, red and yellow
+black, blink, blue, bold, brown, cyan, darkgray, gray, green, halfbright,
+lightblue, lightcyan, lightgray, lightgreen, lightmagenta, lightred, magenta,
+red, reset, reverse, and yellow.
+
 .SS ANSI color sequences
 The color sequences are composed of sequences of numbers
 separated by semicolons.  The most common codes are: