table2image

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 8 Imported by: 0

README

Table2Image

This package provides an easy way to convert a table with text to a png image. See example.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Align

type Align uint8
const (
	HorizontalAlignLeft Align = iota
	HorizontalAlignCenter
	HorizontalAlignRight
	VerticalAlignTop
	VerticalAlignMiddle
	VerticalAlignBottom
)

type OptionFunc

type OptionFunc func(*Table)

func WithBackgroundColor

func WithBackgroundColor(color *image.Uniform) OptionFunc

func WithFontFace

func WithFontFace(face font.Face) OptionFunc

func WithHorizontalAlign

func WithHorizontalAlign(align Align) OptionFunc

func WithPaddings

func WithPaddings(horizontalPadding, verticalPadding int) OptionFunc

func WithTextColor

func WithTextColor(color *image.Uniform) OptionFunc

func WithVerticalAlign

func WithVerticalAlign(align Align) OptionFunc

type Table

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

func NewTable

func NewTable(cols, rows int, opts ...OptionFunc) *Table

func (*Table) SetCell

func (t *Table) SetCell(col, row int, s string)

func (*Table) WritePNG

func (t *Table) WritePNG(w io.Writer) error

Jump to

Keyboard shortcuts

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