Skip to content

Instantly share code, notes, and snippets.

View zakhenry's full-sized avatar

Zak Henry zakhenry

View GitHub Profile
@lunatic-fox
lunatic-fox / colors.kt
Created March 11, 2021 03:08
KOTLIN CONSOLE WITH COLORS
//Main constants and functions
const val RC = "\u001b[0m" // Reset foreground and background colors. --> $RC
const val R = "\u001b[7m" // Invert foreground to background. --> $R
const val U = "\u001b[4m" // Underline. --> $U
const val B = "\u001b[1m" // Bold. --> $B
const val I = "\u001b[3m" // Italic. --> $I
const val S = "\u001b[9m" // Strikethrough the text. --> $S
// 256 Colors
fun fg(n:Int) = "\u001b[38;5;${n}m" // Set a foreground color. --> ${fg(40)} //Sets a green color.