all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Ted Zlatanov'" <tzz@lifelogs.com>, <emacs-devel@gnu.org>
Subject: RE: /srv/bzr/emacs/trunk r102478: shr.el(shr-tag-color-check):Convert colors to hexadecimal withshr-color->hexadecimal.
Date: Wed, 24 Nov 2010 13:00:14 -0800	[thread overview]
Message-ID: <CFFB5B1A9AD444ADA276547C7166817D@us.oracle.com> (raw)
In-Reply-To: <87d3pu617f.fsf@lifelogs.com>

> I also think the two should be merged.  Since color-lab.el is a better
> name IMO, could you and Julien merge hexrgb.el into it?  That would
> require work, obviously, but I think it's well worthwhile.  I 
> will help if necessary.

It sounds like there is no overlap, except for two functions (no, I have not
checked, but others seem to have).  I suggest the following steps, if Yidong
etc. agree:

1. Change any calls of those two functions to use the corresponding hexrgb.el
functions instead.  Then test the color-lab use (the two versions might not be
exactly equivalent, even if they do essentially the same thing).

2. Since there is apparently no other overlap, put all of the code from the two
libraries into a single file.

3. Choose a new file name and fix the name prefixes accordingly. "hexrgb" is
probably not general enough (it is not even general enough for all that it does
now, since the name reflects only RGB, not HSV).  I don't think "color-lab" is a
good name for this general library either; this is not just about CIELAB.

How about just "color.el"?

4. Integrate with Emacs.  This involves adjusting/removing any overlapping
existing stuff - e.g. `read-color' and possibly some facemenu stuff.

However, it is possible that someone might prefer that all of this functionality
not be in the same file.  Some hexrgb.el stuff has already been added to Emacs,
and in different places if I'm not mistaken.  Someone apparently thought it was
a good idea to spread such stuff around.

IOW, someone needs to decide whether all of these functions belong in a library,
and if so whether the functions and vars should have a prefix (e.g.
`foo-read-color' vs `read-color').  And in any case any existing functions that
do the same thing or similar should be removed from Emacs (or merged).

Yidong might want to do #4, since it involves some deciding and he is familiar
with the Emacs `read-color' code and recent changes.


A question I have (no, I still have not looked at color-lab.el; I don't even
know where to find it):

Why not merge only the parts of color-lab.el that involve color manipulations
with hexrgb.el, and keep the rest (e.g. heuristics about readability and
color-blindness, color-vision profiles, HTML use etc.) in a separate Emacs
library?

IOW, _if_ color-lab.el has both (a) general color-manipulation/conversion
functions and (b) application-specific functions that use those general
functions, then wouldn't it make sense to keep the latter separate?  (No, I
don't care - it's just a question.)

I would think that we'd want to keep the merged color-manipulation library for
_only_ color manipulation (and possibly the read-color command).

Otherwise, there is a risk that anything at all having to do with some
particular use of color will get stuffed into it.  It's a slippery slope, once
we start allowing in some applications of color.

From the sound of it, part of color-lab.el (CIE etc.) defines color utility
functions, and part of it uses those functions for particular applications.  In
my code, I separate the the color-manipulation library (hexrgb.el) from its
users (palette.el, eyedrop.el, Icicles, DoReMi).  Doesn't that make sense here
too?

Finally, see my previous mail about other changes and decisions that will be
required in order to include the hexrgb.el code.  E.g., Include eyedrop.el?  If
so, add its code to the new color library or keep it separate?  If not,
hexrgb.el will need to be purged of its few calls to the eyedrop functions.

Reminder: Eyedropper just lets you pick up a foreground or background color at
point or under the mouse pointer.  It can save these colors in two global vars
(foreground, background), which can then be used elsewhere. E.g., hexrgb.el uses
them as color candidates for `hexrgb-read-color'.  This means that you do not
need to know what a color is (its name or its RGB or other components) in order
to use it.

HTH.




  reply	other threads:[~2010-11-24 21:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1PKgZg-0005td-8L@internal.in.savannah.gnu.org>
2010-11-23 19:50 ` /srv/bzr/emacs/trunk r102478: shr.el (shr-tag-color-check): Convert colors to hexadecimal with shr-color->hexadecimal Glenn Morris
2010-11-23 20:24   ` Chong Yidong
2010-11-23 21:14     ` Julien Danjou
2010-11-23 21:31       ` Chong Yidong
2010-11-23 21:38         ` Lars Magne Ingebrigtsen
2010-11-23 22:18           ` Chong Yidong
2010-11-23 22:34             ` Lars Magne Ingebrigtsen
2010-11-24  0:12               ` /srv/bzr/emacs/trunk r102478: shr.el (shr-tag-color-check):Convert " Drew Adams
2010-11-24  9:08                 ` Julien Danjou
2010-11-24 11:35                   ` Eli Zaretskii
2010-11-24 14:46                     ` Stefan Monnier
2010-11-24 15:30                       ` Lennart Borgman
2010-11-24 18:15                         ` Ted Zlatanov
2010-11-24 21:37                           ` Lennart Borgman
2010-11-24 22:19                       ` Lars Magne Ingebrigtsen
2010-11-24 22:41                         ` Use color-tweaking code to improve face defaults? [was: /srv/bzr/emacs/trunk r1...] Drew Adams
2010-11-25  4:53                         ` /srv/bzr/emacs/trunk r102478: shr.el (shr-tag-color-check):Convert colors to hexadecimal with shr-color->hexadecimal Stefan Monnier
2010-12-10 19:19                           ` Ted Zlatanov
2010-11-24 16:15                   ` Drew Adams
2010-11-24 18:11                     ` Ted Zlatanov
2010-11-24 21:00                       ` Drew Adams [this message]
2010-11-24 21:33                         ` /srv/bzr/emacs/trunk r102478: shr.el(shr-tag-color-check):Convert colors to hexadecimal withshr-color->hexadecimal Julien Danjou
2010-11-24 21:51                           ` Drew Adams
2010-11-24 16:29                   ` /srv/bzr/emacs/trunk r102478: shr.el (shr-tag-color-check):Convert colors to hexadecimal with shr-color->hexadecimal Chong Yidong
2010-11-24  0:05             ` Drew Adams
2010-11-24  8:36         ` /srv/bzr/emacs/trunk r102478: shr.el (shr-tag-color-check): Convert " Richard Stallman
2010-11-24 14:42           ` Stefan Monnier
2010-11-23 21:16     ` Lars Magne Ingebrigtsen
2010-11-23 22:19       ` Ted Zlatanov
2010-11-23 21:14   ` Julien Danjou

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=CFFB5B1A9AD444ADA276547C7166817D@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=tzz@lifelogs.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 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.