GitHunt
SI

silentsoft/badge4j

:art: Badge4J is a Java implementation of the badge-maker JavaScript library and is inspired by shields.io.

Badge4J

Maven Central
Build Status
Quality Gate Status
Coverage
Hits

Badge4J is a Java implementation of the badge-maker JavaScript library and is inspired by shields.io. This library also supports simple-icons.

Usage

String svg = Badge.builder().label("hello").message("world").build();

Available builder options

Badge.builder()
     .style(Style) /* Flat(default), FlatSquare, ForTheBadge, Plastic, Social */
     .label(String)
     .message(String)
     .color(String)
     .labelColor(String)
     .logo(String) /* simple-icons slug or data:image/svg+xml;base64,.. */
     .logoWidth(int)
     .links(String[])
     .build();

Styles

Colors

  • Named color by shields.io
















  • Any valid CSS color

    • named color
      • etc.
    • hexadecimal numbers
      • etc.
    • rgb[a](red, green, blue[, opacity])
    • cmyk[a](cyan, magenta, yellow, black[, opacity])
    • hsl[a](hue, saturation, lightness[, opacity])

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please note we have a CODE_OF_CONDUCT, please follow it in all your interactions with the project.

License

Please refer to LICENSE.

Languages

Java100.0%

Contributors

Apache License 2.0
Created July 3, 2021
Updated March 16, 2026
silentsoft/badge4j | GitHunt