added Ansi class
This commit is contained in:
parent
dedcd1cc70
commit
a234ea59b3
19
src/util/Ansi.scala
Normal file
19
src/util/Ansi.scala
Normal file
@ -0,0 +1,19 @@
|
||||
package util
|
||||
|
||||
object Ansi {
|
||||
val ESC: String = "\u001b["
|
||||
val CLEAR: String = code("0")
|
||||
val BOLD: String = code("1")
|
||||
val FAINT: String = code("2")
|
||||
val ITALIC: String = code("3")
|
||||
val UNDERLINE: String = code("4")
|
||||
val SLOW_BLINK: String = code("5")
|
||||
val RAPID_BLINK: String = code("6")
|
||||
val REVERSE: String = code("7")
|
||||
val CONCEAL: String = code("8")
|
||||
val STRIKETHROUGH: String = code("9")
|
||||
def FG_RGB(r: Int, g: Int, b: Int): String = code(s"38;2;$r;$g;${b}")
|
||||
def BG_RGB(r: Int, g: Int, b: Int): String = code(s"48;2;$r;$g;${b}")
|
||||
|
||||
private def code(str: String): String = ESC+str+"m"
|
||||
}
|
Loading…
Reference in New Issue
Block a user