t

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: Apache-2.0 Imports: 2 Imported by: 9

Documentation

Overview

Package t provides functionality to transform (change) cells in the console.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackgroundTransform

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

BackgroundTransform sets the background color of a cell

func Background

func Background(newBackground concolor.Color) BackgroundTransform

Background creates a new transformer that sets the background color of a cell to the given color

func (BackgroundTransform) Transform

func (b BackgroundTransform) Transform(cell *ramen.Cell) error

Transform sets the background color of a cell

type CellTransform added in v0.2.0

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

CellTransform sets the whole value of a cell

func Cell added in v0.2.0

func Cell(newValue ramen.Cell) CellTransform

Cell creates a transformer that sets the whole value of the cell

func (CellTransform) Transform added in v0.2.0

func (c CellTransform) Transform(cell *ramen.Cell) error

Transform sets the whole value of a cell

type CharTransform

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

CharTransform sets the char value of a cell

func Char

func Char(newValue int) CharTransform

Char creates a transformer that sets the cells char value to the given int

func CharByte

func CharByte(newValue byte) CharTransform

CharByte creates a transformer that sets the cells char value to the given byte

func CharRune

func CharRune(newValue rune) CharTransform

CharRune creates a transformer that sets the cells char value to the given rune

func (CharTransform) Transform

func (c CharTransform) Transform(cell *ramen.Cell) error

Transform sets the char value of a cell

type ForegroundTransform

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

ForegroundTransform sets the foreground color of a cell

func Foreground

func Foreground(newBackground concolor.Color) ForegroundTransform

Foreground creates a new transformer that sets the foreground color of a cell to the given color

func (ForegroundTransform) Transform

func (f ForegroundTransform) Transform(cell *ramen.Cell) error

Transform sets the foreground color of a cell

type Transformer

type Transformer interface {
	Transform(cell *ramen.Cell) error
}

Transformer is a interface that specifies transformations (changes) that can be applied to cells in a console

Jump to

Keyboard shortcuts

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