badges

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PassColor color.Color = color.RGBA{R: 0x44, G: 0xCC, B: 0x11, A: 0xFF}
	WarnColor color.Color = color.RGBA{R: 0xCC, G: 0xCC, B: 0x11, A: 0xFF}
	FailColor color.Color = color.RGBA{R: 0xCC, G: 0x44, B: 0x11, A: 0xFF}
	InfoColor color.Color = color.RGBA{R: 0, G: 0x88, B: 0xCC, A: 0xFF}
)

Standard colors for badges.

Functions

This section is empty.

Types

type Badge

type Badge struct {
	Caption  string
	Text     string
	Color    color.Color
	Height   int
	MinWidth int
}

Badge contains all of the characteristics of a badge.

func (*Badge) ApplyDefaults

func (b *Badge) ApplyDefaults()

ApplyDefaults ensures that basic properties of the badge, such as height and color, are set.

func (*Badge) CalculateWidths

func (b *Badge) CalculateWidths() (int, int, int)

CalculateWidths determine the width for both halves of the badge.

func (*Badge) DrawImage

func (b *Badge) DrawImage() *image.RGBA

DrawImage draws the badge into an image.RGBA.

func (*Badge) DrawSGR

func (b *Badge) DrawSGR() string

DrawSGR draws the badge with text using escape ANSI escape codes.

func (*Badge) DrawSVG

func (b *Badge) DrawSVG() string

DrawSVG draws the badge into an SVG image.

Jump to

Keyboard shortcuts

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