syumaigen

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 13 Imported by: 1

README

syumaigen

syumai.gif

  • A CLI tool to generate syumai's avatar image.
  • The avatar used in this command was designed by @tanakaworld.

Features

  • Change scale of avatar image
  • Randomize color generation
  • Generate PNG / SVG
  • Generate animated GIF

Installation

go install github.com/syumai/syumaigen/cmd/syumaigen@latest

Usage

# Generate image (default: PNG)
syumaigen > syumai.png

# Show usage
syumaigen -help

# Upscale (default: 10) and stop randomize color generation (default: true)
syumaigen -scale=100 -random=false > syumai.png

# generate animated GIF
syumaigen -animated > syumai.gif

# generate SVG
syumaigen -svg > syumai.svg
Example HTTP Server
  • go run example/server/main.go
  • This generates random avator image.

License

MIT

Author

syumai

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultColorMap = ColorMap{
	0: color.Transparent,
	1: color.Black,
	2: color.RGBA{66, 66, 66, 255},
	3: color.RGBA{255, 255, 240, 255},
	4: color.RGBA{222, 222, 203, 255},
	5: color.RGBA{255, 121, 0, 255},
	6: color.RGBA{28, 214, 1, 255},
	7: color.RGBA{25, 179, 3, 255},
	8: color.RGBA{126, 214, 113, 255},
	9: color.RGBA{191, 214, 188, 255},
}
View Source
var Pattern [][]int

Functions

func GenerateAnimatedSyumaiGIF

func GenerateAnimatedSyumaiGIF(scale int) (*gif.GIF, error)

func GenerateImage

func GenerateImage(data [][]int, cmap ColorMap, scale int) (image.Image, error)

func GenerateSVG added in v0.3.0

func GenerateSVG(data [][]int, cmap ColorMap, scale int) (io.Reader, error)

Types

type ColorMap

type ColorMap map[int]color.Color

func GenerateColorMapByColorCode added in v0.2.0

func GenerateColorMapByColorCode(cc string) ColorMap

func GenerateColorMapByHCL added in v0.2.0

func GenerateColorMapByHCL(h float64, c float64) ColorMap

func GenerateRandomColorMap

func GenerateRandomColorMap() ColorMap

Directories

Path Synopsis
cmd
example

Jump to

Keyboard shortcuts

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