''I don't know who made this code, but it generates a one-[pixel] [GIF] of a specified [color]. This is useful for things like [HTML] [barchart]s, where you can specify the height of a bar by defining the height of a one-pixel image.'' -[FW] (Explain how.) Primitive: proc make_color_dot color { return \x47\x49\x46\x38\x37\x61\x01\x00\x01\x00\x91\x00$color\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3b\x00 # Hmmm. In February 2003, CL couldn't get the sequence # above to work as expected, and resorted instead to set BEFORE "\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00" set AFTER="\x00\x00\x00\x21\xf9\x04\x00\x00\x00\x00\x00\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3b\x00" return $BEFORE$color$AFTER # Presumably someone with enough motivation can track # these back to the pertinent standards. } proc write_color_dot {color filename} { set fp [open $filename w] puts -nonewline $fp [make_color_dot $color] close $fp } write_color_dot \x00\x00\xff\x00 /tmp/gif/green.gif ---- [[Write up Tk example for simply putting color on PhotoImage.]] ---- [Python]ic expression of same: template = [71, 73, 70, 56, 57, 97, 1, 0, 1, 0, 128, 0, 0, 255, 255, 255, 0, 0, 0, 33, 249, 4, 1, 0, 0, 0, 0, 44, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 2, 68, 1, 0, 59] if color: rgb = [63, 127, 255] # will be calculated later template[13:16] = rgb template[22] = 0 # remove transparency ---- Modern Web programming deprecates spacer gif-s in favor of [CSS] positioning. [Tcl might not be viable because it is too hard to hire Tcl-savvy employees]