avatar-kt
0.3.0indexedGenerates unique, deterministic offline avatars via canvas; multiple stylistic variants (BEAM, MARBLE, PIXEL_ART, EMOJI, WACKY), with customizable colors, size and shape.
1
Stars
—
Used by
dependents
—
Health
/ 100
Generates unique, deterministic offline avatars via canvas; multiple stylistic variants (BEAM, MARBLE, PIXEL_ART, EMOJI, WACKY), with customizable colors, size and shape.
A Kotlin Multiplatform (KMP) library that generates unique, deterministic avatars completely offline using Compose Multiplatform Canvas. Based on Boring Avatars and DiceBear.
Add the dependency to your commonMain source set:
// build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.feliperce:avatarkt:0.3.0")
}
}
}
// Minimal - uses default colors and BEAM variant
Avatar(name = "Maria")
// Customized
Avatar(
name = "Maria",
colors = listOf(
Color(0xFF92A1C6),
Color(0xFF146A7C),
Color(0xFFF0AB3D),
Color(0xFFC271B4),
Color(0xFFC20D90)
),
variant = AvatarVariant.PIXEL_ART,
size = 80.dp,
shape = RoundedCornerShape(16.dp)
)
:avatarkt: The main library code (Canvas-based).:composeApp: Example application demonstrating all variants.BEAM: Friendly faces with geometric shapes (Boring Avatars port).MARBLE: Organic abstract patterns with gradients (Boring Avatars port).SUNSET: Smooth sunset gradients (Boring Avatars port).BAUHAUS: Minimalist geometric shapes (Boring Avatars port).RING: Colorful concentric rings (Boring Avatars port).PIXEL: 8x8 pixel mosaic (Boring Avatars port).EMOJI: Random emoji on a colored background.WACKY: Playful characters based on DiceBear thumbs.PIXEL_NEUTRAL: Clean pixel-art faces from DiceBear.PIXEL_ART: Full pixel-art faces with hair, hats and accessories.PIXEL_ANIMALS: Pixel animal avatars.Surfaced from shared tags and platforms — no rankings paid for.