fig

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorBlack   = AnsiColor{30}
	ColorRed     = AnsiColor{31}
	ColorGreen   = AnsiColor{32}
	ColorYellow  = AnsiColor{33}
	ColorBlue    = AnsiColor{34}
	ColorMagenta = AnsiColor{35}
	ColorCyan    = AnsiColor{36}
	ColorWhite   = AnsiColor{37}
)

Terminal AnsiColors

View Source
var TrueColorForAnsiColor = map[AnsiColor]TrueColor{
	ColorBlack:   {0, 0, 0},
	ColorRed:     {255, 65, 54},
	ColorGreen:   {149, 189, 64},
	ColorYellow:  {255, 220, 0},
	ColorBlue:    {0, 116, 217},
	ColorMagenta: {177, 13, 201},
	ColorCyan:    {105, 206, 245},
	ColorWhite:   {255, 255, 255},
}

TrueColorForAnsiColor is TrueColor lookalikes for displaying AnsiColor f.e. with the HTML parser Colors based on http://clrs.cc/

Functions

This section is empty.

Types

type AnsiColor

type AnsiColor struct {
	// contains filtered or unexported fields
}

AnsiColor representation

func (AnsiColor) GetPrefix

func (ac AnsiColor) GetPrefix() string

func (AnsiColor) GetSuffix

func (ac AnsiColor) GetSuffix() string

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func (*Builder) Append

func (b *Builder) Append(msg string, font string, color Color) error

func (*Builder) String

func (b *Builder) String() string

type Color

type Color interface {
	// GetPrefix returns prefix for ansi color
	GetPrefix() string
	// GetSuffix returns suffix for ansi color
	GetSuffix() string
}

Color has a pre- and a suffix

type TrueColor

type TrueColor struct {
	// contains filtered or unexported fields
}

TrueColor with rgb Attributes

func NewTrueColorFromHexString

func NewTrueColorFromHexString(c string) (*TrueColor, error)

NewTrueColorFromHexString returns a TrueColor object based on a hexadecimal string

func (TrueColor) GetPrefix

func (tc TrueColor) GetPrefix() string

func (TrueColor) GetSuffix

func (tc TrueColor) GetSuffix() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL