all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* "RGB" in color.el
@ 2010-11-26  4:15 Miles Bader
  2010-11-26 11:04 ` Julien Danjou
  0 siblings, 1 reply; 7+ messages in thread
From: Miles Bader @ 2010-11-26  4:15 UTC (permalink / raw)
  To: Julien Danjou; +Cc: emacs-devel

I think the comments in color.el should be a bit more specific about the
term "RGB", since that's ambiguous (e.g., in `color-xyz->rgb', the
comment just says "Converts CIE X Y Z colors to RGB.").

From the code it's pretty clear that what's really meant is "sRGB" so
maybe that term could just be substituted.

[I dunno if it's worth adding something like "(gamma corrected)" as well
-- I guess sRGB without generally refers to the gamma-corrected form,
but it can be very useful to programmers to know whether a quantity has
a certain gamma-correction incorporated, so maybe it's worth stating
explicitly...]

Incidentally, that brings to mind the question: are color numbers in
Emacs generally taken to refer to sRGB?  Is there any mechanism in X to
know...?

-Miles

-- 
Happiness, n. An agreeable sensation arising from contemplating the misery of
another.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "RGB" in color.el
  2010-11-26  4:15 "RGB" in color.el Miles Bader
@ 2010-11-26 11:04 ` Julien Danjou
  2010-11-30  5:42   ` Miles Bader
  2010-12-02 15:01   ` Detlev Zundel
  0 siblings, 2 replies; 7+ messages in thread
From: Julien Danjou @ 2010-11-26 11:04 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 757 bytes --]

On Fri, Nov 26 2010, Miles Bader wrote:

> I think the comments in color.el should be a bit more specific about the
> term "RGB", since that's ambiguous (e.g., in `color-xyz->rgb', the
> comment just says "Converts CIE X Y Z colors to RGB.").
>
> From the code it's pretty clear that what's really meant is "sRGB" so
> maybe that term could just be substituted.

You are right.
I've fixed that, but feel free to come with something even better.

> Incidentally, that brings to mind the question: are color numbers in
> Emacs generally taken to refer to sRGB?  Is there any mechanism in X to
> know...?

It seems it's not sRGB, but just RGB with no color space.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "RGB" in color.el
  2010-11-26 11:04 ` Julien Danjou
@ 2010-11-30  5:42   ` Miles Bader
  2010-12-01 11:13     ` Julien Danjou
  2010-12-02 15:01   ` Detlev Zundel
  1 sibling, 1 reply; 7+ messages in thread
From: Miles Bader @ 2010-11-30  5:42 UTC (permalink / raw)
  To: emacs-devel

Julien Danjou <julien@danjou.info> writes:
>> Incidentally, that brings to mind the question: are color numbers in
>> Emacs generally taken to refer to sRGB?  Is there any mechanism in X to
>> know...?
>
> It seems it's not sRGB, but just RGB with no color space.

Then maybe we should just declare that what emacs uses internally "is"
sRGB?

I don't think the code would need to change, just a note in
comments/docs would do it.

If we want to do useful things with color, it would really help to
assign some more meaning to the quantities being manipulated.

It won't change what's displayed of course, and what's displayed on
systems that don't use sRGB will still be "wrong," but it at least gives
a more precise point[*] at which to address such issues, and a clue how
to do it...

[*] In the window-system interface

Thanks,

-Miles

-- 
  Dinanzi a me non fuor cose create
se non etterne, e io etterno duro.
Lasciate ogne speranza, voi ch'intrate.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "RGB" in color.el
  2010-11-30  5:42   ` Miles Bader
@ 2010-12-01 11:13     ` Julien Danjou
  2010-12-01 13:13       ` Miles Bader
  0 siblings, 1 reply; 7+ messages in thread
From: Julien Danjou @ 2010-12-01 11:13 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

On Tue, Nov 30 2010, Miles Bader wrote:

> I don't think the code would need to change, just a note in
> comments/docs would do it.

I do not see where to add such a comment in color.el actually. Maybe
that's something which should be added in x-color-values docstring?

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "RGB" in color.el
  2010-12-01 11:13     ` Julien Danjou
@ 2010-12-01 13:13       ` Miles Bader
  0 siblings, 0 replies; 7+ messages in thread
From: Miles Bader @ 2010-12-01 13:13 UTC (permalink / raw)
  To: emacs-devel

Julien Danjou <julien@danjou.info> writes:
>> I don't think the code would need to change, just a note in
>> comments/docs would do it.
>
> I do not see where to add such a comment in color.el actually. Maybe
> that's something which should be added in x-color-values docstring?

Yeah, I meant general emacs docs, not color.el particularly.

-Miles

-- 
Quotation, n. The act of repeating erroneously the words of another. The words
erroneously repeated.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "RGB" in color.el
  2010-11-26 11:04 ` Julien Danjou
  2010-11-30  5:42   ` Miles Bader
@ 2010-12-02 15:01   ` Detlev Zundel
  2010-12-02 16:27     ` Julien Danjou
  1 sibling, 1 reply; 7+ messages in thread
From: Detlev Zundel @ 2010-12-02 15:01 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

Hello Julien,

> On Fri, Nov 26 2010, Miles Bader wrote:
>
>> I think the comments in color.el should be a bit more specific about the
>> term "RGB", since that's ambiguous (e.g., in `color-xyz->rgb', the
>> comment just says "Converts CIE X Y Z colors to RGB.").
>>
>> From the code it's pretty clear that what's really meant is "sRGB" so
>> maybe that term could just be substituted.
>
> You are right.
> I've fixed that, but feel free to come with something even better.

You have missed one rename which bit me just now.  The attached patch
fixes that.

Thanks
  Detlev

-- 
Of course my password is the same as my pet's name
My macaw's name was Q47pY!3 and I change it every 90 days
                        -- Trevor Linton

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-The-recent-rename-of-functions-missed-renaming-one-c.patch --]
[-- Type: text/x-diff, Size: 851 bytes --]

From 43a16ab206e58c596dfe7c5819108e81926b703c Mon Sep 17 00:00:00 2001
From: Detlev Zundel <dzu@denx.de>
Date: Thu, 2 Dec 2010 15:57:58 +0100
Subject: [PATCH] The recent rename of functions missed renaming one call.

Signed-off-by: Detlev Zundel <dzu@denx.de>
---
 lisp/gnus/color.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/gnus/color.el b/lisp/gnus/color.el
index 4d3718b..d22a71f 100644
--- a/lisp/gnus/color.el
+++ b/lisp/gnus/color.el
@@ -196,7 +196,7 @@ none is set, `color-d65-xyz' is used."
 
 (defun color-lab->srgb (L a b)
   "Converts CIE L*a*b* to RGB."
-  (apply 'color-xyz->rgb (color-lab->xyz L a b)))
+  (apply 'color-xyz->srgb (color-lab->xyz L a b)))
 
 (defun color-cie-de2000 (color1 color2 &optional kL kC kH)
   "Computes the CIEDE2000 color distance between COLOR1 and COLOR2.
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: "RGB" in color.el
  2010-12-02 15:01   ` Detlev Zundel
@ 2010-12-02 16:27     ` Julien Danjou
  0 siblings, 0 replies; 7+ messages in thread
From: Julien Danjou @ 2010-12-02 16:27 UTC (permalink / raw)
  To: Detlev Zundel; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

On Thu, Dec 02 2010, Detlev Zundel wrote:

> You have missed one rename which bit me just now.  The attached patch
> fixes that.

Already fixed in Gnus, but it has not been synced into Emacs I guess.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-02 16:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-26  4:15 "RGB" in color.el Miles Bader
2010-11-26 11:04 ` Julien Danjou
2010-11-30  5:42   ` Miles Bader
2010-12-01 11:13     ` Julien Danjou
2010-12-01 13:13       ` Miles Bader
2010-12-02 15:01   ` Detlev Zundel
2010-12-02 16:27     ` Julien Danjou

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.