char

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package char represent a Char in a terminal

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(c, c2 Charer) bool

Equal returns true if c1 and c2 are equal

Types

type Char

type Char struct {
	Value           string
	ForegroundColor color.Color
	BackgroundColor color.Color
	IsBold          bool
	IsFaint         bool
	IsItalic        bool
	IsUnderline     bool
	IsBlink         bool
	IsInverse       bool
	IsInvisible     bool
	IsCrossed       bool
	IsDouble        bool
}

Char is a concrete implementation of the Charer interface.

func C

func C(ch string) *Char

C returns a char with the value as ch. It is just syntax sugar.

func (*Char) Background

func (c *Char) Background() color.Color

Background returns the backgroundColor of the char

func (c *Char) Blink() bool

Blink returns true if the char should be blinking

func (*Char) Bold

func (c *Char) Bold() bool

Bold returns true if the char is in bold

func (*Char) Content

func (c *Char) Content() string

Content returns the content of the char

func (*Char) Crossed

func (c *Char) Crossed() bool

Crossed returns true if the char should be crossed

func (*Char) Double

func (c *Char) Double() bool

Double returns true if the char should be double underline

func (*Char) Faint

func (c *Char) Faint() bool

Faint returns true if the char is in faint

func (*Char) Foreground

func (c *Char) Foreground() color.Color

Foreground returns the foreground color of the char

func (*Char) Inverse

func (c *Char) Inverse() bool

Inverse returns true if the char should be reverse

func (*Char) Invisible

func (c *Char) Invisible() bool

Invisible returns true if the char should be invisible

func (*Char) Italic

func (c *Char) Italic() bool

Italic returns true if the char is in Italic

func (*Char) Underline

func (c *Char) Underline() bool

Underline returns true if the char is Underline

type Charer

type Charer interface {
	Content() string
	Background() color.Color
	Foreground() color.Color
	Bold() bool
	Faint() bool
	Italic() bool
	Underline() bool
	Blink() bool
	Inverse() bool
	Invisible() bool
	Crossed() bool
	Double() bool
}

Charer represents the properties a char in an Area should have to be able to be represented in a terminal.

Jump to

Keyboard shortcuts

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