Documentation
¶
Index ¶
Constants ¶
View Source
const Version = "0.1.0-20220406"
Variables ¶
View Source
var Cache = make(map[string]*pixelart.Image)
///
todo/check - make (local) cache public - why? why not?
or just keep as "internal" detail
note: remember map always requires make or map literal to init/setup
View Source
var Collections = []Collection{ {Name: "punks", Width: 24, Height: 24, Path: "./punks.png", Url: "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/punks.png", Count: 10000}, {Name: "morepunks", Width: 24, Height: 24, Path: "./morepunks.png", Url: "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/morepunks.png", Count: 1000}, {Name: "readymadepunks", Width: 24, Height: 24, Path: "./readymadepunks.png", Url: "https://github.com/cryptopunksnotdead/punks.readymade/raw/master/readymades.png"}, {Name: "bwpunks", Width: 24, Height: 24, Path: "./bwpunks.png", Url: "https://github.com/pixelartexchange/collections/raw/master/bwpunks-24x24.png", Background: true}, {Name: "frontpunks", Width: 24, Height: 24, Path: "./frontpunks.png", Url: "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/frontpunks.png"}, {Name: "intlpunks", Width: 24, Height: 24, Path: "./intlpunks.png", Url: "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/intlpunks.png"}, {Name: "boredapes", Width: 28, Height: 28, Path: "./boredapes.png", Url: "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/boredapes.png"}, {Name: "apes", Width: 35, Height: 35, Path: "./apes.png", Url: "https://github.com/pixelartexchange/collections/raw/master/apes/apes-35x35.png", Background: true}, {Name: "basicboredapes", Width: 50, Height: 50, Path: "./basicboredapes.png", Url: "https://github.com/pixelartexchange/collections/raw/master/basicboredapeclub/basicboredapeclub-50x50.png", Background: true}, {Name: "coolcats", Width: 24, Height: 24, Path: "./coolcats.png", Url: "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/coolcats.png"}, {Name: "doge", Width: 24, Height: 24, Path: "./doge.png", Url: "https://github.com/cryptopunksnotdead/programming-cryptopunks/raw/master/i/doge.png"}, {Name: "dooggies", Width: 32, Height: 32, Path: "./dooggies.png", Url: "https://github.com/pixelartexchange/collections/raw/master/dooggies-32x32.png", Background: true}, {Name: "blockydoge", Width: 60, Height: 60, Path: "./blockydoge.png", Url: "https://github.com/pixelartexchange/collections/raw/master/blockydoge/blockydoge-60x60.png", Background: true}, {Name: "mooncatrescue", Width: 24, Height: 24, Path: "./mooncatrescue.png", Url: "https://github.com/cryptocopycats/awesome-mooncatrescue-bubble/raw/master/i/mooncatrescue.png"}, {Name: "wiener", Width: 32, Height: 32, Path: "./wiener.png", Url: "https://github.com/pixelartexchange/collections/raw/master/wiener-32x32.png", Background: true}, {Name: "rocks", Width: 24, Height: 24, Path: "./rocks.png", Url: "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/rocks.png"}, {Name: "punkrocks", Width: 24, Height: 24, Path: "./punkrocks.png", Url: "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/punkrocks.png"}, }
View Source
var Templates = make(map[string]*template.Template)
Functions ¶
func RenderCollection ¶
func RenderCollection(data *Collection) []byte
func RenderHome ¶
func RenderHome(data []Collection) []byte
Types ¶
type Collection ¶
type Collection struct {
Name string
Width int
Height int
Path string
Url string
// note: background==false (default) => transparent
// background==true => images have backgrounds (NOT transparent)
Background bool
Count int
}
func (*Collection) HandleStripPNG ¶ added in v0.0.5
func (col *Collection) HandleStripPNG() []byte
func (*Collection) HandleTilePNG ¶
func (col *Collection) HandleTilePNG(id int, opts PNGOpts) []byte
func (*Collection) HandleTileSVG ¶
func (col *Collection) HandleTileSVG(id int, opts SVGOpts) []byte
func (*Collection) Image ¶
func (col *Collection) Image() *pixelart.ImageComposite
type PNGOpts ¶
type PNGOpts struct {
Background color.Color // default: nil
BackgroundName string // default: ""
Silhouette color.Color // default: nil
SilhouetteName string // default: ""
Circle bool // default: false
Mirror bool // default: false
Transparent bool // default: false
Zoom int // default: FIX??? use 1 NOT 0 - how?
Resize int // default: 0 (only specified if > 0)
Save bool // default: false
Flag string // default: ""
}
Click to show internal directories.
Click to hide internal directories.