SVG color badge automatic creation generator for GitHub | ZeroTools

You can generate and download color badges (Shields.io style) for flat and beautiful parameter display in SVG format, perfect for GitHub READMEs, etc. It is a convenient web tool that operates completely locally and safely without sending data to an external server.

Loading tool interface...

Client-Side Secure Execution

This tool executes entirely in your browser sandbox. None of your input strings, files, or configurations are uploaded to any external server.

ZeroTools: Browser Processing & Privacy

ZeroTools focuses on tools that process input on your device. Check each tool’s scope and limitations before use.

Processing and privacy policy
Chapter 1

. SVG Badge Generation Engine Architecture and Shields Compatible Flat Style Structure

A badge generation mechanism using scalable vector graphics is the basis for visualizing a software project's quality metrics and metadata in the README file that is the face of a GitHub repository.

The core engine of the generator uses a flat-style design that is fully compatible with the Shields ecosystem, and is constructed using a precise arrangement of paths and rectangular elements.

The svg tag, which is the root element of the output code, declares the vector graphics standard namespace as an xmlns attribute and provides the entire canvas.

The clipping path definition placed inside it generates a mask layer with rounded rectangles and applies a corner design with a curvature radius of 3 pixels that gives a uniform feel to the entire badge.

Directly below this mask is the g-tag group that makes up the main visual. A dark gray rectangular element that represents the label area on the left and a user-specified color rectangular element that represents the status area on the right are placed adjacent to each other.

These graphical elements are given width attributes according to their roles and rendered as a single capsule shape unified by a clipping path.

Furthermore, shape rendering attributes and text rendering attributes to control anti-aliasing processing for text are optimally assigned to each node, and the design is designed to minimize edge blurring even in high-resolution display environments.

By dynamically assembling this highly abstracted markup structure on the browser's document object model, we achieve autonomous client-side badge rendering that does not depend on server-side drawing processing.

Chapter 2

Pre-measurement algorithm for string width and dynamic automatic calculation logic for viewBox dimensions

The biggest factor that determines the visual beauty of flat style badges is the uniformity of the white space between the left and right rectangular areas and the text placed there.

Achieving this requires a measurement algorithm that accurately predicts in advance the physical pixel width that input label and status strings will occupy during final rendering.

This system implements a text width measurement function using a virtual canvas context based on the metrics characteristics of Verdana and Helvetica fonts.

For the character string to be measured, the glyph progression width is analyzed character by character, and the total pixel length including kerning information is calculated.

The left and right padding values, several tens of pixels, are added to this basic value, and the width of the left rectangle and the width of the right rectangle are determined independently.

Next, the sum of these two widths is bound to the width attribute of the svg element and the first and second parameters of the viewBox attribute as the total width of the entire badge.

The viewBox is an extremely important attribute that defines the ratio between the internal coordinate system and the external display size, and by applying the optimal value calculated by this logic, a container of just the right size is always ensured regardless of the increase or decrease of character strings.

Also, for the x and y attributes, which are the placement coordinates of text elements, the text anchor middle specification based on the calculated median of the rectangular width is adopted, and when combined with the baseline shift adjustment in the vertical direction, the coordinate calculation is performed so that the center of gravity of the character perfectly matches the geometric center of the rectangular area.

Chapter 3

. Simple Icons integration mechanism and gradient application based on HEX color code

The ability to incorporate specific technology stacks or social network brand logos into badges is a must for creating a professional repository.

This tool maintains a vector dataset from the Simple Icons library, which is commonly used by the developer community, as an internal dictionary, and performs a binding process that dynamically extracts the SVG path data of the corresponding brand based on the identifier entered by the user and injects it into the label area on the left side of the badge.

The extracted icon path is scaled into a square grid of 16 pixels by 16 pixels and placed at the beginning of the existing label string with a constant margin.

At this time, the total width of the left rectangle that changes due to the addition of icons is fed back to the measurement logic in the previous chapter, and the entire layout is immediately recalculated.

Additionally, we offer the ability to generate linear gradient layers starting and ending with HEX color codes as an advanced styling technique to enhance the visual impact of your badges.

A linearGradient element is defined in the defs area within the svg tag, and the 6-digit hexadecimal color code specified by the user is parsed and assigned to the stop-color attribute of the stop element.

By referencing this gradation ID from the fill attribute of the right status rectangle, it is possible to give the badge a three-dimensional effect and a transition effect that goes beyond a monotonous solid color.

By setting a gradient vector axis that simulates the angle of incidence of light, you can create advanced micrographics that create a sense of depth while maintaining the constraints of flat design.

Chapter 4

. Local SVG generation and data URI scheme conversion within the browser sandbox

In order to ensure superiority in terms of both security and performance, this tool uses an architecture in which all graphic generation processing is completed within the sandbox of the user's local browser environment.

The front-end JavaScript engine executes everything from concatenating DOM strings to constructing the final SVG markup, without making any HTTP requests to external image generation APIs or back-end servers.

This client-side rendering method enables real-time preview updates in milliseconds, completely unaffected by network delays or server downtime.

The generated plain text SVG code is immediately converted to a string stream of 64 printable characters using the Base64 encoding algorithm and is given a header with a data URI scheme that declares the MIME type image/svg+xml.

This conversion process generates a virtual image source URL that is expanded in memory without going through an actual file on the file system, which is then directly loaded into the browser's img tag element and rendered on the screen.

This data URI also has a path where it is decoded into pixel data via Canvas API and then re-encoded as a binary blob in PNG format, ensuring seamless support for rasterized image output for legacy environments that do not support vector formats.

Chapter 5

. One-click generation of clipboard interface and Markdown embed code

In order to minimize the friction in the process of integrating the generated badges into the actual development flow, this tool is equipped with a one-click output interface that is deeply integrated with the OS's clipboard API.

The moment the user presses the export button, the formatted SVG source code string is extracted from the DOM tree built in memory via the XMLSerializer interface and written directly to the system clipboard area via the asynchronous Clipboard object.

At the same time, link code in Markdown format, which is the standard markup notation for developers to place badges in GitHub README files and issue templates, is automatically synthesized.

This compositing process concatenates the badge image's reference URL and click target URL according to a specific syntax using a combination of square brackets and parentheses to generate a complete snippet, including alternative text attributes.

For example, in the case of a badge that shows the build result of continuous integration, a path pointing to the workflow state of the target project is set as the image source, and a string with a binding URL to the action details log page is constructed as the link destination.

This allows developers to instantly deploy interactive status indicators on their project documents by simply pasting the generated text into an editor.

Chapter 6

. GitHub Profile Decoration and OSS Project Quality Attestation Indicator Building Guide

The resulting set of flat-style badges serves as a quality indicator to visually prove the trustworthiness of an open source project.

Directly below the header of the README file located at the root of the repository is the most important showcase area for displaying these badges.

In order to demonstrate proper project management, it is recommended to horizontally arrange badges that show the update status of dependencies, badges that show the coverage rate based on static analysis results of source code, and badges that display license type and latest semantic versioning tag information into logical groups.

Even in personal GitHub profile repositories, badges generated with this tool can be a powerful component for expressing your technical portfolio.

By generating a large number of custom skill badges that combine the brand colors of programming languages ​​and frameworks you are proficient with and Simple Icons, and arranging them in an orderly manner using markdown table syntax and flexbox layout, you can build a profile page that intuitively communicates your technology stack to visitors.

This tool plays an extremely important role as a metadata visualization platform that maximizes the branding value of projects and individual developers by implementing a unique information design that includes version information and proficiency level on the label on the left side of the badge, and technology name on the status on the right side, realizing unique personalization that is not available in standard badge generators.