Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Tkinter color names/codes

Reply
Thread Tools

Tkinter color names/codes

 
 
Jeff Seale
Guest
Posts: n/a
 
      01-19-2004
I just happend to notice that there are very FEW colors that you have to
generate using #hex codes. But I was wondering, how many colors have names
assigned to them in Tkinter and what are their #hex translations? It'd be
nice to know these so I don't accidentally create a color that already has
a name.
 
Reply With Quote
 
 
 
 
Nuff Said
Guest
Posts: n/a
 
      01-19-2004
On Mon, 19 Jan 2004 20:39:18 +0000, Jeff Seale wrote:

> I just happend to notice that there are very FEW colors that you have to
> generate using #hex codes. But I was wondering, how many colors have names
> assigned to them in Tkinter and what are their #hex translations? It'd be
> nice to know these so I don't accidentally create a color that already has
> a name.


http://wiki.tcl.tk/8606
- list with all named colors in Tcl/Tk

http://wiki.tcl.tk/colors
- W3C names, hex codes and Tcl/Tk names for the
16 HTML 3.2 colors (i.e. the basic VGA set)

HTH / Nuff
 
Reply With Quote
 
 
 
 
Jeff Seale
Guest
Posts: n/a
 
      01-23-2004
Nuff Said <(E-Mail Removed)> wrote in
news(E-Mail Removed):

> On Mon, 19 Jan 2004 20:39:18 +0000, Jeff Seale wrote:
>
>> I just happend to notice that there are very FEW colors that you have
>> to generate using #hex codes. But I was wondering, how many colors
>> have names assigned to them in Tkinter and what are their #hex
>> translations? It'd be nice to know these so I don't accidentally
>> create a color that already has a name.

>
> http://wiki.tcl.tk/8606
> - list with all named colors in Tcl/Tk
>
> http://wiki.tcl.tk/colors
> - W3C names, hex codes and Tcl/Tk names for the
> 16 HTML 3.2 colors (i.e. the basic VGA set)
>
> HTH / Nuff
>


Is it possible to translate all those colors into their #hex combinations?
The ones I know about already are Red #FF0000, Yellow #FFFF00, Green #
00FF00, Cyan #00FFFF, Blue #0000FF, Magenta #FF00FF, White #FFFFFF and
Black #000000.
 
Reply With Quote
 
Cameron Laird
Guest
Posts: n/a
 
      01-23-2004
In article <Xns9478E236A5D3Fjseale18insightbbcom@204.127.204. 17>,
Jeff Seale <(E-Mail Removed)> wrote:
>Nuff Said <(E-Mail Removed)> wrote in

.
.
.
>> http://wiki.tcl.tk/8606
>> - list with all named colors in Tcl/Tk
>>
>> http://wiki.tcl.tk/colors
>> - W3C names, hex codes and Tcl/Tk names for the
>> 16 HTML 3.2 colors (i.e. the basic VGA set)
>>
>> HTH / Nuff
>>

>
>Is it possible to translate all those colors into their #hex combinations?
>The ones I know about already are Red #FF0000, Yellow #FFFF00, Green #
>00FF00, Cyan #00FFFF, Blue #0000FF, Magenta #FF00FF, White #FFFFFF and
>Black #000000.


I'm not sure what you're asking. The references do just
that, in several variations, although they're coded in
Tcl/Tk, rather than Tkinter. Do you realize you can type
$ python
Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
[GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>> l = Tkinter.Label()
>>> l.winfo_rgb("red")

(65535, 0, 0)
>>>

yourself?
--

Cameron Laird <(E-Mail Removed)>
Business: http://www.Phaseit.net
 
Reply With Quote
 
Cameron Laird
Guest
Posts: n/a
 
      01-23-2004
In article <(E-Mail Removed)>, I confused matters with:
.
.
.
> >>> import Tkinter
> >>> l = Tkinter.Label()
> >>> l.winfo_rgb("red")

> (65535, 0, 0)

.
.
.
Ugh. I'm revealing a bad habit I acquired in my Python childhood.
What I *should* have suggested was
import Tkinter
Tkinter.Tk().winfo_rgb("cyan")
The Label() and l chatter was just a distraction, for which I
apologize.
--

Cameron Laird <(E-Mail Removed)>
Business: http://www.Phaseit.net
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the differences between tkinter in windows and Tkinter in theother platform? Hidekazu IWAKI Python 1 12-14-2009 03:44 PM
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
from Tkinter import *,win = Tk() "from Tkinter import *" Pierre Dagenais Python 0 08-03-2008 10:33 PM
Re: [Tkinter-discuss] Please help -- Tkinter Scale widget withDoubleVar is acting weird Jeff Epler Python 0 08-23-2004 02:31 PM
Re: [Tkinter-discuss] Please help -- Tkinter Scale widget withDoubleVar is acting weird Jeff Epler Python 0 08-20-2004 12:07 PM



Advertisments