modulepackage
0.0.0-20230821190521-c9a75c019a59
Repository: https://github.com/narqo/go-badge.git
Documentation: pkg.go.dev
# README
go-badge 
go-badge is a library to render shield badges to SVG.
Installation
Using go get
go get github.com/narqo/go-badge
Usage
package main
import (
"fmt"
"os"
"github.com/narqo/go-badge"
)
func main() {
err := badge.Render("godoc", "reference", "#5272B4", os.Stdout)
if err != nil {
panic(err)
}
badge, err := badge.RenderBytes("godoc", "reference", "#5272B4")
if err != nil {
panic(err)
}
fmt.Printf("%s", badge)
}
Hope example/
directory will have more examples in future.
Contribution and Feedback
Contributing is more than welcome. Create an issue if you see any problem in the code or send a PR with fixes if you'd like.
License
MIT
All the kudos should go to the great Shields.io specification project.
# Functions
Render renders a badge of the given color, with given subject and status to w.
RenderBytes renders a badge of the given color, with given subject and status to bytes.
# Constants
Standard colors.
Standard colors.
Standard colors.
Standard colors.
Standard colors.
Standard colors.
Standard colors.
Standard colors.
Standard colors.
Standard colors.
Standard colors.
No description provided by the author
# Variables
ColorScheme contains named colors that could be used to render the badge.
# Type aliases
Color represents color of the badge.