Reading a text file in color - text

I have a program that posts messages in different colors, eg: GREEN for info, RED for errors, YELLOW for warnings.
When I print them into a file, I see the codes for begin_color and end_color printed in ASCII.
Is there a text viewer (preferably in Linux) where I can render this codes to their appropriate colors ?

Related

How to send colored terminal text to the printer

Is there a way to convert colored text in the terminal to something printable?
I have an output from icdiff (https://github.com/jeffkaufman/icdiff) that present a colored diff side-by-side in my linux terminal (xterm on debian 9.3). As far as I understand the output is colored using ANSI escape codes. I would like to see the same text with the same colors in a printable document, e.g. pdf. Is that possible? Google gives no usable results.

Which ANSI code should I use to make text muted (dark gray)?

When I use code 1;30m it produces different results:
Xshell 5: gray and bold
PhpStorm terminal: only bold
Windows console: only gray
The goal is to make a part of text to be slightly muted, but if it possible, it should display similarly in most terminal clients.
Anyway I don't understand how "bold" flag can change the foreground color. What am I doing wrong?
ANSI didn't specify that. ANSI listed black, red, etc., and also mentions bold. How a particular terminal displays bold+black is implementation-defined (no standard applies).
"ANSI" refers to x3.64, withdrawn many years ago, replaced by ECMA-48 (aka ISO 6429).
For your amusement:
ECMA-48:
Control Functions for Coded Character Sets
Aren't bright colors the same as bold? (xterm FAQ)
How do I get color with VT100? (ncurses FAQ)
Confirmed, on xterm that displays a muted gray and on emacs it produces black.
You can try a 256-color code like ^[[38;2;85;85;85m (which may also give inconsistent results for the reasons mentioned in #ThomasDickey's linked articles).

IS Google ignoring white text with dark background?

My Website iascoachingindia.in have some coloured boxes with white text on, however background colour is dark and clearly visible to human eye, but I felt Google proffered text which is black in text with white background.
Please anybody have some experienced in the same??
Google can crawl and index all the fonts and color, but the most important thing is to avoid make it spammy by adding the same font color with the same background color.
Also if its with the same color, still Google can access them and index them but you will get a penalty.

Vim on debian: cterm=bold doesn't work (using it over ssh with PuTTy as a client)

I've been trying to get colourschemes to work properly in VIM (on debian) when using it over ssh with PuTTy as a client (from windows7).
Such code from theme hi Search cterm=bold does not work - words are not bold.
I have tried a lot of themes - and I have found no themes with bold words (but using gvim on windows gives me bold words).
I'd appreciate any advice.
PuTTY by default represents bold as a brighter color, but you can change that at Change Settings > Window > Colours > [ ] Bolded text is a different colour. From the help:
Bolded text is a different colour
When the server sends a control sequence indicating that some text should be displayed in bold, PuTTY can handle this two ways. It can either change the font for a bold version, or use the same font in a brighter colour. This control lets you choose which.
By default the box is checked, so non-bold text is displayed in light grey and bold text is displayed in bright white (and similarly in other colours). If you uncheck the box, bold and non-bold text will be displayed in the same colour, and instead the font will change to indicate the difference.

Printing matlab figures in color

When I try to print a matlab figure from red hat 5, it always comes out greyscale, even when I print to file. I can get around this by saving the plot as a PNG and then printing that, but I'd like to be able to print matlab plots directly.
I've tried selecting "color" in the print dialog box and in print preview, but the images still come out greyscale.
How can I get matlab to print in color?
You need to edit the printopt.m file on your system. Specifically, you need to add the line
dev = '-dpsc2';
This sets the printer driver to "color postscript", as opposed to the default printer driver for RHEL which is greyscale postscript.
See this page from the matlab documentation.

Resources