Tkinter color names/codes

J

Jeff Seale

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.
 
N

Nuff Said

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
 
J

Jeff Seale

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.
 
C

Cameron Laird

.
.

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.yourself?
 
C

Cameron Laird

.
.
.
(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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,999
Latest member
MakersCBDGummiesReview

Latest Threads

Top