canvas

package
v0.0.0-...-c86976e Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Width               = 1080
	Height              = 680
	MarginTop           = 10
	MarginRight         = 70
	MarginLeft          = 22
	ColorRowMarginLeft  = 38
	PaddingTop          = 70
	PaddingLeft         = 66
	HeaderMarginLeft    = MarginLeft * 4
	RowIndexMargin      = 5
	FontSize            = 10
	PassKeyBottomMargin = Height - 35
)
View Source
const (
	AlphabetWidth          = 29
	AlphabetBodyHeight     = 8
	ClassicHeaderRow       = "■□▲△○●★☂☀☁☹☺♠♣♥♦♫€¥£$!?¡¿⊙◐◩�"
	Numbers                = "0123456789"
	AlphabetLower          = "abcdefghijklmnopqrstuvwxyz"
	AlphabetUpper          = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	Symbols                = "@#$%&*<>?€+{}[]()/\\"
	AlphaNumeric           = Numbers + AlphabetLower + AlphabetUpper
	AlphaNumericAndSymbols = AlphaNumeric + Symbols
)

Variables

View Source
var (
	ColorWhite = color.RGBA{
		R: 255,
		G: 255,
		B: 255,
	}

	ColorGray = color.RGBA{
		R: 192,
		G: 192,
		B: 192,
	}

	ColorRed = color.RGBA{
		R: 255,
		G: 192,
		B: 192,
	}

	ColorGreen = color.RGBA{
		R: 192,
		G: 255,
		B: 192,
	}

	ColorYellow = color.RGBA{
		R: 255,
		G: 255,
		B: 192,
	}

	ColorBlue = color.RGBA{
		R: 192,
		G: 192,
		B: 255,
	}

	ColorMagenta = color.RGBA{
		R: 255,
		G: 192,
		B: 255,
	}

	ColorCyan = color.RGBA{
		R: 192,
		G: 255,
		B: 255,
	}

	Colors = []color.RGBA{
		ColorWhite,
		ColorGray,
		ColorRed,
		ColorGreen,
		ColorYellow,
		ColorBlue,
		ColorMagenta,
		ColorCyan,
	}

	ColorNames = []string{
		"White",
		"Gray",
		"Red",
		"Green",
		"Yellow",
		"Blue",
		"Magenta",
		"Cyan",
	}
)

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	Context       *gg.Context
	FontFace      *font.Face
	IndexFontFace *font.Face
}

func NewCanvas

func NewCanvas() (*Canvas, error)

func (*Canvas) ColorizeRows

func (c *Canvas) ColorizeRows(rowHeight float64)

func (*Canvas) RenderHeader

func (c *Canvas) RenderHeader(headerLetters string, offset float64)

func (*Canvas) RenderKey

func (c *Canvas) RenderKey(key string)

func (*Canvas) RenderRow

func (c *Canvas) RenderRow(index int, row string, rowHeight float64)

Jump to

Keyboard shortcuts

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