Re: [dev] [st] [PATCH] Fix colour-model and simplify xloadcols()

From: Christoph Lohmann <20h_AT_r-36.net>
Date: Sat, 24 May 2014 13:50:27 +0200

Greetings.

On Sat, 24 May 2014 13:50:27 +0200 FRIGN <dev_AT_frign.de> wrote:
> Good afternoon,
>
> due to the ongoing discussion about color-handling in st I decided to
> take a look at the code and figured out what the problem was.
>
> What st basically does in xdraws() is to check if a given character is
> bold. If that's the case, certain colour-intervals are brightened up
> with offsets:
>
> 1) [0-7] -> offset 8 (normal system colors, full range)
> 2) [16-195] -> offset 36 (subset of the 256-color-range [16-231])
> 3) [232-251] -> offset 4 (subset of the grayscale-range [232-255])
>
> The behaviour in 1) is sane and expected (check config.h);
> 2) and 3) however suffer from a number of issues:
>
> a) The RGB-scale is non-linear[0].
> [...]
> b) Making bold text lighter doesn't make sense.
> [...]
> c) The offsets are applied to subsets of the full ranges.
> [...]
> d) Consistency

Your arguments are right. A different strategy for the brightening needs
to be implemented, if it should be done right. Maybe it’s just not need‐
ed. Anyone has a use case where the upper colors need to be brightened?

> I wrote this patch to adress two things:
> First, fix xdraws() to make it more consistent and work by a valid
> colour-model (according to the points given above and Eric's patch).
> Second, simplify the loops in xloadcols and other minor simplifications.

Thanks, I’ve applied your patch.


Sincerely,

Christoph Lohmann
Received on Sat May 24 2014 - 13:50:27 CEST

This archive was generated by hypermail 2.3.0 : Sat May 24 2014 - 14:24:11 CEST