* Naming new GUI colors?
@ 2010-07-20 8:59 Elena
2010-07-20 22:10 ` Tim X
0 siblings, 1 reply; 17+ messages in thread
From: Elena @ 2010-07-20 8:59 UTC (permalink / raw)
To: help-gnu-emacs
Hello,
is there a way to name new GUI colors in Emacs, and get them listed in
`list-color-display'? Something like this:
(set-named-color "army green" "#4B5320")
ELisp reference only talks about tty.
Thanks.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-20 8:59 Naming new GUI colors? Elena
@ 2010-07-20 22:10 ` Tim X
2010-07-21 11:26 ` Elena
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Tim X @ 2010-07-20 22:10 UTC (permalink / raw)
To: help-gnu-emacs
Elena <egarrulo@gmail.com> writes:
> Hello,
>
> is there a way to name new GUI colors in Emacs, and get them listed in
> `list-color-display'? Something like this:
>
> (set-named-color "army green" "#4B5320")
>
> ELisp reference only talks about tty.
>
I don't believe so. The colour names are derived from the rgb.txt file
(normally in the /etc/X11 directory on most Linux systems. You could
possibly add your own colour names to this file, but it is prtty
extensive already.
Tim
--
tcross (at) rapttech dot com dot au
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-20 22:10 ` Tim X
@ 2010-07-21 11:26 ` Elena
2010-07-22 18:12 ` Giacomo Boffi
2010-07-23 15:46 ` Ted Zlatanov
2 siblings, 0 replies; 17+ messages in thread
From: Elena @ 2010-07-21 11:26 UTC (permalink / raw)
To: help-gnu-emacs
On Jul 20, 10:10 pm, Tim X <t...@nospam.dev.null> wrote:
> Elena <egarr...@gmail.com> writes:
> I don't believe so. The colour names are derived from the rgb.txt file
> (normally in the /etc/X11 directory on most Linux systems. You could
> possibly add your own colour names to this file, but it is prtty
> extensive already.
Thanks for answering.
I guess that modifying /etc/X11/rgb.txt would mean the added colors
will be available system-wide. Worth investigating...
NTEmacs' rgb.txt is into `etc' subfolder.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-20 22:10 ` Tim X
2010-07-21 11:26 ` Elena
@ 2010-07-22 18:12 ` Giacomo Boffi
2010-07-23 15:46 ` Ted Zlatanov
2 siblings, 0 replies; 17+ messages in thread
From: Giacomo Boffi @ 2010-07-22 18:12 UTC (permalink / raw)
To: help-gnu-emacs
Tim X <timx@nospam.dev.null> writes:
> Elena <egarrulo@gmail.com> writes:
>
>> Hello,
>>
>> is there a way to name new GUI colors in Emacs, and get them listed in
>> `list-color-display'? Something like this:
>>
>> (set-named-color "army green" "#4B5320")
>>
>> ELisp reference only talks about tty.
>>
>
> I don't believe so. The colour names are derived from the rgb.txt
> file (normally in the /etc/X11 directory on most Linux systems. You
> could possibly add your own colour names to this file, but it is
> prtty extensive already.
X built with default options from recent (4 or 5 years) reference only
a builtin, as at compile time, rgb database
afaict, no major linux distributions change this particular default (i
tried to change debian mantainers opinion on this respect, but failed)
ciao
g
--
We weren't lovers like that and besides it would still be all right.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-20 22:10 ` Tim X
2010-07-21 11:26 ` Elena
2010-07-22 18:12 ` Giacomo Boffi
@ 2010-07-23 15:46 ` Ted Zlatanov
2010-07-23 16:55 ` despen
2010-07-23 23:50 ` Tim X
2 siblings, 2 replies; 17+ messages in thread
From: Ted Zlatanov @ 2010-07-23 15:46 UTC (permalink / raw)
To: help-gnu-emacs
On Wed, 21 Jul 2010 08:10:03 +1000 Tim X <timx@nospam.dev.null> wrote:
TX> Elena <egarrulo@gmail.com> writes:
>> Hello,
>>
>> is there a way to name new GUI colors in Emacs, and get them listed in
>> `list-color-display'? Something like this:
>>
>> (set-named-color "army green" "#4B5320")
>>
>> ELisp reference only talks about tty.
>>
TX> I don't believe so. The colour names are derived from the rgb.txt file
TX> (normally in the /etc/X11 directory on most Linux systems. You could
TX> possibly add your own colour names to this file, but it is prtty
TX> extensive already.
That seems like a pretty bad limitation, especially where English is not
spoken. Emacs should at least allow naming colors (as opposed to faces)
IMHO.
Ted
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-23 15:46 ` Ted Zlatanov
@ 2010-07-23 16:55 ` despen
2010-07-23 21:04 ` Ted Zlatanov
2010-07-23 23:50 ` Tim X
1 sibling, 1 reply; 17+ messages in thread
From: despen @ 2010-07-23 16:55 UTC (permalink / raw)
To: help-gnu-emacs
Ted Zlatanov <tzz@lifelogs.com> writes:
> On Wed, 21 Jul 2010 08:10:03 +1000 Tim X <timx@nospam.dev.null> wrote:
>
> TX> Elena <egarrulo@gmail.com> writes:
>>> Hello,
>>>
>>> is there a way to name new GUI colors in Emacs, and get them listed in
>>> `list-color-display'? Something like this:
>>>
>>> (set-named-color "army green" "#4B5320")
>>>
>>> ELisp reference only talks about tty.
>>>
>
> TX> I don't believe so. The colour names are derived from the rgb.txt file
> TX> (normally in the /etc/X11 directory on most Linux systems. You could
> TX> possibly add your own colour names to this file, but it is prtty
> TX> extensive already.
>
> That seems like a pretty bad limitation, especially where English is not
> spoken. Emacs should at least allow naming colors (as opposed to faces)
> IMHO.
I think it would be ridiculous for Emacs to go on a color naming spree.
There is already a number of lists of standard color names.
There's one for X11, there's one for html, I'm sure there are lots more.
If you think you have a legitimate name for a new color,
approach one of the groups that already has a list.
Having a color named "army green" with different rbg values will help
no one.
BTW, which army?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-23 16:55 ` despen
@ 2010-07-23 21:04 ` Ted Zlatanov
2010-07-23 23:28 ` despen
2010-07-24 0:01 ` Tim X
0 siblings, 2 replies; 17+ messages in thread
From: Ted Zlatanov @ 2010-07-23 21:04 UTC (permalink / raw)
To: help-gnu-emacs
On Fri, 23 Jul 2010 12:55:54 -0400 despen@verizon.net wrote:
d> Ted Zlatanov <tzz@lifelogs.com> writes:
>> That seems like a pretty bad limitation, especially where English is not
>> spoken. Emacs should at least allow naming colors (as opposed to faces)
>> IMHO.
d> I think it would be ridiculous for Emacs to go on a color naming spree.
This is a user facility (like defface). Emacs only has to provide a
get/set/list API. Emacs will not define new colors (or if it does,
that's a separate discussion).
d> There is already a number of lists of standard color names.
d> There's one for X11, there's one for html, I'm sure there are lots more.
Yes, but none of them have "my favorite red for alerts" which is what a
user would define (in their native language).
Ted
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-23 21:04 ` Ted Zlatanov
@ 2010-07-23 23:28 ` despen
2010-07-24 8:12 ` Giacomo Boffi
2010-07-24 0:01 ` Tim X
1 sibling, 1 reply; 17+ messages in thread
From: despen @ 2010-07-23 23:28 UTC (permalink / raw)
To: help-gnu-emacs
Ted Zlatanov <tzz@lifelogs.com> writes:
> On Fri, 23 Jul 2010 12:55:54 -0400 despen@verizon.net wrote:
>
> d> Ted Zlatanov <tzz@lifelogs.com> writes:
>>> That seems like a pretty bad limitation, especially where English is not
>>> spoken. Emacs should at least allow naming colors (as opposed to faces)
>>> IMHO.
>
> d> I think it would be ridiculous for Emacs to go on a color naming spree.
>
> This is a user facility (like defface). Emacs only has to provide a
> get/set/list API. Emacs will not define new colors (or if it does,
> that's a separate discussion).
Still not convinced Emacs has a "bad" limitation.
User defined colors (if actually useful) should be defined outside
Emacs. Emacs is not the only application using colors.
> d> There is already a number of lists of standard color names.
> d> There's one for X11, there's one for html, I'm sure there are lots more.
>
> Yes, but none of them have "my favorite red for alerts" which is what a
> user would define (in their native language).
The purpose of the color should not be confused with the name of the
color.
(set-face-foreground 'alert-face "PaleVioletRed")
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-23 23:28 ` despen
@ 2010-07-24 8:12 ` Giacomo Boffi
0 siblings, 0 replies; 17+ messages in thread
From: Giacomo Boffi @ 2010-07-24 8:12 UTC (permalink / raw)
To: help-gnu-emacs
despen@verizon.net writes:
> Still not convinced Emacs has a "bad" limitation.
> User defined colors (if actually useful) should be defined outside
> Emacs. Emacs is not the only application using colors.
sadly, recent "out of the box" X11 dropped support for user defined
color names-values
--
Per essere sicura di una notizia però bisogna sempre leggere le
visioni di entrambe le parti. --- B'elanna Torres, in IHC
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-23 21:04 ` Ted Zlatanov
2010-07-23 23:28 ` despen
@ 2010-07-24 0:01 ` Tim X
2010-07-26 13:33 ` Ted Zlatanov
1 sibling, 1 reply; 17+ messages in thread
From: Tim X @ 2010-07-24 0:01 UTC (permalink / raw)
To: help-gnu-emacs
Ted Zlatanov <tzz@lifelogs.com> writes:
> On Fri, 23 Jul 2010 12:55:54 -0400 despen@verizon.net wrote:
>
> d> Ted Zlatanov <tzz@lifelogs.com> writes:
>>> That seems like a pretty bad limitation, especially where English is not
>>> spoken. Emacs should at least allow naming colors (as opposed to faces)
>>> IMHO.
>
> d> I think it would be ridiculous for Emacs to go on a color naming spree.
>
> This is a user facility (like defface). Emacs only has to provide a
> get/set/list API. Emacs will not define new colors (or if it does,
> that's a separate discussion).
>
> d> There is already a number of lists of standard color names.
> d> There's one for X11, there's one for html, I'm sure there are lots more.
>
> Yes, but none of them have "my favorite red for alerts" which is what a
> user would define (in their native language).
>
I agree with despen here.
You can define any colour you want using the existing mechanism by using
the # hex notation. You are not restricted to just using the 'named'
colours.
It would be impossible to define a list of colours with 'spoken' names
that was acceptable to everyone. Your favorite red is not mine. So emacs
provides the ability to use the names that are defined, but also allows
you to use the hex rgb names should you want to define he colour
slightly differently to what is in the rgb database.
There are far more critical issues emacs needs to fix than this one.
However, it is open source, so feel free to contribute your own patches
to provide a different mechanism. Provided it doesn't lose existing
functionality, is well/clearly written and doesn't introduce a whole
heap of bugs or broken functionality, it will probably get added and you
can get that warm fuzzy feeling o having become a contributor!
Tim
--
tcross (at) rapttech dot com dot au
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-24 0:01 ` Tim X
@ 2010-07-26 13:33 ` Ted Zlatanov
2010-07-26 13:50 ` despen
0 siblings, 1 reply; 17+ messages in thread
From: Ted Zlatanov @ 2010-07-26 13:33 UTC (permalink / raw)
To: help-gnu-emacs
On Sat, 24 Jul 2010 10:01:29 +1000 Tim X <timx@nospam.dev.null> wrote:
TX> You can define any colour you want using the existing mechanism by using
TX> the # hex notation. You are not restricted to just using the 'named'
TX> colours.
Most users don't speak hex. I don't want to parse hex every time I look
at my face definitions.
TX> It would be impossible to define a list of colours with 'spoken' names
TX> that was acceptable to everyone. Your favorite red is not mine.
That's the point! Users should be able to define their own favorite
colors! Emacs only has to provide a way to do it!
TX> So emacs provides the ability to use the names that are defined, but
TX> also allows you to use the hex rgb names should you want to define
TX> he colour slightly differently to what is in the rgb database.
None of that will change, but again you're not saying anything to
convince me we don't need custom names.
TX> you can get that warm fuzzy feeling o having become a contributor!
I've had that feeling before and it lasts until the first bug report :)
On Fri, 23 Jul 2010 19:28:25 -0400 despen@verizon.net wrote:
d> The purpose of the color should not be confused with the name of the
d> color.
Colors have no purpose in Emacs, generally speaking. Faces are what
actually gets used and has a purpose. So custom color names are really
a way to make defining faces easier and more readable.
Ted
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-26 13:33 ` Ted Zlatanov
@ 2010-07-26 13:50 ` despen
2010-07-26 19:08 ` Ted Zlatanov
0 siblings, 1 reply; 17+ messages in thread
From: despen @ 2010-07-26 13:50 UTC (permalink / raw)
To: help-gnu-emacs
Ted Zlatanov <tzz@lifelogs.com> writes:
D> On Sat, 24 Jul 2010 10:01:29 +1000 Tim X <timx@nospam.dev.null> wrote:
>
> TX> You can define any colour you want using the existing mechanism by using
> TX> the # hex notation. You are not restricted to just using the 'named'
> TX> colours.
>
> Most users don't speak hex. I don't want to parse hex every time I look
> at my face definitions.
I still can't make any sense of what you are asking for.
Does this do what you want?
(setq my-red "#FF0033")
(set-face-foreground 'default my-red)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-26 13:50 ` despen
@ 2010-07-26 19:08 ` Ted Zlatanov
2010-07-27 14:58 ` Giacomo Boffi
0 siblings, 1 reply; 17+ messages in thread
From: Ted Zlatanov @ 2010-07-26 19:08 UTC (permalink / raw)
To: help-gnu-emacs
On Mon, 26 Jul 2010 09:50:09 -0400 despen@verizon.net wrote:
d> Ted Zlatanov <tzz@lifelogs.com> writes:
D> On Sat, 24 Jul 2010 10:01:29 +1000 Tim X <timx@nospam.dev.null> wrote:
>>
TX> You can define any colour you want using the existing mechanism by using
TX> the # hex notation. You are not restricted to just using the 'named'
TX> colours.
>>
>> Most users don't speak hex. I don't want to parse hex every time I look
>> at my face definitions.
d> Does this do what you want?
d> (setq my-red "#FF0033")
d> (set-face-foreground 'default my-red)
Yes. Amazingly, I never thought of just using a variable there. Thanks.
Ted
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-26 19:08 ` Ted Zlatanov
@ 2010-07-27 14:58 ` Giacomo Boffi
2010-07-27 23:28 ` despen
0 siblings, 1 reply; 17+ messages in thread
From: Giacomo Boffi @ 2010-07-27 14:58 UTC (permalink / raw)
To: help-gnu-emacs
Ted Zlatanov <tzz@lifelogs.com> writes:
> On Mon, 26 Jul 2010 09:50:09 -0400 despen@verizon.net wrote:
>
> d> Does this do what you want?
>
> d> (setq my-red "#FF0033")
> d> (set-face-foreground 'default my-red)
>
> Yes. Amazingly, I never thought of just using a variable there. Thanks.
if you complete on color names, like you do e.g. in customize-face, do
you get my-red in the proposed completions?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-27 14:58 ` Giacomo Boffi
@ 2010-07-27 23:28 ` despen
2010-07-28 13:12 ` Ted Zlatanov
0 siblings, 1 reply; 17+ messages in thread
From: despen @ 2010-07-27 23:28 UTC (permalink / raw)
To: help-gnu-emacs
Giacomo Boffi <giacomo.boffi@polimi.it> writes:
> Ted Zlatanov <tzz@lifelogs.com> writes:
>
>> On Mon, 26 Jul 2010 09:50:09 -0400 despen@verizon.net wrote:
>>
>> d> Does this do what you want?
>>
>> d> (setq my-red "#FF0033")
>> d> (set-face-foreground 'default my-red)
>>
>> Yes. Amazingly, I never thought of just using a variable there. Thanks.
>
> if you complete on color names, like you do e.g. in customize-face, do
> you get my-red in the proposed completions?
Of course not.
Don't go changing the requirements, it took us long enough to get this
far.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-27 23:28 ` despen
@ 2010-07-28 13:12 ` Ted Zlatanov
0 siblings, 0 replies; 17+ messages in thread
From: Ted Zlatanov @ 2010-07-28 13:12 UTC (permalink / raw)
To: help-gnu-emacs
On Tue, 27 Jul 2010 19:28:42 -0400 despen@verizon.net wrote:
d> Giacomo Boffi <giacomo.boffi@polimi.it> writes:
>> Ted Zlatanov <tzz@lifelogs.com> writes:
>>
>>> On Mon, 26 Jul 2010 09:50:09 -0400 despen@verizon.net wrote:
>>>
d> Does this do what you want?
>>>
d> (setq my-red "#FF0033")
d> (set-face-foreground 'default my-red)
>>>
>>> Yes. Amazingly, I never thought of just using a variable there. Thanks.
>>
>> if you complete on color names, like you do e.g. in customize-face, do
>> you get my-red in the proposed completions?
d> Of course not.
d> Don't go changing the requirements, it took us long enough to get this
d> far.
It's a reasonable question. Probably the easiest way is to hook into
anything.el rather than modify the Emacs color completions.
Ted
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Naming new GUI colors?
2010-07-23 15:46 ` Ted Zlatanov
2010-07-23 16:55 ` despen
@ 2010-07-23 23:50 ` Tim X
1 sibling, 0 replies; 17+ messages in thread
From: Tim X @ 2010-07-23 23:50 UTC (permalink / raw)
To: help-gnu-emacs
Ted Zlatanov <tzz@lifelogs.com> writes:
> On Wed, 21 Jul 2010 08:10:03 +1000 Tim X <timx@nospam.dev.null> wrote:
>
> TX> Elena <egarrulo@gmail.com> writes:
>>> Hello,
>>>
>>> is there a way to name new GUI colors in Emacs, and get them listed in
>>> `list-color-display'? Something like this:
>>>
>>> (set-named-color "army green" "#4B5320")
>>>
>>> ELisp reference only talks about tty.
>>>
>
> TX> I don't believe so. The colour names are derived from the rgb.txt file
> TX> (normally in the /etc/X11 directory on most Linux systems. You could
> TX> possibly add your own colour names to this file, but it is prtty
> TX> extensive already.
>
> That seems like a pretty bad limitation, especially where English is not
> spoken. Emacs should at least allow naming colors (as opposed to faces)
> IMHO.
>
I don't believe this is an emacs limitation, but rather a limitation of
how X defines colour names.
Tim
--
tcross (at) rapttech dot com dot au
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2010-07-28 13:12 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-20 8:59 Naming new GUI colors? Elena
2010-07-20 22:10 ` Tim X
2010-07-21 11:26 ` Elena
2010-07-22 18:12 ` Giacomo Boffi
2010-07-23 15:46 ` Ted Zlatanov
2010-07-23 16:55 ` despen
2010-07-23 21:04 ` Ted Zlatanov
2010-07-23 23:28 ` despen
2010-07-24 8:12 ` Giacomo Boffi
2010-07-24 0:01 ` Tim X
2010-07-26 13:33 ` Ted Zlatanov
2010-07-26 13:50 ` despen
2010-07-26 19:08 ` Ted Zlatanov
2010-07-27 14:58 ` Giacomo Boffi
2010-07-27 23:28 ` despen
2010-07-28 13:12 ` Ted Zlatanov
2010-07-23 23:50 ` Tim X
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).