Documentation
¶
Overview ¶
Package brandkit provides embedded brand icons.
Icons are embedded at compile time and can be retrieved by brand name. Each brand has three variants: color, white (for dark backgrounds), and original.
Example:
svg, err := brandkit.GetIconWhite("aws")
if err != nil {
log.Fatal(err)
}
// svg contains the white AWS icon SVG bytes
Package brandkit provides embedded brand icons and SVG processing utilities.
Index ¶
- func GetIcon(brand string, variant IconVariant) ([]byte, error)
- func GetIconColor(brand string) ([]byte, error)
- func GetIconOrig(brand string) ([]byte, error)
- func GetIconWhite(brand string) ([]byte, error)
- func IconExists(brand string) bool
- func ListIcons() ([]string, error)
- func NormalizeIconName(name string) string
- type IconVariant
- type ProcessResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIcon ¶
func GetIcon(brand string, variant IconVariant) ([]byte, error)
GetIcon retrieves an icon by brand name and variant. Returns the SVG content as bytes.
func GetIconColor ¶
GetIconColor retrieves the full color icon.
func GetIconOrig ¶
GetIconOrig retrieves the original unmodified icon.
func GetIconWhite ¶
GetIconWhite retrieves the white variant icon for dark backgrounds.
func NormalizeIconName ¶
NormalizeIconName converts common aliases to brandkit names. For example, "golang" -> "go", "postgresql" -> "postgres".
Types ¶
type IconVariant ¶
type IconVariant string
IconVariant represents the icon color variant.
const ( // IconVariantWhite is a white foreground icon for dark backgrounds. IconVariantWhite IconVariant = "white" // IconVariantColor is the full color icon. IconVariantColor IconVariant = "color" // IconVariantOrig is the original unmodified icon. IconVariantOrig IconVariant = "orig" )
type ProcessResult ¶
type ProcessResult struct {
InputPath string
OutputPath string
BackgroundRemoved bool
ColorConverted bool
TargetColor string
Centered bool
SuggestedViewBox string
Verified bool
VectorElements []string
SecurityScanned bool
SecurityThreats []security.Threat
}
ProcessResult contains the result of a processing operation.
func ProcessColor ¶
func ProcessColor(inputPath, outputPath string) (*ProcessResult, error)
ProcessColor creates a centered color icon on transparent background. It removes background elements, centers the content, verifies the result is pure vector while preserving original colors, and performs security scanning.
Equivalent to CLI: brandkit color <input> -o <output>
func ProcessWhite ¶
func ProcessWhite(inputPath, outputPath string) (*ProcessResult, error)
ProcessWhite creates a white icon on transparent background. It removes background elements, converts all colors to white, centers the content, verifies the result is pure vector, and performs security scanning.
Equivalent to CLI: brandkit white <input> -o <output>
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
svg
command
brandkit is a CLI tool for brand icon processing: analyzing, verifying, and converting SVG icons.
|
brandkit is a CLI tool for brand icon processing: analyzing, verifying, and converting SVG icons. |
|
Package svg provides shared types and utilities for SVG processing.
|
Package svg provides shared types and utilities for SVG processing. |
|
analyze
Package analyze provides SVG analysis for centering and padding.
|
Package analyze provides SVG analysis for centering and padding. |
|
convert
Package convert provides SVG color conversion functionality.
|
Package convert provides SVG color conversion functionality. |
|
security
Package security provides SVG security scanning to detect and remove malicious elements.
|
Package security provides SVG security scanning to detect and remove malicious elements. |
|
verify
Package verify validates SVG files are pure vector images.
|
Package verify validates SVG files are pure vector images. |