Giter Site home page Giter Site logo

go-letteravatar's Introduction

Letter Avatar Generator

Introduction

The Letter Avatar Generator is a Go application designed to create personalized avatars using the first letter of a user's name. Users have the flexibility to choose background colors, avatar shapes, size and the file format for saving the generated avatar. This project utilizes the letteravatarapi custom package for generating images with a letter set against a customizable background, making it ideal for creating unique avatars for various online platforms.

Features

  • Users can choose a background color from predefined options.
  • Shape selection allows for either a circle or square avatar.
  • Size customization enables specifying the avatar dimension within a range.
  • Supports saving the avatar in either PNG or JPG formats.

Requirements

  • Go (version 1.15 or newer is recommended)
  • The gg package for Go graphics

Installation

Ensure you have Go installed on your system by downloading it from the official Go website.

Clone the repository to begin using the Letter Avatar Generator:

git clone https://github.com/modevsty/go-letteravatar.git
cd go-letteravatar

Install the required Go package:

go get github.com/fogleman/gg

Usage

To run the application, navigate to the project directory and build the application:

go build

Then run the following command:

./letteravatar

The application will guide you through a series of prompts:

  1. Enter Your Name: Input your first and last name only.
  2. Pick a Background Color: Choose from the list by entering the corresponding number.
  3. Pick a Shape: Select your preferred shape for the avatar.
  4. Pick a Size: Specify the avatar's size (in pixels), which must be between 16 and 1024.
  5. Pick a Save Format: Choose between PNG or JPG formats for your avatar.
  6. After these selections, the program generates your avatar according to your specifications and saves it in the current directory.

Customizing Avatar

The letteravatarapi allows for customization of the avatar's shape, size, and colors. Here are some methods you can use:

  • WithShape("circle" or "rectangle"): Defines the shape of the avatar.
  • WithSize(int): Sets the size of the avatar.
  • WithColor(bgColorHex string): Sets the background color.

These methods can be chained together when creating a new LetterAvatar instance.

Contributing

We welcome contributions to the Letter Avatar Generator project. Feel free to fork the repository, make your changes, and submit a pull request. For any issues or suggestions, please open an issue in the GitHub repository.

go-letteravatar's People

Contributors

modevsty avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.