Here's a quick way to parse the return string into three separate variables:
foreach {r g b} [winfo rgb . $some_color] break...or if you don't like the "break":
foreach {red green blue} [winfo rgb . "AntiqueWhite"] {}The technique may seem obscure at first, but apparently it's an accepted idiom in TCL [2].
Note that "winfo rgb" is not idempotent (or surjective) over the space of decimal triples. CL believes that the point is that the range space of "winfo rgb" is the display's color palette (is that the right GUI vernacular?), and is thus smaller than the full cartesian product ([0-65535],[0-65535],[0-65535]) one might otherwise expect.This presented with VNC service for which
winfo rgb . #ffff1fffffffis
65535 0 65535rather than the
65535 7967 65535delivered by a better-endowed display.A start to a work-around for this is ...DKF: The result from winfo rgb is a triple that describes the colour that is actually fed into the display hardware. Different display subsystems interpret this in different ways; that VNC server is obviously using a round-down rule on a 15-bit display...