For example, below is the settings page of a terminal app "Tilix". Why are there two of each colour?
-
It's not two of each colour, it's 'muted' & 'bright' alternatives. Some people love bright colours, others hate them [I'm in the latter camp.]– TetsujinMay 3, 2023 at 8:03
-
Which of the "muted" or "bright" do console apps use, and when?– Damn VegetablesMay 3, 2023 at 8:05
-
All of them. Some of the time. For example see man7.org/linux/man-pages/man5/dir_colors.5.html– RedGrittyBrickMay 3, 2023 at 9:59
2 Answers
This is not a standalone answer, but I try to continue @Destroy666's answer and dig deeper on the "why".
As the rest of computers, monitors/terminals also improved in small steps during the decades. In the transition from the first monochrome ones, to the ones with millions of tiny little pixels of 3x10-bit (or so) color depth, there was an inevitable step of starting to support some colors.
At one of the important milestones, red, blue and green subpixels were already available, but memory was still quite a limiting factor. It was a pretty natural approach to devote 2 bytes to represent each character cell. One for the letter (way before Unicode, a single 8-bit codepage at a time), and one for the graphical attributes.
You get the basic 8 colors by being able to decide for each of the R, G, B whether to light up that pixel or not. You do this for the foreground and the background colors, that's 6 bits. You still have 2 bits left.
Presumably going for more extra storage (e.g. 4 bytes for each character cell rather than 2) in order to have many more colors would have been unrealistic at this milestone, would have significally complicated the architecture and increased the cost. However, engineers could not just waste those 2 bits either.
So the obvious idea is to add one bit for the color intensity, resulting in RGBI, the palette your question is about.
Now, some systems surely have added one for the foreground and one for the background. Some others added one for the foreground and used the 8th one for something else (i.e. the background always was the faint one of the color pair), this is what the standard 80×25 VGA text mode did (and probably still does to this day). ZX Spectrum (completely irrelevant when it comes to terminal emulation) had a single intensity bit affecting both the foreground and the background, and the 8th bit was for blinking.
So a whole lot of confusion began as to whether we're talking about 8 or 16 colors, how they relate to the existing ambiguous "bold or bright" property, how to make the bright ones available for background, and so on and so forth, but this is another story.
I guess it was around this time that hardware terminals got mostly replaced by graphical terminal emulators, and they weren't eager in keeping up with the hardware's capabilities. 16 colors were (and still are) good enough for most use cases in terminal emulators. 256 color extension in terminal emulators started to get somewhat widespread in the late '00s, and 16M truecolor extension in the '10s, although typical PC videocards/monitors already supported truecolor around the millennium.
The legacy of using these 16 "main" RGBI colors carries on still today, and probably will forever. However, there's absolutely no consensus on the exact shade of colors. A truly problematic one is dark blue: People want it to be readable on black background, and want it to also work as a nice background color (as e.g. in mc
). And these two pretty much contradict each other. Another standard confusion is around yellow, typically the dark variant is brown, it's hard to pick two shades that are referred to by the same word (e.g. darker and brigher yellow) by humans, let alone preferably the darker tone being readable on white background. That's why their exact shade is configurable in the vast majority of the graphical terminal emulators.
This is because traditionally ANSI escape sequences had colors defined as 8 basic colors (black, red, green, yellow, blue, magenta, cyan, white) and their bright equivalents, such as "bright black", which is simply weirdly named gray. This old standard was later extended to support more and more colors. Read the colors section of Wikipedia for more info.
However, a lot of terminal apps either stuck to the basic 4-bit 16-color set or let you remap just that set, because it is commonly used by many popular CLI applications for backwards compatibility purposes.
As for the configuration part, it's there so that you can e.g. change the default bright yellow to something darker if the brightness annoys you. Or if you want to change the background of the window and the default colors don't fit it.
Also note that in case of your chosen terminal (Tilix) the Colour palette
setting is a bit confusing in terms of UI/UX. The column grouping suggests as if the chosen colors were related to background/foreground specifically, but they're not, it changes them for both.