Geometricon
A TypeScript library that generates unique, symmetrical geometric icons from hash strings for user avatars and visual identifiers.
Generate unique, symmetrical geometric icons from hash strings. Perfect for creating user avatars and visual identifiers with a modern aesthetic. Transform any hash input into deterministic, visually balanced SVG icons with zero dependencies.
Key Features
Same hash input always produces identical icons. Perfect for consistent user avatars and visual identifiers across your application.
Five structured layouts including centered, radial, split, frame, and random modes ensure every icon is visually balanced and professional.
Eight preset color schemes (pastel, vibrant, warm, cool, monochrome, earth, ocean, sunset) plus custom palette support with optional gradients.
Pure TypeScript implementation with no external dependencies. Works in Node.js and browsers, outputting clean SVG with transparent backgrounds.
Geometric Shapes
Geometricon supports seven distinct shape types that can be combined to create unique visual identities:
Circles
Squares
Triangles
Hexagons
Diamonds
Stars
Shapes use variable opacity (75-95%) for subtle depth effects and are constrained to 90-degree rotations for a clean, professional appearance.
Installation
1. Clone the repository
git clone https://github.com/cjscrofani/geometricon.git2. Install dependencies and build
npm installnpm run buildUsage Examples
Basic generation:
geometricon abc123def456 -o icon.svgWith color scheme and composition:
geometricon abc123 --color-scheme ocean --composition radialCustom shapes and gradients:
geometricon abc123 --shape-count 3 --shapes circle,square --use-gradientsconst { generateIcon } = require('./dist/index');
const svg = generateIcon('abc123def456', {
size: 300,
composition: 'centered',
colorScheme: 'ocean',
useGradients: true
});
// Save or serve the SVG
fs.writeFileSync('icon.svg', svg);Configuration Options
- centered: Focus shapes in the center
- radial: Distribute shapes in a circle
- split: Divide canvas into sections
- frame: Create decorative borders
- random: Organic placement
- pastel: Soft, muted colors
- vibrant: Bold, saturated hues
- warm: Reds, oranges, yellows
- cool: Blues, greens, purples
- monochrome: Grayscale palette
- earth: Natural tones
- ocean: Blue and teal shades
- sunset: Orange and pink gradients
Technical Architecture
Geometricon uses deterministic hash-based generation to create consistent, unique icons:
Hash Processing
Portions of hash determine shape types, quantities, and positions
Size Constraints
Shapes sized 15-25% of canvas with 5% padding
SVG Output
Clean, transparent background SVG files
License
MIT License