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