![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
github.com/undertreetech/letteravatar
Letter avatar generation for Go.
Generate a 100x100px 'A'-letter avatar:
img, err := letteravatar.Draw(100, 'A', nil)
The third parameter options *Options
can be used for customization:
type Options struct {
Font *truetype.Font
Palette []color.Color
LetterColor color.Color
PaletteKey string
}
Using a custom palette:
img, err := letteravatar.Draw(100, 'A', &letteravatar.Options{
Palette: []color.Color{
color.RGBA{255, 0, 0, 255},
color.RGBA{0, 255, 0, 255},
color.RGBA{0, 0, 255, 255},
},
})
https://godoc.org/github.com/disintegration/letteravatar
package main
import (
"image/png"
"log"
"os"
"unicode/utf8"
"github.com/disintegration/letteravatar"
)
var names = []string{
"Alice",
"Bob",
"Carol",
"Dave",
"Eve",
"Frank",
"Gloria",
"Henry",
"Isabella",
"James",
"Жозефина",
"Ярослав",
}
func main() {
for _, name := range names {
firstLetter, _ := utf8.DecodeRuneInString(name)
img, err := letteravatar.Draw(75, firstLetter, nil)
if err != nil {
log.Fatal(err)
}
file, err := os.Create(name + ".png")
if err != nil {
log.Fatal(err)
}
err = png.Encode(file, img)
if err != nil {
log.Fatal(err)
}
}
}
The package "letteravatar" is distributed under the terms of the MIT license.
The Roboto-Medium font is distributed under the terms of the Apache License v2.0.
See LICENSE.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.