img

package
v0.0.0-...-4255c6d Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Background is the background image
	Background draw.Image

	// FontFace is the font used to draw text
	FontFace font.Face
)

Functions

func GenerateBackground

func GenerateBackground()

GenerateBackground generates the background image.

func Init

func Init(tmpl []byte, ft []byte)

This horrible mess is to initialize both the font and template. TODO: Abstract font and background

Types

type ImageColors

type ImageColors struct {
	Bg      color.Color
	Profile color.Color
	Banner  color.Color
	Line    color.Color
	Text    color.Color
}

ImageColors is the image background Colors

type Presence

type Presence struct {
	App      string
	Username string
	Avatar   string
	Status   status
}

Presence represents the user's presence

type UserPresence

type UserPresence struct {
	Img   draw.Image
	Color ImageColors
	Font  font.Face
	Pres  Presence
}

UserPresence represents the presence. It's used to build the presence image

func New

New returns a new UserPresence object.

func (*UserPresence) DrawApp

func (u *UserPresence) DrawApp()

DrawApp draws the first app of the user It's the custom status if set, if not,the app name

func (*UserPresence) DrawProfileImage

func (u *UserPresence) DrawProfileImage()

DrawProfileImage draws the profile image

func (*UserPresence) DrawStatus

func (u *UserPresence) DrawStatus()

DrawStatus draws the status of the user It's the dot thing on the left

func (*UserPresence) DrawUsername

func (u *UserPresence) DrawUsername()

DrawUsername draws the username of the person

func (*UserPresence) Generate

func (u *UserPresence) Generate() (image.Image, error)

Generate generates the final image

func (*UserPresence) To

func (u *UserPresence) To(w io.Writer) error

To encodes the file to the writer

Jump to

Keyboard shortcuts

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