foreach world $worlds { set name [dict get $world "name"] set score [dict get $world "score"] set color [dict get $world "color"] if { $color == "Red" } { set nameColor ["\004"$name"\004"] } elseif { $color == "Green" } { set nameColor ["\003"$name"\003"] } elseif { $color == "Blue" } { set nameColor ["\002"$name"\002"] } set output "$output$nameColor: $score, " }