BadgeGenerator 1.0.0
See the version list below for details.
dotnet add package BadgeGenerator --version 1.0.0
NuGet\Install-Package BadgeGenerator -Version 1.0.0
<PackageReference Include="BadgeGenerator" Version="1.0.0" />
paket add BadgeGenerator --version 1.0.0
#r "nuget: BadgeGenerator, 1.0.0"
// Install BadgeGenerator as a Cake Addin #addin nuget:?package=BadgeGenerator&version=1.0.0 // Install BadgeGenerator as a Cake Tool #tool nuget:?package=BadgeGenerator&version=1.0.0
BadgeGenerator
Provides possibility of programmatically generating SVG badges.
Installation
dotnet add package BadgeGenerator
Usage
using BadgeGenerator;
List<BadgeSection> badgeSections = new()
{
new()
{
Content = new Uri("https://example.com/healthy.png"),
IconSize = 12,
BackgroundColor = "#555"
},
new()
{
Content = "Status",
ForegroundColor = "#fff",
BackgroundColor = "#555"
},
new()
{
Content = "Healthy",
ForegroundColor = "#fff",
BackgroundColor = "rgb(11, 97, 42)"
}
};
var badgeSvg = BadgeCreator.CreateBadgeSvg(badgeSections, new BadgeMetadata { Height = 20, Padding = 10 });
Console.WriteLine(badgeSvg);
This will output the SVG of the badge with three sections: one with a healthy.png
icon, another with the text "Status" and the third one with text "Healthy". You can customize the badge's size and padding by passing a BadgeMetadata
object:
var metadata = new BadgeMetadata
{
Height = 28,
Padding = 12
};
Contributing
Read more about this project on the Github repository page.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BadgeGenerator:
Package | Downloads |
---|---|
BadgeGenerator.AspNetCore.HealthChecks.Badge
Adds middleware that can return different badges indicating the current health of a web application. |
GitHub repositories
This package is not used by any popular GitHub repositories.