lscolors

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT = "_default"
	SELF    = "_self"
)

Variables

This section is empty.

Functions

func Gray

func Gray(lightness uint8) uint8

Gray converts a scalar of "grayness" to an 8-bit color code

Types

type Colors

type Colors struct {
	File LightDarkMap `json:"file"`
	Dir  DirColors    `json:"dir"`
	Link LinkColors   `json:"link"`
	Size StyleMap     `json:"size"`
	Time TimeColors   `json:"time"`
	Perm PermColors   `json:"perm"`
	Expr ExprColors   `json:"expr"`

	Tabular *TabularColors `json:"tabular"`

	Device *Style `json:"device"`
	Socket *Style `json:"socket"`
	Pipe   *Style `json:"pipe"`

	Stats StatsColors `json:"stats"`
}

type DirColors

type DirColors struct {
	Name       *Style `json:"name"`
	Ext        *Style `json:"ext"`
	HiddenName *Style `json:"hidden_name"`
	HiddenExt  *Style `json:"hidden_name"`
}

type ExprColors

type ExprColors struct {
	String  *Style `json:"string"`
	Integer *Style `json:"integer"`
	Float   *Style `json:"float"`
	Time    *Style `json:"time"`
}

type FolderHeaderColors

type FolderHeaderColors struct {
	Arrow      *Style `json:"arrow"`
	Main       *Style `json:"main"`
	Slash      *Style `json:"slash"`
	LastFolder *Style `json:"last_folder"`
	Error      *Style `json:"error"`
}

type LightDark

type LightDark struct {
	Light *Style `json:"light"`
	Dark  *Style `json:"dark"`
}

func (LightDark) Get

func (ld LightDark) Get() (*Style, *Style)

returns (mainColor, accentColor)

type LightDarkMap

type LightDarkMap map[string]LightDark

type LinkColors

type LinkColors struct {
	Name    *Style `json:"name"`
	NameDir *Style `json:"name_dir"`
	Arrow   *Style `json:"arrow"`
	Path    *Style `json:"path"`
	Broken  *Style `json:"broken"`
}

type PermColors

type PermColors struct {
	User  StyleMap `json:"user"`
	Group StyleMap `json:"group"`
	Other StyleMap `json:"other"`
}

PermColor holds color mappings for users and groups

type StatsColors

type StatsColors struct {
	Text   *Style `json:"text"`
	Number *Style `json:"number"`
	MS     *Style `json:"ms"`
}

type Style

type Style struct {
	Fg   uint8 `json:"fg,omitempty"`
	Bg   uint8 `json:"bg,omitempty"`
	Bold bool  `json:"bold,omitempty"`
}

func Bg

func Bg(code uint8) *Style

Bg wraps an 8-bit background color code in the ANSI escape sequence

func BgGray

func BgGray(lightness uint8) *Style

BgGray converts a scalar of "grayness" to an ANSI-escaped background 8-bit color code

func Fg

func Fg(code uint8) *Style

Fg wraps an 8-bit foreground color code in the ANSI escape sequence

func FgGray

func FgGray(lightness uint8) *Style

FgGray converts a scalar of "grayness" to an ANSI-escaped foreground 8-bit color code

func (*Style) S

func (s *Style) S() string

func (*Style) SetBg

func (s *Style) SetBg(code uint8) *Style

func (*Style) SetBold

func (s *Style) SetBold() *Style

func (*Style) SetFg

func (s *Style) SetFg(code uint8) *Style

type StyleMap

type StyleMap map[string]*Style

func (StyleMap) Default

func (sm StyleMap) Default() *Style

func (StyleMap) Get

func (sm StyleMap) Get(key string) *Style

type TabularColors

type TabularColors struct {
	FolderHeader FolderHeaderColors `json:"folder_header"`
	TableHeader  *Style             `json:"table_header"`
}

type TimeColors

type TimeColors struct {
	Year        *Style `json:"year"`
	Number      *Style `json:"number"`
	NumberColon *Style `json:"number_colon"`
	NumberSlash *Style `json:"number_slash"`
	Word        *Style `json:"word"`
}

Jump to

Keyboard shortcuts

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