nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] A patch for added color support


From: Erik Lundin
Subject: Re: [Nano-devel] A patch for added color support
Date: Sat, 18 Oct 2014 09:22:16 +0200

I for one use the gnome terminal a lot, but sometimes i jump out to a
tty and then i would get pages of unnecessary warnings about colors that
my tty doesn't support. I think it should silently ignore unsupported
colors and revert to the default colors. After all, the extended colors
are just a big bonus.

I've attached some eye candy that nano could produce in a gnome terminal
with the standard color theme.

Does anyone of the main developers read this mail-list?


On Mon, 2014-10-13 at 21:29 +0200, Benno Schulenberg wrote:
> On Sun, Oct 12, 2014, at 13:57, Erik Lundin wrote:
> > there are two approaches to this. Should the colors be silently ignored at
> > draw time if the terminal doesn't support it or should they be ignored at
> > load time?
> 
> At load time, I would say.  When the rcfile defines colours of which the
> current terminal is not capable, parsing the rcfile should print warnings.
> 
> But it seems that that won't work.  I've added the following lines at
> various places in main(), and only get 256 as an answer (instead of 0 and -1)
> when curses mode and the screen have already been initialized:
> 
>     fprintf(stderr, "\n *** Curses colors: %i\n\r", COLORS);
>     fprintf(stderr, "\n *** Color capability: %i\n\n", tgetnum("Co"));
>     sleep(2);
> 
> > I think that if the nanorc file defines colors in foreground or background
> > that's not supported by the terminal, it should revert back to the standard
> > colors for that section. It would be the safe way of being able to read the
> > text. If a user defines the color black as foreground color and then a
> > greenish extended color as background. If the valid color "black" is used
> > as foreground and the standard terminal background color is black, the text
> > would be unreadable.
> 
> Well, when the user is advanced enough to be fiddling with extended
> colors, he or she also knows how to blindly exit from nano when things
> have become unreadable and then readjust the rcfile.  So I would say:
> if an extened colour is not available, go to the nearest colour that is.
> 
> > Here's a wikipedia link that shows the color chart:
> > http://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg
> 
> Nice.  To me it seems unexplainable how the decimal numbers translate
> to a six-digit hexadecimal RGB code.  So a link to the above graphic would
> definitely be useful.  (BTW, in the graphic the used subcodes seem to be
> regular: 00, 5f, 87, af, d7, and ff.  But in the third block there are several
> that say df -- would that be correct?  And if so, what is the logic there?)
> 
> Benno
> 

-- 
Erik Lundin <address@hidden>

Attachment: nano_extended_colors.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]