[Tutor] font colours

Alan Gauld alan.gauld at btinternet.com
Tue Jul 10 22:08:17 CEST 2007


"Dave Pata" <patoot_rulz at hotmail.com> wrote 

> I am currently doing an assignment for school using python 
> and im at the stage of make it look good and i need more 
> colours. 

More colours rarely means it looks good, just garish!
Good UI's are built by following style guidelines that
allow the user to configure the colors which means 
the programmer sticks to the standard options - that 
means it should look OK even in shades of grey!. (Or 
he makes the UI skinnable which is a whole new can 
of worms!)

However, if you insist, the Tkinter colours are to some 
extent OS dependant and the names are those used 
by the X server on Unix  type systems. However its 
probably easier to specify colors as RRGGBB hex 
string values (for 256 colours). For ex:

fg = '#FFAA33'
bg = '#1177CC'

Write a small simple canvas application withb a loop and 
timer to see the colours available...

And finally if you insist on taking control of colours at least 
do it through a config file that the users can change it. This 
is particularly important if colour-blind users might be using 
the app - what looks good to you might be unreadable to them!.

> P.S I dont know if this has any effect on matters but 
> i am using the Tkinter toolkit.

Yes, it does make a difference.

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld




More information about the Tutor mailing list