Documentation ¶
Index ¶
- func New(id string, cornerTiles []Tile, sideTiles []Tile, centerTiles []Tile, ...) icon.Generator
- type Generator
- type Option
- func BackgroundColor(color colorful.Color) Option
- func Code(generator code.Generator) Option
- func ColoredSides(value bool) Option
- func ForegroundColor(color color.Generator) Option
- func ImageSize(imageSize uint) Option
- func PermitAdjacentDuplicates(value bool) Option
- func TileSize(tileSize uint) Option
- func TransparentBackground() Option
- type Tile
- func Circle(scale float64) Tile
- func Combined(tiles ...Tile) Tile
- func Donut(outerScale float64, innerScale float64) Tile
- func Flipped(tile Tile, flipX bool, flipY bool) Tile
- func Rect(offsetX float64, offsetY float64, scaleX float64, scaleY float64) Tile
- func Shape(vertices ...*shape.Vert2d) Tile
- func Transform(tile Tile, offsetX float64, offsetY float64, scale float64, rotations uint) Tile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(id string, cornerTiles []Tile, sideTiles []Tile, centerTiles []Tile, opts ...Option) icon.Generator
New creates a new tiled generator using the given set of base parameters.
This function will typically never be called by end users directly but instead be wrapped in a template specific function (such as classic.New).
Types ¶
type Option ¶
type Option func(g *Generator)
Option represents an option which may be passed to New in order to adjust the default settings of the generator.
func BackgroundColor ¶
func BackgroundColor(color colorful.Color) Option
BackgroundColor selects the color of the background rectangle of the resulting image.
func Code ¶
Code selects the code generator which shall be used to create a seed code from input values.
func ColoredSides ¶
ColoredSides causes the unique sections within the image to be colored differently to make them easier to distinguish.
func ForegroundColor ¶
ForegroundColor selects a generator which decides the color which is to be applied to the entire image or its respective sections.
func ImageSize ¶
ImageSize selects a suitable TileSize based on the given input image size.
All image sizes must be divisible by four in order to produce accurate results.
func PermitAdjacentDuplicates ¶
PermitAdjacentDuplicates selects whether the same tile may appear in adjacent areas within the resulting image.
func TileSize ¶
TileSize customizes the default size at which each respective tile within the graphic is rendered.
func TransparentBackground ¶
func TransparentBackground() Option
TransparentBackground disables the background coloring for the resulting image thus making it transparent where tiles did not draw geometry.
type Tile ¶
type Tile interface {
Draw(canvas *svg.SVG, x float64, y float64, size float64, flipX bool, flipY bool, rotations uint)
}
Tile represents an arbitrary tile implementation which renders at the given desired location