conversion

package
v0.6.10 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlphaChars = [...]rune{
	' ',
	'░',
	'▒',
	'▓',
	'█',
}

AlphaChars contains runes representing alpha levels, from most transparent (lowest index) to most opaque (highest index).

Functions

This section is empty.

Types

type RGBRune

type RGBRune struct {
	R, G, B uint32
	Rune    rune
}

RGBRune represents a colored character.

func RGBRuneFromColor

func RGBRuneFromColor(c color.Color) RGBRune

RGBRuneFromColor converts a color into an RGBRune.

func (RGBRune) RGBA

func (rgb RGBRune) RGBA() (r, g, b, a uint32)

RGBA allows the RGBRune to implement the image/color.Color interface. It returns the RGB values, and an alpha value calculated from its rune.

type RGBRunes

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

RGBRunes is a helper type for a slice of RGBRunes.

func RGBRunesFromImage

func RGBRunesFromImage(i image.Image) RGBRunes

RGBRunesFromImage creates a slice of RGBRunes from an Image.

func (*RGBRunes) At

func (rgb *RGBRunes) At(x, y int) RGBRune

At gets the RGBRune at a point.

func (*RGBRunes) Height

func (rgb *RGBRunes) Height() int

Height gets the height of the image as colored runes.

func (*RGBRunes) Width

func (rgb *RGBRunes) Width() int

Width gets the width of the image as colored runes.

Jump to

Keyboard shortcuts

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