mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-05-06 20:29:52 -07:00
Experimenting with colors.
This commit is contained in:
parent
c9500e023a
commit
b895d4c8f2
4 changed files with 20 additions and 3 deletions
|
@ -73,6 +73,23 @@ class AsciiArt {
|
|||
val spaces = diff / 2 + 1
|
||||
return fill(spaces) + s + fill(spaces + if (diff % 2 == 1) 1 else 0)
|
||||
}
|
||||
|
||||
const val RESET = "\u001B[0m"
|
||||
const val BLACK = "\u001B[30m"
|
||||
const val RED = "\u001B[31m"
|
||||
const val GREEN = "\u001B[32m"
|
||||
const val YELLOW = "\u001B[33m";
|
||||
const val BLUE = "\u001B[34m"
|
||||
const val PURPLE = "\u001B[35m"
|
||||
const val CYAN = "\u001B[36m"
|
||||
const val WHITE = "\u001B[37m"
|
||||
|
||||
private fun wrap(s: String, color: String) = color + s + RESET
|
||||
private fun red(s: String) = wrap(s, RED)
|
||||
private fun yellow(s: String) = wrap(s, YELLOW)
|
||||
|
||||
fun taskColor(s: String) = yellow(s)
|
||||
fun errorColor(s: String) = red(s)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue