[dev] [st] Two flaws with ISO 8613-6 colors
The relevant material is on page 49 of the standard.
The first of the two issues is the least concerning:
``A parameter substring for values 38 or 48 may be divided by one or
more separators (03/10) into parameter elements''...
Due to the ``may'', it seems fair to interpret this as allowing either
semicolons or colons to be used to separate the parameters. However, st
only interprets such with the semicolons, which is a flaw.
The second flaw is more severe and is something I'm filing bug reports
with regards to many terminal emulators for:
``If the first parameter element has the value 2, 3, or 4, the second
parameter element specifies a colour space identifier referring to a
colour space definition in the document profile.''
The colour space identifier isn't discussed further in the standard, so
it's reasonable to leave it at its default value. However, st and other
terminals entirely ignore this parameter and interpret it as the third
parameter and all others are shifted as well.
That is to inform you that this is an example of a correct sequence to
form a red, assuming 255 is a permitted value:
CSI 38;2::255:0:0m
However, st and others require this incorrect form to be sent, instead
(ignoring here that st doesn't properly parse with colons used):
CSI 38;2:255:0:0m
Otherwise, the color may be misinterpreted as, say, a green or the color
not changed at all, varying.
The flaws are now clear. Both of these flaws should be trivial to
correct, but I'm not familiar enough with both the st source and the
suckless coding standards to provide a patch quickly and instead simply
report the issue to you. It seems that a quick hack in csiparse(), if
it's passed 38 as the first argument, with later checking that the
control function was SGR and whatnot would be a good way to do this. It
seems the second issue lies in tdefcolor() and could be corrected by
simply changing the indexes for the r, g, and b values in the first case
of the switch statement and also correcting the parameter number check.
Received on Wed May 23 2018 - 23:08:00 CEST
This archive was generated by hypermail 2.3.0
: Wed May 23 2018 - 23:12:19 CEST