utils

package
v0.0.0-...-510c622 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawBadges

func DrawBadges(ctx *gg.Context, imageCache *database.Cache, user *UserData, w, h int)

func DrawBadgesWrapped

func DrawBadgesWrapped(ctx *gg.Context, imageCache *database.Cache, user *UserData, w, h int, limit uint8)

func DrawVerticalBadges

func DrawVerticalBadges(ctx *gg.Context, imageCache *database.Cache, user *UserData, w, h int)

func GetAsset

func GetAsset(path string, imageCache *database.Cache) image.Image

func GetColorLuminance

func GetColorLuminance(color color.RGBA) float64

func GetFont

func GetFont(font string, points float64) *font.Face

func GetImageFromURL

func GetImageFromURL(url string, w int, h int, db *database.Database) image.Image

func GetProfileCustomization

func GetProfileCustomization(toSearch string, custom []string) bool

func GetResizedAsset

func GetResizedAsset(path string, w, h int) (image.Image, bool)

func ShadeColor

func ShadeColor(color string, percent float64) string

func StrokeText

func StrokeText(ctx *gg.Context, text string, x, y, size int, ax, ay float64, color string)

Types

type I18n

type I18n struct {
	Aboutme string `json:"aboutme"`
	Mamado  string `json:"mamado"`
	Mamou   string `json:"mamou"`
	Usages  string `json:"usages"`
}

type MarryData

type MarryData struct {
	Username string `json:"username"`
}

type ProfileData

type ProfileData struct {
	User        UserData `json:"user"`
	HashedData  string   `json:"hashedData"`
	I18n        I18n     `json:"i18n"`
	Type        string   `json:"type"`
	CustomEdits []string `json:"customEdits"`
}

type UserData

type UserData struct {
	Color         string  `json:"color"`
	Image         string  `json:"image"`
	Id            string  `json:"id"`
	Avatar        string  `json:"avatar"`
	Votes         uint16  `json:"votes"`
	Info          string  `json:"info"`
	Badges        []uint8 `json:"badges"`
	HiddingBadges []uint8 `json:"hiddingBadges"`
	Username      string  `json:"username"`
	Mamadas       int32   `json:"mamadas"`
	Mamou         int32   `json:"mamou"`
	Title         string  `json:"title"`
	MarryDate     string  `json:"marryDate"`
	MarryUsername string  `json:"marryUsername"`
	Married       bool    `json:"married"`
}

Jump to

Keyboard shortcuts

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