You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
ᴀɴᴛᴏɴ ɴᴏᴠᴏᴊɪʟᴏᴠ 12fc78989b
Merge pull request #14 from essentialkaos/develop
Improve CI workflow
3 years ago
.github Merge branch 'develop' of github.com:essentialkaos/go-badge into develop 3 years ago
testdata Use shorthand hex colors if possible 3 years ago
.codebeatsettings First public release 3 years ago
.gitignore Add font to .gitignore 3 years ago
LICENSE First public release 3 years ago
Makefile Migrate to go modules + Improve GitHub actions workflows 3 years ago
README.md Migrate to go modules + Improve GitHub actions workflows 3 years ago
SECURITY.md First public release 3 years ago
badge.go Improve workflows 3 years ago
badge_test.go Improve workflows 3 years ago
go.mod Bump github.com/essentialkaos/check from 1.2.1 to 1.3.0 3 years ago
go.sum Bump github.com/essentialkaos/check from 1.2.1 to 1.3.0 3 years ago

README.md

PkgGoDev GitHub Actions CI Status GoReportCard Coverage Status Codebeat badge GitHub Actions CodeQL Status

InstallationUsage exampleExamplesBuild StatusContributingThanksLicense


badge is a Go package for generating SVG badges.

Installation

Make sure you have a working Go 1.17+ workspace (instructions), then:

go get -d github.com/essentialkaos/go-badge

For update to latest stable release, do:

go get -d -u github.com/essentialkaos/go-badge

Usage example

package main

// ////////////////////////////////////////////////////////////////////////// //

import (
  "fmt"
  "github.com/essentialkaos/go-badge"
)

// ////////////////////////////////////////////////////////////////////////// //

func main() {
  g, err := badge.NewGenerator("Verdana.ttf", 11)

  if err != nil {
    panic(err)
  }

  fmt.Println(string(g.GeneratePlastic("status", "ok", "#97ca00")))
}

Examples

Flat Flat Square Plastic Flat (Simple) Flat Square (Simple) Plastic (Simple)
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple
flat square plastic flat-simple square-simple plastic-simple

All badges are generated with the latest version of the package.

Build Status

Branch Status
master CI
develop CI

Contributing

Before contributing to this project please read our Contributing Guidelines.

Thanks

We would like to thank:

License

Apache License, Version 2.0