{"id":13511693,"url":"https://github.com/disintegration/letteravatar","last_synced_at":"2025-08-21T15:32:14.623Z","repository":{"id":43550859,"uuid":"67839305","full_name":"disintegration/letteravatar","owner":"disintegration","description":"Letter avatar generation for Go","archived":false,"fork":false,"pushed_at":"2021-11-26T06:01:14.000Z","size":316,"stargazers_count":138,"open_issues_count":2,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-11T12:25:03.173Z","etag":null,"topics":["avatar","avatar-generator","go","letter-avatar"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/disintegration.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-09T23:36:07.000Z","updated_at":"2024-10-08T10:22:12.000Z","dependencies_parsed_at":"2022-08-27T21:02:15.456Z","dependency_job_id":null,"html_url":"https://github.com/disintegration/letteravatar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/disintegration%2Fletteravatar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/disintegration%2Fletteravatar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/disintegration%2Fletteravatar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/disintegration%2Fletteravatar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/disintegration","download_url":"https://codeload.github.com/disintegration/letteravatar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230520392,"owners_count":18238948,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avatar","avatar-generator","go","letter-avatar"],"created_at":"2024-08-01T03:01:06.607Z","updated_at":"2024-12-20T01:15:29.961Z","avatar_url":"https://github.com/disintegration.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# letteravatar\n[![GoDoc](https://godoc.org/github.com/disintegration/letteravatar?status.svg)](https://godoc.org/github.com/disintegration/letteravatar)\n[![Build Status](https://travis-ci.org/disintegration/letteravatar.svg?branch=master)](https://travis-ci.org/disintegration/letteravatar)\n\nLetter avatar generation for Go.\n\n## Usage\n\nGenerate a 100x100px 'A'-letter avatar:\n\n```go\nimg, err := letteravatar.Draw(100, 'A', nil)\n```\n\nThe third parameter `options *Options` can be used for customization:\n\n```go\ntype Options struct {\n\tFont        *truetype.Font\n\tPalette     []color.Color\n\tLetterColor color.Color\n\tPaletteKey  string\n}\n```\n\nUsing a custom palette:\n\n```go\nimg, err := letteravatar.Draw(100, 'A', \u0026letteravatar.Options{\n\tPalette: []color.Color{\n\t\tcolor.RGBA{255, 0, 0, 255},\n\t\tcolor.RGBA{0, 255, 0, 255},\n\t\tcolor.RGBA{0, 0, 255, 255},\n\t},\n})\n```\n\n## Documentation\n\n[https://godoc.org/github.com/disintegration/letteravatar](https://godoc.org/github.com/disintegration/letteravatar)\n\n## Examples\n\n![](example/Alice.png)\n![](example/Bob.png)\n![](example/Carol.png)\n![](example/Dave.png)\n![](example/Eve.png)\n![](example/Frank.png)\n![](example/Gloria.png)\n![](example/Henry.png)\n![](example/Isabella.png)\n![](example/Жозефина.png)\n![](example/Ярослав.png)\n\n```go\npackage main\n\nimport (\n\t\"image/png\"\n\t\"log\"\n\t\"os\"\n\t\"unicode/utf8\"\n\n\t\"github.com/disintegration/letteravatar\"\n)\n\nvar names = []string{\n\t\"Alice\",\n\t\"Bob\",\n\t\"Carol\",\n\t\"Dave\",\n\t\"Eve\",\n\t\"Frank\",\n\t\"Gloria\",\n\t\"Henry\",\n\t\"Isabella\",\n\t\"James\",\n\t\"Жозефина\",\n\t\"Ярослав\",\n}\n\nfunc main() {\n\tfor _, name := range names {\n\t\tfirstLetter, _ := utf8.DecodeRuneInString(name)\n\n\t\timg, err := letteravatar.Draw(75, firstLetter, nil)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tfile, err := os.Create(name + \".png\")\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\terr = png.Encode(file, img)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n}\n\n```\n\n## License\n\nThe package \"letteravatar\" is distributed under the terms of the MIT license.\n\nThe Roboto-Medium font is distributed under the terms of the Apache License v2.0.\n\nSee [LICENSE](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdisintegration%2Fletteravatar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdisintegration%2Fletteravatar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdisintegration%2Fletteravatar/lists"}