Evaluated proc hexdist {h1 h2} { set rgb1 [hex2rgb $h1]; set rgb2 [hex2rgb $h2]; expr "sqrt(([first $rgb2]-[first $rgb1])^2 + ([second $rgb2]-[second $rgb1])^2 + ([third $rgb2]-[third $rgb1])^2)"; . $rgb1 | $rgb2 }