retricon

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: MIT Imports: 8 Imported by: 0

README

retricon

Retricons ported to Go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNew

func MustNew(name string, style ...Style) image.Image

MustNew creates a new retricon image or panics on error

func MustNewWithOptions

func MustNewWithOptions(name string, opts Options) image.Image

MustNewWithOptions creates a new retricon image with options or panics on error

func New

func New(name string, style ...Style) (image.Image, error)

New creates a new reticon image with the given name and optional style

func NewWithOptions

func NewWithOptions(name string, opts Options) (image.Image, error)

NewWithOptions creates a new reticon image with custom options

Types

type Options

type Options struct {
	Tiles         int
	TileSize      int
	TileColor     any // Can be int, string, or color.RGBA
	BgColor       any // Can be int, string, or color.RGBA
	Size          int
	TilePadding   int
	ImagePadding  int
	MinFill       float64
	MaxFill       float64
	VerticalSym   bool
	HorizontalSym bool
}

Options represents configuration options for retricon generation

func (*Options) ApplyStyle

func (o *Options) ApplyStyle(style Style) error

ApplyStyle configures options based on predefined styles

type Style

type Style string

Style represents predefined configurations for retricon generation

const (
	Default  Style = "default"
	Github   Style = "github"
	Gravatar Style = "gravatar"
	Mono     Style = "mono"
	Mosaic   Style = "mosaic"
	Mini     Style = "mini"
	Window   Style = "window"
)

Jump to

Keyboard shortcuts

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