Skip to content

Instantly share code, notes, and snippets.

@vodamiro
Created April 11, 2019 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vodamiro/babc7b2a6f9f39b1de66e66248db42d9 to your computer and use it in GitHub Desktop.
Save vodamiro/babc7b2a6f9f39b1de66e66248db42d9 to your computer and use it in GitHub Desktop.
S_A_SingleExpression3.kt
fun parseColor(color: String) = when (color.toLowerCase()) {
"red" -> "#f00"
"green" -> "#0f0"
"blue" -> "#00f"
else -> "#fff"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment