all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alex Gramiak <agrambot@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Removing assumption of unsigned long pixel values for colours
Date: Sat, 04 May 2019 21:39:25 +0300	[thread overview]
Message-ID: <83a7g2kqsi.fsf@gnu.org> (raw)
In-Reply-To: <87v9yqjdnh.fsf@gmail.com> (message from Alex Gramiak on Sat, 04 May 2019 12:08:34 -0600)

> From: Alex Gramiak <agrambot@gmail.com>
> Date: Sat, 04 May 2019 12:08:34 -0600
> 
> I've attached a WIP patch (for illustrative purposes) creating a new
> union, emacs_color, that removes the single type limitation for the
> internal representation of colours. This approach is intended to be used
> with a new backend that I'm working on which uses a quadruple of
> normalized double values for each colour rather than a single pixel
> value. Using a union would avoid having to frequently convert between
> the two representations.

Can you describe the goal, in terms of the advantages of such a
representation, and the limitations of the existing representation
that it attempts to resolve?  I think whether we want to make this
change depends on what will we gain from the changes.

Thanks.

> * prepare_face_for_display takes in an XGCValues, which assumes unsigned
>   long colour values. On non-X systems that create their own XGCValues,
>   they can just be redefined, but on X that won't work. That means a new
>   struct has to also be defined on X and then copied into an XGCValues
>   in x_create_gc.
> 
> * The colors member of struct image was changed to use the new union,
>   but XFreeColors expects an array of unsigned long pixels. It looks
>   like the colors array is only used when COLOR_TABLE_SUPPORT is
>   defined, so perhaps it could just used unsigned long unconditionally.

The main reason that we use unsigned integers for colors is that this
is how various color systems handle colors.  It isn't an arbitrary
design decision.  By using a different representation we introduce an
extra level of complexity, so it's important to know what will that
gain us.

> Question: In realize_gui_face, why is a defaulted underline colour set
> to 0 when defaulted overline/strike-through colours are set to the
> foreground colour? The comment above the underline case mentions that
> it's the same as the foreground colour, so should it be explicitly set
> there as well?

realize_gui_face just sets a flag, the implementation should be in the
*term.c back-ends.  When that flag is set, the color of the underline
should be disregarded and taken from the current foreground color. On
MS-Windows, the underline changes its color according to the
foreground color of the text it underlines.  Don't you see the same on X?



  reply	other threads:[~2019-05-04 18:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-04 18:08 Removing assumption of unsigned long pixel values for colours Alex Gramiak
2019-05-04 18:39 ` Eli Zaretskii [this message]
2019-05-04 23:04   ` Alex Gramiak
2019-05-05 16:14     ` Eli Zaretskii
2019-05-05 19:35       ` Alex Gramiak
2019-05-06  2:45         ` Eli Zaretskii
2019-05-06 14:13           ` Daniel Pittman
2019-05-06 16:11             ` Alex Gramiak
2019-05-06 16:51               ` Stefan Monnier
2019-05-06 20:03                 ` Alex Gramiak
2019-05-06 15:11           ` Alex Gramiak
2019-05-06 15:45             ` Eli Zaretskii
2019-05-06 16:29               ` Alex Gramiak
2019-05-06 16:54                 ` Eli Zaretskii
2019-05-06 17:14                   ` Alex Gramiak
2019-05-06 17:39                     ` Eli Zaretskii
2019-05-06 18:00                       ` Eli Zaretskii
2019-05-06 19:49                         ` Alex Gramiak
2019-05-07  2:29                           ` Eli Zaretskii
2019-05-06  8:12     ` Alan Third
2019-05-06  9:18       ` mituharu
2019-05-06 15:06       ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=83a7g2kqsi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=agrambot@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.