goplaceholder

package module
v0.0.0-...-8ec86e1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2016 License: MIT Imports: 9 Imported by: 0

README

goplaceholder

a small golang lib to generate placeholder images.

Usage

get it

$ go get github.com/michiwend/goplaceholder

simple example

placeholder, err := goplaceholder.Placeholder(
    "Lorem ipsum!",
    "/usr/share/fonts/TTF/DejaVuSans-Bold.ttf",
    color.RGBA{150, 150, 150, 255},
    color.RGBA{204, 204, 204, 255},
    400, 200)

results in

example placeholder

Webservice

You can try it as a web service at placeholder.michiwend.com.

The following requests are allowed:

  • /800x600.png
  • /800x600.png?text=foo
  • /500.png
  • /500.png?text=foo

Documentation

Overview

package goplaceholder implements a simple library to generate placeholder images using freetype-go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Placeholder

func Placeholder(text, ttfPath string, foreground, background color.RGBA, width, height int) (image.Image, error)

Placeholder returns a placeholder image with the given text or, if text was an empty string, with the image bounds in the form "800x600".

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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