grid

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package grid provides utilities for drawing a grid of GitHub avatars.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvatarGrid

type AvatarGrid struct {
	// contains filtered or unexported fields
}

AvatarGrid is a grid of GitHub avatars.

It expands and adds new rows when needed.

func New

func New(margin int, formatter avatar.Formatter) *AvatarGrid

New returns a new AvatarGrid.

func NewWithSize

func NewWithSize(avatars int, margin int, formatter avatar.Formatter) *AvatarGrid

NewWithSize returns a new AvatarGrid with the given size.

func (*AvatarGrid) AddAvatar

func (g *AvatarGrid) AddAvatar(avatar image.Image)

AddAvatar adds an avatar's image to a grid.

If needed, it expands the size of the underlying image.

func (AvatarGrid) At added in v0.2.1

func (g AvatarGrid) At(x, y int) color.Color

At returns the color of the pixel at (x, y).

func (AvatarGrid) Bounds added in v0.2.1

func (g AvatarGrid) Bounds() image.Rectangle

Bounds returns the bounds of the underlying image.

func (AvatarGrid) ColorModel added in v0.2.1

func (g AvatarGrid) ColorModel() color.Model

ColorModel returns the color model of the underlying image.

func (AvatarGrid) Cols

func (g AvatarGrid) Cols() int

Cols returns the number of columns in the grid.

func (AvatarGrid) Image

func (g AvatarGrid) Image() image.Image

Image returns the image of the grid.

func (AvatarGrid) Rows

func (g AvatarGrid) Rows() int

Rows returns the number of rows in the grid.

Jump to

Keyboard shortcuts

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