Created
August 22, 2019 10:14
-
-
Save shorti1996/c4ba682775fd0382fe56222016e06fb9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Scratch { | |
@JvmStatic | |
fun main() { | |
val colorInt = -5327429 | |
val hexColor = colorIntToHex(colorInt) | |
println("$colorInt is $hexColor") | |
} | |
fun colorIntToHex(colorInt: Int): String { | |
return String.format("#%06X", (0xFFFFFF and colorInt)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment