badge

package module
v0.0.0-...-0280203 Latest Latest
Warning

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

Go to latest
Published: May 23, 2017 License: GPL-3.0 Imports: 7 Imported by: 0

README

badge is a library to render shield badges to SVG.

License

This software was originally provided as https://github.com/narqo/go-badge and licensed under the MIT Licesnse, see LICENSE.orig

This fork is licensed under the GPLv3, see LICENSE
(re-licensing according to http://softwareengineering.stackexchange.com/questions/105912/can-you-change-code-distributed-under-the-mit-license-and-re-distribute-it-unde)


All the kudos should go to the great Shields.io specification project.
Also see the original author https://github.com/narqo

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")
	ColorGray        = Color("gray")
	ColorLightgrey   = Color("lightgrey")
	ColorLightgray   = Color("lightgray")
)

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",
	"gray":        "#555",
	"lightgrey":   "#9f9f9f",
	"lightgray":   "#9f9f9f",
}

ColorScheme contains named colors that could be used to render the badge.

Functions

func Render

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

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

Types

type Color

type Color string

Color represents color of the badge.

func (Color) String

func (c Color) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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