You are not logged in.

#1 2013-11-29 15:37:56

Markus00000
Member
Registered: 2011-03-27
Posts: 333

[SOLVED] Terminal: Highlighted text or normal text is unreadable

color3 is used as the background color for highlighted text (e.g. when searching a man page) and as a text color (e.g. when using syntax highlighting for the shell).

This works fine when using a black terminal background. On a white background, bright yellows work as background colors for highlighted text, but normal text in a bright yellow is unreadable on a white background. A darker yellow or orange works fine for normal text, but not as a background color for highlighted text which itself is black.

Is it possible to set different colors for background use and text use, so that color3 is not used for both?

If not, any ideas for a workaround?

Last edited by Markus00000 (2013-11-29 22:02:08)

Offline

#2 2013-11-29 18:56:07

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Terminal: Highlighted text or normal text is unreadable

Markus00000 wrote:

Is it possible to set different colors for background use and text use, so that color3 is not used for both?

Yes, that is what foreground is for. As for color3, it is impossible to say. You haven't included any relevant information, like your $TERM, .Xresources (if your $TERM uses it), DE etc...
Essentially, your current question is unanswerable.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-11-29 20:54:45

Markus00000
Member
Registered: 2011-03-27
Posts: 333

Re: [SOLVED] Terminal: Highlighted text or normal text is unreadable

I didn't include that info because to me it seemed irrelevant: It's independent of the terminal application (e.g. urxvt, xfce4-terminal, termite), desktop environment or window manager (e.g. xmonad, spectrwm) etc. I guess, I simply failed at explaining the issue in a way you could understand, sorry. Let my try again using some images.

Example color scheme for urxvt in .Xresources:

*background: white
*foreground: black

*color0: black
*color1: red3
*color2: green3
*color3: yellow3
*color4: blue2
*color5: magenta3
*color6: cyan3
*color7: gray90
*color8: gray50
*color9: red
*color10: green
*color11: yellow
*color12: rgb:5c/5c/ff
*color13: magenta
*color14: cyan
*color15: white

When color3 is used as a background (e.g. highlighting search results in man pages), contrast is high:

http://i.imgur.com/FIpSmD1.png

When color3 is used as a text color (e.g. when using syntax highlighting in the shell), contrast is low:

http://i.imgur.com/EcjgCU6.png

Depending on the ambient light conditions and the contrast ratio and brightness of the display, this yellow text will be unreadable.

Let's make it darker:

*color3: #cc8800

Now, color3 used as a text color gives higher contrast:

http://i.imgur.com/8ipUiBL.png

On the other hand, color3 used as a background color gives low contrast now:

http://i.imgur.com/1VnnyZy.png

At this point I'm asking:

  • If the same color is used for text and for backgrounds, how can I achieve high contrast in both cases?

  • Is it possible to use different colors for text and backgrounds instead of color3 for both? Like orange for text and yellow for backgrounds?

Last edited by Markus00000 (2013-11-29 20:56:55)

Offline

#4 2013-11-29 21:08:24

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Terminal: Highlighted text or normal text is unreadable

Markus00000 wrote:

At this point I'm asking:

  • If the same color is used for text and for backgrounds, how can I achieve high contrast in both cases?

  • Is it possible to use different colors for text and backgrounds instead of color3 for both? Like orange for text and yellow for backgrounds?

1. You can't: it's the same colour. Or, more specifically, if your foreground and background/highlight colours are the same, the level of contrast will be the same as well... Solution: change one of the colours.

2. Yes. Your question is confusing because you are conflating two (different) uses of the term "background". The terminal background (set in your .Xresources), and the highlight colours for man pages.

The fundamental issue, to my eyes anyway, is that yellow is a terrible foreground colour (unless it is used against a very dark background); there just isn't sufficient contrast.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2013-11-29 22:01:21

Markus00000
Member
Registered: 2011-03-27
Posts: 333

Re: [SOLVED] Terminal: Highlighted text or normal text is unreadable

Ah, now I see why you had a hard time understanding this.

I'll mark this as solved now. Thank you so much for your help!

Offline

Board footer

Powered by FluxBB