Evaluated proc ansi:closest {hex list} { set h ""; set d 16777215; map $list {x { set d2 [hex_distance $hex $x]; if {$d2 < $d} {set d $d2; set h $x }  }}; . $h }