badge

package
v0.0.0-...-895778e Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorBrightgreen = Color("brightgreen")
	ColorGreen       = Color("green")
	ColorYellow      = Color("yellow")
	ColorYellowgreen = Color("yellowgreen")
	ColorOrange      = Color("orange")
	ColorRed         = Color("red")
	ColorBlue        = Color("blue")
	ColorGrey        = Color("grey")
	ColorLightgrey   = Color("lightgrey")
	// aliases
	ColorGray          = Color("gray")
	ColorLightgray     = Color("lightgray")
	ColorCritical      = Color("critical")
	ColorImportant     = Color("important")
	ColorSuccess       = Color("success")
	ColorInformational = Color("informational")
	ColorInactive      = Color("inactive")
)

Standard colors.

Variables

View Source
var ColorScheme = map[string]string{
	"brightgreen": "#4c1",
	"green":       "#97ca00",
	"yellow":      "#dfb317",
	"yellowgreen": "#a4a61d",
	"orange":      "#fe7d37",
	"red":         "#e05d44",
	"blue":        "#007ec6",
	"grey":        "#555",
	"lightgrey":   "#9f9f9f",

	"gray":          "#555",
	"lightgray":     "#9f9f9f",
	"critical":      "#e05d44",
	"important":     "#fe7d37",
	"success":       "#4c1",
	"informational": "#007ec6",
	"inactive":      "#9f9f9f",
}

ColorScheme contains named colors that could be used to render the badge. https://github.com/badges/shields/blob/b6be37d277b64a90bde98ca10446c9d433a56681/badge-maker/lib/color.js#L6

Functions

func Render

func Render(tplName, subject, status string, color Color, w io.Writer) error

Render renders a badge of the given color, with given subject and status to w.

func RenderBytes

func RenderBytes(tplName, subject, status string, color Color) ([]byte, error)

RenderBytes renders a badge of the given color, with given subject and status to bytes.

Types

type Color

type Color string

Color represents color of the badge.

func (Color) String

func (c Color) String() string

Jump to

Keyboard shortcuts

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