Categorygithub.com/folkjrk/go-ui-avatars
modulepackage
0.0.0-20241112073356-6238b3332557
Repository: https://github.com/folkjrk/go-ui-avatars.git
Documentation: pkg.go.dev

# README

go-ui-avatars

Getting Started

The project is a Go library designed to create UI avatars from user names by producing SVG images that can be integrated into applications. It is inspired by ui-avatars.com, which generates simple avatars based on user initials.

Language support

  • Thai
  • English

Features

  • Random background color

Example

Here's a result by using this library.

getInitials(fullname)

Explanation

  • getInitials Function:
    • Takes a string (e.g., "[email protected]").
    • Extracts the first letter of each word in the string.

input:

[email protected]

Output:

TE

# Functions

GenerateImage creates an SVG image and returns its content as a base64 string.