fix alpha bug for beards

This commit is contained in:
Codeberg 2021-02-02 01:59:19 +01:00
parent 247db3a6f4
commit 89d1e4ed62

10
main.go
View File

@ -6,6 +6,7 @@ import (
"math/bits"
"os"
"strings"
"strconv"
)
func main() {
@ -294,10 +295,10 @@ func maleAvatar(seed uint64) string {
// Mustache (50% chance)
g.pickAorB(0.5,
g.pickOne([]string{
"<path d='M3 10v3h1v1h1v1h10v-1h1v-1h1v-3h-3v1H6v-1H3z' id='Path' fill='${mustacheColor}' fill-opacity='${mustacheColor.alpha}'/>",
"<path d='M3 13h1v1h1v1h10v-1h1v-1h1v-3h-1v1h-1v1H5v-1H4v-1H3v3z' id='Path' fill='${mustacheColor}' fill-opacity='${mustacheColor.alpha}'/>",
"<path d='M3 11v2h1v1h1v1h10v-1h1v-1h1v-2H3z' id='Path' fill='${mustacheColor}' fill-opacity='${mustacheColor.alpha}'/>",
"<path d='M3 7v6h1v1h1v1h10v-1h1v-1h1V7h-1v2h-1v1h-1v1H6v-1H5V9H4V7H3z' id='Path' fill='${mustacheColor}' fill-opacity='${mustacheColor.alpha}'/>",
"<path d='M3 10v3h1v1h1v1h10v-1h1v-1h1v-3h-3v1H6v-1H3z' id='Path' fill='${mustacheColor}' fill-opacity='${mustacheColorAlpha}'/>",
"<path d='M3 13h1v1h1v1h10v-1h1v-1h1v-3h-1v1h-1v1H5v-1H4v-1H3v3z' id='Path' fill='${mustacheColor}' fill-opacity='${mustacheColorAlpha}'/>",
"<path d='M3 11v2h1v1h1v1h10v-1h1v-1h1v-2H3z' id='Path' fill='${mustacheColor}' fill-opacity='${mustacheColorAlpha}'/>",
"<path d='M3 7v6h1v1h1v1h10v-1h1v-1h1V7h-1v2h-1v1h-1v1H6v-1H5V9H4V7H3z' id='Path' fill='${mustacheColor}' fill-opacity='${mustacheColorAlpha}'/>",
}),
""),
// Mouth
@ -373,6 +374,7 @@ func maleAvatar(seed uint64) string {
"${eyesColor}", eyesColor.html(),
"${eyebrowsColor}", eyebrowsColor.html(),
"${mustacheColor}", mustacheColor.html(),
"${mustacheColorAlpha}", strconv.Itoa(int(mustacheColor.a)),
"${mouthColor}", mouthColor.html(),
"${glassesColor}", glassesColor.html(),
"${clothesColor}", clothesColor.html(),