Created
December 26, 2021 10:57
-
-
Save pksokolowski/35f7acb63c2ed06f3ea6ba19324a8b09 to your computer and use it in GitHub Desktop.
Colorful print and println for Kotlin for terminals with TrueColor support.
This file contains 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
private const val reset = "\u001b[0m" | |
fun printc(content: String, r: Int, g: Int, b: Int) = print("\u001b[38;2;$r;$g;${b}m" + content + reset) | |
fun printlnc(content: String, r: Int, g: Int, b: Int) = println("\u001b[38;2;$r;$g;${b}m" + content + reset) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment