segments

package
v0.0.0-...-2a859bb Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Colors = []uint32{
	0xF5ABBAFF,
	0x5ACFFAFF,
	0xF5ABBAFF,
	0xFFFFFFFF,
}

Functions

func RandomColor

func RandomColor() uint32

RandomColor returns a random 32-bit RGBA color from the known palette.

Types

type Colored

type Colored uint32

func NewColored

func NewColored(color uint32) Colored

NewColored makes a new color segment from a string and a 24-bit color.

func NewColorful

func NewColorful(color colorful.Color) Colored

NewColorful returns a color segment from the given colorful.Color.

func NewRandomColored

func NewRandomColored() Colored

NewRandomColored returns a random color segment.

func (Colored) Color

func (color Colored) Color() uint32

type ColoredSegment

type ColoredSegment struct {
	empty.TextSegment
	// contains filtered or unexported fields
}

func NewColoredSegment

func NewColoredSegment(str string, color uint32) ColoredSegment

func NewColorfulSegment

func NewColorfulSegment(str string, color colorful.Color) ColoredSegment

func NewRandomColoredSegment

func NewRandomColoredSegment(str string) ColoredSegment

func (ColoredSegment) AsColorer

func (seg ColoredSegment) AsColorer() text.Colorer

func (ColoredSegment) Bounds

func (seg ColoredSegment) Bounds() (start, end int)

Jump to

Keyboard shortcuts

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