Documentation
¶
Index ¶
Constants ¶
const ( // NoBackground is used to not change the current background color NoBackground = BackgroundColor(0) // BlackBackground color BlackBackground = BackgroundColor(40) // RedBackground color RedBackground = BackgroundColor(41) // GreenBackground color GreenBackground = BackgroundColor(42) // YellowBackground color YellowBackground = BackgroundColor(43) // BlueBackground color BlueBackground = BackgroundColor(44) // PurpleBackground color PurpleBackground = BackgroundColor(45) // CyanBackground color CyanBackground = BackgroundColor(46) // GrayBackground color GrayBackground = BackgroundColor(47) )
const ( // ResetColors resets foreground and background color ResetColors = Color(0) // NoColor is used to not change the current color NoColor = Color(-1) // Black color Black = Color(30) // Red color Red = Color(31) // Green color Green = Color(32) // Yellow color Yellow = Color(33) // Blue color Blue = Color(34) // Purple color Purple = Color(35) // Cyan color Cyan = Color(36) // Gray color Gray = Color(37) // DarkGray color (bold Black) DarkGray = Color(-30) // BrightRed color (bold Red) BrightRed = Color(-31) // BrightGreen color (bold Green) BrightGreen = Color(-32) // BrightYellow color (bold Yellow) BrightYellow = Color(-33) // BrightBlue color (bold Blue) BrightBlue = Color(-34) // BrightPurple color (bold Purple) BrightPurple = Color(-35) // BrightCyan color (bold Cyan) BrightCyan = Color(-36) // White color (bold Gray) White = Color(-37) )
const ( // CursorSave stores the current cursor position CursorSave = CursorAction(0) // CursorRestore restores the cursor position saved by CursorSave CursorRestore = CursorAction(1) // CursorClearLine clears the rest of the line CursorClearLine = CursorAction(2) // CursorClearScreen clears the screen and positions the cursor at 0,0 CursorClearScreen = CursorAction(3) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BackgroundColor ¶
type BackgroundColor int
BackgroundColor provides ANSI background color support. As Color implements Stringer
you can simply add a color to your print commands like
fmt.Print(BgRed,"Hello world").
func (BackgroundColor) String ¶
func (c BackgroundColor) String() string
String implements the stringer interface for color
type Color ¶
type Color int
Color provides ANSI color support. As Color implements Stringer you can simply add a color to your print commands like fmt.Print(Red,"Hello world").
type CursorAction ¶
type CursorAction int
CursorAction provides ANSI cursor management support. As CursorAction implements Stringer you can simply add a it to your print commands.
func (CursorAction) String ¶
func (c CursorAction) String() string
String implements the stringer interface for CursorAction
type CursorDown ¶
type CursorDown int
CursorDown provides ANSI cursor movement support. As CursorDown implements Stringer you can simply add a it to your print commands like fmt.Print(CursorDown(10),"Hello world").
func (CursorDown) String ¶
func (c CursorDown) String() string
String implements the stringer interface for CursorDown
type CursorLeft ¶
type CursorLeft int
CursorLeft provides ANSI cursor movement support. As CursorLeft implements Stringer you can simply add a it to your print commands like fmt.Print(CursorLeft(10),"Hello world").
func (CursorLeft) String ¶
func (c CursorLeft) String() string
String implements the stringer interface for CursorLeft
type CursorPosition ¶
CursorPosition provides ANSI cursor movement support. As CursorPosition implements Stringer you can simply add a it to your print commands like fmt.Print(CursorPosition{x:0,y:0},"Hello world").
func (CursorPosition) String ¶
func (c CursorPosition) String() string
String implements the stringer interface for CursorPosition
type CursorRight ¶
type CursorRight int
CursorRight provides ANSI cursor movement support. As CursorRight implements Stringer you can simply add a it to your print commands like fmt.Print(CursorRight(10),"Hello world").
func (CursorRight) String ¶
func (c CursorRight) String() string
String implements the stringer interface for CursorRight