Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import Console._
val colours = Seq(BLUE, CYAN, GREEN, MAGENTA, RED, YELLOW)
def rainbow(text: String) = text.zipWithIndex.map{ case (c,i) => colours(i%colours.size)+c }.mkString + RESET
println(rainbow("Yeah cool colours"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.