[Top][All Lists]

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

Re: Turning off colorization

From: Yuri Khan
Subject: Re: Turning off colorization
Date: Tue, 11 Nov 2014 08:32:39 +0700

On Tue, Nov 11, 2014 at 12:37 AM, Mirek Kaim <address@hidden> wrote:

> it is website's author responsibility to make it readable. all that's needed 
> is proper display of all the colors defined. in that regard, turning off 
> colorization for terminals unable to report their background color is kinda 
> pointless. all that matters is if 256 colors are supported - because if not, 
> then there's no sure way to display a website in readable manner without 
> discarding all rainbowy stuff. on the other side, if 256 colors are 
> supported, then the current background shouldn't matter and in case of a 
> website display, shouldn't be used at all.

You’re talking about 256 colors as if it were a whole lot.

In fact, 256 is a very limited color space. It includes 16 base
colors, a 6×6×6 color cube, and some 24 shades of gray. The color cube
is typically configured with rather light colors, suitable for use as
foreground on black (hex RGB value starting at 0x5f or something). As
a consequence, there are very few dark non-gray colors in the
256-color palette.

The Web authoring guides of the ’95s talked about “web-safe” colors.
It was assumed these colors could be displayed on any web-enabled
device. Those were defined as a color cube with a linear step of 0x33
for each RGB axis, also giving a 6×6×6 cube, but different from the
xterm defaults.

Web-safe cube: 00 33 66 99 CC FF
xterm cube:    00 5F 87 AF D7 FF

Let’s see how web-safe values are rounded to xterm values.

00 → 00 error 0
33 → 5F error +44 decimal
66 → 5F error -7, notice aliasing
99 → 87 error -18
CC → D7 error +11 notice gap
FF → FF error 0

So the web-safe palette, when approximated in xterm, becomes a 5×5×5
color cube, aliasing the two darker shades of each axis and skipping
the midrange AF value. If anybody uses the 33 and 66 colors as
distinct, well, they are not so distinct any more.

Nowadays, nobody bothers about web-safe colors any more. We have the
Tango palette, the Solarized palette, and a zillion other palettes,
none mapping well to the xterm space.

Instead of coming up with clever heuristics about color remapping, we
had better push for true color support in terminal emulators,
libraries and applications.


reply via email to

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