Skip to content

Instantly share code, notes, and snippets.

@enginebai
Created May 14, 2022 13:56
Show Gist options
  • Save enginebai/31f4371ebd6f71bb8df9fff39bafbff5 to your computer and use it in GitHub Desktop.
Save enginebai/31f4371ebd6f71bb8df9fff39bafbff5 to your computer and use it in GitHub Desktop.
class Ticker {
val lastClosePrice = ...
fun refreshRealTimePrice(price: Double) {
val displayColor = when {
price < lastClosePrice: Colors.GREE
price > lastClosePrice: Colors.RED
price = lastClosePrice: Colors.WHITE
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment