sticker: github.com/muesli/sticker Index | Files

package sticker

import "github.com/muesli/sticker"

Index

Package Files

sticker.go

Variables

var (
    // ErrInvalidDimensions gets returned when the requested image has an invalid width or height
    ErrInvalidDimensions = errors.New("values for width or height must be positive")
)

type ImageGenerator Uses

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

ImageGenerator lets you generate images & placeholders

func NewImageGenerator Uses

func NewImageGenerator(options Options) (*ImageGenerator, error)

NewImageGenerator returns a new ImageGenerator

func (*ImageGenerator) NewPlaceholder Uses

func (p *ImageGenerator) NewPlaceholder(text string, width, height int) (image.Image, error)

NewPlaceholder returns a placeholder image with the given text, width & height

type Options Uses

type Options struct {
    TTFPath         string
    Foreground      color.RGBA
    Background      color.RGBA
    BackgroundImage image.Image
    MarginRatio     float64
}

Options contains all the settings for an ImageGenerator

Package sticker imports 9 packages (graph). Updated 2017-10-13. Refresh now. Tools for package owners.