Initial commit
This commit is contained in:
commit
7db9e36587
8 changed files with 179 additions and 0 deletions
14
Terminal.go
Normal file
14
Terminal.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
package color
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// These constants represent the escape codes needed to display color in terminals.
|
||||
const (
|
||||
format = "\x1b[38;2;%d;%d;%dm%s\x1b[0m"
|
||||
formatLine = format + "\n"
|
||||
)
|
||||
|
||||
// Terminal is a boolean that indicates if we're in a terminal with truecolor support.
|
||||
var Terminal = os.Getenv("COLORTERM") == "truecolor"
|
Loading…
Add table
Add a link
Reference in a new issue