Improve documentation by making all of the colors used readable,

no matter what the background color is.

Dark blue on a black background is unreadable, as is yellow on a
light background.  This patch turns on the bright attribute for
colors when on a dark background and turns *off* the bright
attribute when the -W command line option is used (indicating a
_light_ background).  This ensures that text is readable in both
cases.

Patch by: tilghman
Review: https://reviewboard.asterisk.org/r/2224


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@377509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2012-12-10 01:38:52 +00:00
parent 6769e186b9
commit dc63fd67d3

View File

@@ -354,7 +354,13 @@ char *ast_xmldoc_printable(const char *bwinput, int withcolors)
/* Setup color */ /* Setup color */
if (withcolors) { if (withcolors) {
ast_term_color_code(&colorized, colorized_tags[c].colorfg, 0); if (ast_opt_light_background) {
/* Turn off *bright* colors */
ast_term_color_code(&colorized, colorized_tags[c].colorfg & 0x7f, 0);
} else {
/* Turn on *bright* colors */
ast_term_color_code(&colorized, colorized_tags[c].colorfg | 0x80, 0);
}
if (!colorized) { if (!colorized) {
return NULL; return NULL;
} }