graphics

package
Version: v0.0.0-...-9e9632e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResetGraphics          graphicsMode = 0
	Bold                   graphicsMode = 1 // increase brightness
	Faded                  graphicsMode = 2 // lower brightness
	Italics                graphicsMode = 3
	Underlined             graphicsMode = 4
	SlowFlashing           graphicsMode = 5
	FastFlashing           graphicsMode = 6
	Negative               graphicsMode = 7
	Hidden                 graphicsMode = 8
	CrossedOut             graphicsMode = 9
	DefaultFont            graphicsMode = 10
	AlternativeFont        graphicsMode = 11 // plus 1 - 2 alt font - not checked
	BoldAndUnderlined      graphicsMode = 21
	ResetBoldAndBrightness graphicsMode = 22
	ResetItalics           graphicsMode = 23
	ResetUnderlined        graphicsMode = 24
	ResetFlashing          graphicsMode = 25
	ResetNegative          graphicsMode = 27
	ResetHidden            graphicsMode = 28
	ResetCrossedOut        graphicsMode = 29

	ResetForegroundColor graphicsMode = 39

	ResetBackgroundColor graphicsMode = 49
)
View Source
const (
	Black   color = 0
	Red     color = 1
	Green   color = 2
	Yellow  color = 3
	Blue    color = 4
	Magenta color = 5
	Cyan    color = 6
	White   color = 7
	NoColor color = 8
)
View Source
const (
	ClearAfterCursor  clearMode = 0 // 0 - clears all from cursors position to the end of terminal
	ClearBeforeCursor clearMode = 1 // 1 - clears all from cursors position to the start of terminal
	ClearAll          clearMode = 2 // 2 - clears all
)
View Source
const (
	ClearLineAfterCursor  clearLineMode = 0 // 0 - clears all from cursors position to the end of Line
	ClearLineBeforeCursor clearLineMode = 1 // 1 - clears all from cursors position to the start of line
	ClearAllLine          clearLineMode = 2 // 2 - clears all line
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClearLineMode

type ClearLineMode interface {
	// contains filtered or unexported methods
}

type ClearMode

type ClearMode interface {
	// contains filtered or unexported methods
}

type Color

type Color interface {
	// contains filtered or unexported methods
}

type Graphics

type Graphics struct {
	types.ConsoleStream
	cursor.Cursor
	// contains filtered or unexported fields
}

func New

func New() *Graphics

func (*Graphics) ClearLine

func (g *Graphics) ClearLine(mode clearLineMode)

func (*Graphics) ClearScreen

func (g *Graphics) ClearScreen(mode ClearMode)

func (*Graphics) DrawRectangle

func (g *Graphics) DrawRectangle(x, y, width, height int, symbol rune) error

func (*Graphics) PrintAt

func (g *Graphics) PrintAt(x, y int, s string, restorePosition bool)

func (*Graphics) ResetBackgroundColor

func (g *Graphics) ResetBackgroundColor()

func (*Graphics) ResetForegroundColor

func (g *Graphics) ResetForegroundColor()

func (*Graphics) SetBackgroundColor

func (g *Graphics) SetBackgroundColor(color Color)

func (*Graphics) SetForegroundColor

func (g *Graphics) SetForegroundColor(color Color)

func (*Graphics) SetGraphics

func (g *Graphics) SetGraphics(modes ...GraphicsMode)

type GraphicsMode

type GraphicsMode interface {
	// contains filtered or unexported methods
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL