Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

16 ANSI colors? #245

Closed
mgeier opened this issue Feb 14, 2016 · 3 comments
Closed

16 ANSI colors? #245

mgeier opened this issue Feb 14, 2016 · 3 comments
Milestone

Comments

@mgeier
Copy link
Contributor

mgeier commented Feb 14, 2016

In #225 I'm proposing to change the LaTeX rendering of a Python exception from

LaTeX rendering before

to

LaTeX rendering after

... which I think is quite an improvement. But I was wondering if we should go a step further ...

ANSI escape sequences allow 16 "default" colors, which are basically 8 distinct colors and then the same 8 colors in a brighter version. Typically, the brighter version is used for bold text, but it can also be used independently (and as a background color).

The Jupyter Notebook, however, only supports 8 default colors and maps the other 8 colors back to the first 8.
Does anyone have an idea why this is done?

What about re-enabling all 16 color but then choosing nice ones?

The exact color values are implementation-defined, their names are: Black Red Green Yellow Blue Magenta Cyan White.
The bright version of "Black" is sometimes called "Darkgray", the "normal" (= dark) version of "Yellow" is sometimes called "Brown", the "normal" (= dark) version of "White" is sometimes called "Gray".
See https://en.wikipedia.org/wiki/ANSI_escape_code#Colors

The currently used CSS classes are ansiblack ansired ansigreen ansiyellow ansiblue ansipurple ansicyan ansigray, which seem to be the "official" names, except "gray" is used instead of "white".
We could just add "bright" versions of those and then choose reasonable default colors in the default CSS.
For LaTeX, we can then probably just use the same color names and the same color values.

Or is this a bad idea?

@takluyver
Copy link
Member

Re only defining 8 colours: I would guess that it was a 'good enough' kind of thing. i.e. once ANSI colour translation was basically working, other things became higher priority and it got forgotten about. Thanks for coming back to this stuff!

@mgeier
Copy link
Contributor Author

mgeier commented Feb 25, 2016

Also, the ANSI color codes 90–97 and 100–107 should be implemented, see #228 (comment).

@mgeier
Copy link
Contributor Author

mgeier commented Apr 17, 2016

This has been implemented in #259, closing.

@mgeier mgeier closed this as completed Apr 17, 2016
@minrk minrk added this to the 4.2 milestone May 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants