Skip to content

Instantly share code, notes, and snippets.

@halfninja
Last active December 20, 2015 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save halfninja/6123695 to your computer and use it in GitHub Desktop.
Save halfninja/6123695 to your computer and use it in GitHub Desktop.
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