Single Textured Tile Painter

written December 1997 being revised June 2006
Google site search

For greater control over colour and also to add texture to the ruler try this painter which uses the Tcl/Tk label widget. Here the border and central (label image) colours are independant allowing for contrasts.Also the image can be dithered, providing for textures.

Tcl now uses "native colour" which means that it no longer relies on the limited palette facilities which it had built into it.On Windows there is full 24 bit colour which gives nice even shading. BUT sometimes it is nice to have grain and texture. This is provided by the image "palette option".

The variety of texture effects is enormous but probably not portable. However I am surprised to find that many of the colour settings I noted in the following tables (from 1996) are still preserved after this change to "native colour". This is probably because when the "palette option" is invoked, Tcl uses its old palette routine, long may it live!
Canvas or linen green=202 blue=202 red>175
green=202 blue=255 red=anything
green=202 blue=92 red=anything
green=202 blue<87 red=anything
green=157 blue=anything red<85
and others.
Knit-1 Perl-1 green=160 blue=anything red<85
and others.
Mahogonyred=187,190,193,196,200,201 green=0 blue=0
I will not update this table to reflect changes caused by new releases. I will wait until I get some feedback on how stable these settings are on different systems.

Driving Instructions

The controls for this Tclet are similar to the controls for the simple frieze painter. There are no sliders for multiple tiles because this Tclet is designed to use texture for effect, rather than lots of tiles.

But the middle column of colour sliders has an additional set of radio buttons. Each radiobutton makes the colour sliders operate in a different mode. In border mode, only the border colour is changed. In image mode only the central tile colour is changed. In palette mode the colour sliders are used to define the number of discrete colour steps to be used in each colour.

The palette mode applies only to the image, which is "painted" into the label. The palette mode restricts each of the red, green and blue colour scales to a specific number of steps. By pressing the "palette" radio button, the colour bars are changed to palette mode with a reduced range from 0 to 15. The theoretical range is 255 but there is little descernible difference between 15 and 255 so I have kept the bar small. The indexes "0" and "1" are equivalent to 255, which is "smooth color". To get texture, all three sliders must be 2 or greater. Best effects are achieved with the sliders set at 2, 3 or 4.

The border is not an "image" and does not have an adjustable palette.

The temp filename is "labelpaint.txt".

The generated code is saved to the temp file texture.txt in two forms. One form is the tclet in Tcl script and the other is an invocation of the tclet texture.tcl. Since the script form is not large and cuts out a SRC reference this is probably the better of the two fragments to include in your code. But if you may feel you would like to alter the size or colour scheme at a later time and do not want to have to mess around with the Tcl code then the SRC fragment may be you best choice.

To use the "SRC=texture.tcl" fragment you need to copy texture.tcl from the Tclet Library.

Since there is no dedicated home for tclets in the Tclet Library a heavy reliance should not be placed on sourcing tclets directly from the library, in case tclets in the library are moved,

©2000 - 2006 WEBSCOOL This page last updated 01 Jun 2006. All rights reserved - including copying or distribution of any portion of this document in any form or on any medium without authorisation. For more regarding the copyright.