unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: pipcet@gmail.com, emacs-devel@gnu.org
Subject: Re: master 64e25cd: More robust NS hex colour string parsing
Date: Sat, 13 Jun 2020 18:44:04 +0200	[thread overview]
Message-ID: <82DE05DD-0F2A-4722-AB75-D9D95F58BAF4@acm.org> (raw)
In-Reply-To: <83y2or2c0o.fsf@gnu.org>

13 juni 2020 kl. 17.58 skrev Eli Zaretskii <eliz@gnu.org>:

>> Try (color-values "#123"). The correct result is (#x1111 #x2222 #x3333).
> 
> Why is that the correct value?  I get (#x1010 #x2020 #x3030); why is
> that wrong?

It violates the HTML/CSS convention which was agreed upon in bug#36304 and followed by the other backends. Single-digit hex numbers are scaled by 65535/15, two-digit numbers by 65535/255, and three-digit numbers by 65535/4095.

> Just follow the code, it should be very clear: those two branches
> always return a list of values.  No example should be needed.

An example could help resolve misunderstanding, and if we go back-and-forth on what you think is a simple matter it's a clear sign that one is definitely needed.

> No, that's not true, as should be obvious from examining the code.
> Previously, any "#..." string whose length was 4 or longer would
> return a list of values, even if it wasn't well-formed; now some of
> them will return nil.

(tty-color-values "#xyz") returned nil (and still does), contradicting your claim.

I meant that the manner of rejection remains unchanged, not the set of rejected arguments, which is a consequence of improved error-checking, very much by design.
Not only was it previously lacking, its coverage varied wildly between backends. That means that hardly any code could have abused the lax checking while still working on multiple platforms. Of course, the unpredictable behaviour on malformed input made this a very dubious endeavour in the first place.

> color-values-from-rgb-spec?

Thank you, but that would preclude addition of non-RGB formats in the future, such as HSV or XIE XYZ. Nothing in the interface forces the specification to be RGB. In fact, Xlib accepts several non-RGB formats.




  reply	other threads:[~2020-06-13 16:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200608120746.30163.87810@vcs0.savannah.gnu.org>
     [not found] ` <20200608120747.80E8E20A2E@vcs0.savannah.gnu.org>
2020-06-08 12:26   ` master 64e25cd: More robust NS hex colour string parsing Pip Cet
2020-06-08 16:15     ` Mattias Engdegård
2020-06-12 16:59     ` Mattias Engdegård
2020-06-12 17:33       ` Eli Zaretskii
2020-06-12 19:00         ` Mattias Engdegård
2020-06-12 19:11           ` Eli Zaretskii
2020-06-12 19:25             ` Eli Zaretskii
2020-06-13 10:17             ` Mattias Engdegård
2020-06-13 11:59               ` Eli Zaretskii
2020-06-13 15:39                 ` Mattias Engdegård
2020-06-13 15:58                   ` Eli Zaretskii
2020-06-13 16:44                     ` Mattias Engdegård [this message]
2020-06-13 17:09                       ` Eli Zaretskii
2020-06-13 17:29                         ` Mattias Engdegård
2020-06-13 17:35                           ` Eli Zaretskii
2020-06-13 17:56                             ` Mattias Engdegård
2020-06-13 18:40                               ` Eli Zaretskii
2020-06-15  8:31                                 ` Mattias Engdegård
2020-06-21  7:48                                   ` Mattias Engdegård
2020-06-21 14:59                                     ` Eli Zaretskii
2020-06-21 19:23                                       ` Mattias Engdegård
2020-06-13 19:15                               ` Basil L. Contovounesios
2020-06-12 19:15           ` Pip Cet
2020-06-13 10:40             ` Mattias Engdegård
2020-06-12 18:33       ` Basil L. Contovounesios
2020-06-13 17:52         ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=82DE05DD-0F2A-4722-AB75-D9D95F58BAF4@acm.org \
    --to=mattiase@acm.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=pipcet@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).