summaryrefslogtreecommitdiff
path: root/main/xmldoc.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2012-12-10 01:41:50 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2012-12-10 01:41:50 +0000
commitac16a70dce44d714a68b702430171e340b742838 (patch)
tree793931f0055618096c761e21f973641dcb683eca /main/xmldoc.c
parent58b5edbc1ed02437cf67308e081c72014a050c8a (diff)
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 ........ Merged revisions 377509 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 377510 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 377511 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/xmldoc.c')
-rw-r--r--main/xmldoc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/xmldoc.c b/main/xmldoc.c
index 56f1c74f0..225ed6611 100644
--- a/main/xmldoc.c
+++ b/main/xmldoc.c
@@ -358,7 +358,13 @@ char *ast_xmldoc_printable(const char *bwinput, int withcolors)
/* Setup color */
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) {
return NULL;
}