unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Pip Cet <pipcet@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: master 64e25cd: More robust NS hex colour string parsing
Date: Mon, 8 Jun 2020 18:15:00 +0200	[thread overview]
Message-ID: <EDA5BC75-C2DA-4B86-9D02-55CC65D9CFA2@acm.org> (raw)
In-Reply-To: <CAOqdjBfwzA205fJ75RhFivfNWteCPbwBM4Op+1+pewGZ2e8TiA@mail.gmail.com>

8 juni 2020 kl. 14.26 skrev Pip Cet <pipcet@gmail.com>:

> I believe there's very similar code for the X case, where we also
> translate #fff to rgb:f/f/f. That code has annoyed me lately by
> producing nonsensical GCC warnings, maybe you'd like to replace it
> with yours? Having two different versions of this seems superfluous

Thought crossed my mind too. I'm not sure if it makes sense to share the code that transforms #RRGGBB to rgb:RR/GG/BB; it's not a very natural abstraction, and just why are we doing this string transformation step in the first place.

The X11 backend does it so that it can use Xlib for the rest, which is a dubious saving since the string-munging code isn't much simpler than what would be needed to parse the original string to RGB values right away.

The Windows code looks more robust, except that it appears to apply a funny numeric conversion for 4, 12 and 16 bits/colour. It doesn't look quite right at all.

We should probably have a single, correct parser for the numeric colour strings #RGB, rgb:R/G/B, and rgbi:R/G/B instead of three subtly broken ones. X11 and NS additionally have their own formats that I suppose we need to retain for compatibility.




  reply	other threads:[~2020-06-08 16:15 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 [this message]
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
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=EDA5BC75-C2DA-4B86-9D02-55CC65D9CFA2@acm.org \
    --to=mattiase@acm.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).