color

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANSI_4  uint8 = 4
	ANSI_8  uint8 = 8
	ANSI_24 uint8 = 24
)

Variables

View Source
var AVAILABLE_OPTIONS = map[string]AvailableOption{
	"bold":       {/* contains filtered or unexported fields */},
	"underscore": {/* contains filtered or unexported fields */},
	"blink":      {/* contains filtered or unexported fields */},
	"reverse":    {/* contains filtered or unexported fields */},
	"conceal":    {/* contains filtered or unexported fields */},
}
View Source
var BRIGHT_COLORS = map[string]int{
	"gray":           0,
	"bright-red":     1,
	"bright-green":   2,
	"bright-yellow":  3,
	"bright-blue":    4,
	"bright-magenta": 5,
	"bright-cyan":    6,
	"bright-white":   7,
}
View Source
var COLORS = map[string]int{
	"black":   0,
	"red":     1,
	"green":   2,
	"yellow":  3,
	"blue":    4,
	"magenta": 5,
	"cyan":    6,
	"white":   7,
	"default": 9,
}

Functions

func ColorMode

func ColorMode() uint8

func ConvertFromHexToAnsiColorCode

func ConvertFromHexToAnsiColorCode(mode uint8, hexColor string) (string, error)

Types

type AvailableOption

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

type Color

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

func NewColor

func NewColor(foreground string, background string, options []string) *Color

func (*Color) Apply

func (c *Color) Apply(text string) string

func (*Color) Set

func (c *Color) Set() string

func (*Color) Unset

func (c *Color) Unset() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳