Kotlin time (since we're in the JVM context for Clojure)
fun color(word: String, letter: Char, idx: Int) =
when (letter) {
word[idx] -> GREEN
in word -> YELLOW
else -> GRAY
}