-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfallback.go
More file actions
166 lines (150 loc) · 10.6 KB
/
fallback.go
File metadata and controls
166 lines (150 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
package avatar
func fallbackAccessory(isMale bool) string {
if isMale {
return ``
}
return ``
}
func fallbackBeard() string {
return ``
}
func fallbackBodyShape() string {
return `
<g>
<path fill="{skin}" d="M99.6,116.1c-1.1-8.1-7.5-12.9-14.2-17-6.2-3.8-11.3-7.6-12.3-11.4-.1-.7-.1-5,.2-7.1,1.1-.9,2.2-2,3.5-3.4,1.4-1.6,2.7-3.7,3.9-6,1.2,.2,3.7-1.2,5.2-3.9,1.9-3.5,1.4-8.3,.4-9.4-.5-.5-1.4-.1-2.2,.3,.3-3.5,.4-7.2,.1-11.3-1-14.3-11.3-18.2-20.2-18.2s-19,3.9-20.2,18.2c-.3,4.1-.3,7.8,.1,11.3-.8-.5-1.7-.8-2.2-.3-1,1-1.6,5.9,.4,9.4,1.5,2.6,4,4.1,5.2,3.9,1.1,2.3,2.3,4.4,3.9,6,1.2,1.3,2.3,2.4,3.5,3.4,.2,1.9,.3,6.3,.3,6.3-.4,4.1-5.8,8-12.4,12.1s-13,8.9-14.2,17c-1.1,8.1-1.4,12-1.4,12H101c0,.1-.2-3.8-1.4-11.9Z" />
<path fill="{skin_shadow}" d="M64,67.5s-1.4-.1-2.3-.6c0,0,.4,1.8,2.3,1.9,1.9-.2,2.3-1.9,2.3-1.9-.9,.5-2.3,.6-2.3,.6Z" />
<path fill="{skin_shadow}" opacity="0.2" d="M43.9,58.2c-.8-.5-1.7-.8-2.2-.3-1,1-1.6,5.9,.4,9.4,1.5,2.6,4,4.1,5.2,3.9-1.69-4.35-2.93-8.68-3.4-13Z" />
<path fill="{skin_shadow}" opacity="0.2" d="M84.1,58.2c-.16,4.14-1.55,8.52-3.4,13,1.2,.2,3.7-1.2,5.2-3.9,1.9-3.5,1.4-8.3,.4-9.4-.5-.5-1.4-.1-2.2,.3Z" />
<path fill="{skin_shadow}" opacity="0.2" d="M73.05,86.64c-.03-1.59,.02-4.45,.25-6.05-3.7,3.2-6.9,4.1-9.5,4.1s-5.44-.89-9.09-4.01c0,0,0,0,0,0,.1,1.02,.18,2.68,.23,4.02,9.07,5.28,18.12,2.44,18.11,1.93Z" />
</g>`
}
func fallbackDress(isMale bool) string {
if isMale {
return `
<g>
<path fill="{dress}" d="M99.9,115.8c-1.1-8.2-7.5-13-14.3-17.1-3.1-1.8-5.8-3.8-8.1-5.6-3.1,4.4-8.1,7.2-13.9,7.2s-10.6-2.7-13.6-6.8c-2.1,1.7-4.7,3.5-7.6,5.3-6.6,4.1-13.1,9-14.3,17.1-1.1,8.2-1.4,12.1-1.4,12.1H101.3c0-.1-.2-4-1.4-12.2Z" />
<path fill="{dress_shadow}" d="M78.9,94.1c-.4-.3-.8-.7-1.2-1-3.1,4.4-8.1,7.2-13.9,7.2s-10.6-2.7-13.6-6.8c-.4,.3-.8,.7-1.3,1,2.9,5.3,8.6,9,15,9,6.4-.1,12.2-3.9,15-9.4Z" />
</g>`
}
return `
<g>
<path fill="{dress}" d="M101,128c1.8-18.2-10-25.5-10-25.5l-15.3-11l-7.5,2.9L63.7,109l-5.1-15.8l-7-1.1L36.1,103c0,0-10.8,6.4-9.2,25H101z"/>
<path fill="white" d="M51.6,88.7c-2.6,5.7-6.5,8.2-6.7,8.5c-0.4,0.9,7.3,5,8.5,4.3s4.7-5.8,4.7-5.8l5.5,13.8l-3.8-15.6L51.6,88.7zM75.7,88.7l-8.3,5.2l-3.8,15.6l5.5-13.8c0,0,3.5,5.1,4.7,5.8c1.2,0.7,9-3.6,8.7-4.5C82.5,96.7,78.3,94.3,75.7,88.7z"/>
</g>`
}
func fallbackEye(isMale bool) string {
if isMale {
return `
<g>
<path d="M56.3,58.2c0.9,0.8,1.1,2.5,0.5,3.6c-0.7,1.2-2,1.4-2.9,0.6c-0.9-0.8-1.1-2.5-0.5-3.6C54,57.7,55.3,57.4,56.3,58.2z"/>
<path d="M71.9,58.2c-0.9,0.8-1.1,2.5-0.5,3.6c0.7,1.2,2,1.4,2.9,0.6c0.9-0.8,1.1-2.5,0.5-3.6C74.1,57.7,72.8,57.4,71.9,58.2z"/>
</g>`
}
return `
<g>
<path d="M56.1,57.3c-0.1-0.5-0.5-1-1.2-0.8c-0.7,0.2-4.2-0.5-3.9,1.1c0,0.1,0.2,0.1,0.3,0.1c0.2,0.1,0.4,0,0.7,0.1
c0.3,0.1,0.5,0.2,0.8,0.3c0.4,0.2,0.9,0.4,1.3,0.5c-0.1,0.4-0.2,0.9-0.2,1.4c0,1.7,0.7,3.1,1.5,3.1s1.5-1.4,1.5-3.1
C56.8,58.8,56.5,57.8,56.1,57.3z"/>
<path d="M75.5,56.5c-1,0.4-2.2-0.3-3.2,0.2c-0.1,0-0.5,0.4-0.7,0.6c-0.4,0.6-0.7,1.5-0.7,2.6c0,1.7,0.7,3.1,1.5,3.1
c0.8,0,1.5-1.4,1.5-3.1c0-0.6-0.1-1.2-0.2-1.6c0.1,0,0.1,0.1,0.2,0.1c0.7,0.3,1.5,0.4,2.2,0.1C77.2,57.9,76.8,56.1,75.5,56.5z"/>
</g>`
}
func fallbackEyebrow(isMale bool) string {
if isMale {
return `
<g>
<path fill="{hair_shadow}" d="M57.69,55.11h-7c-.55,0-1-.45-1-1h0c0-.55,8-1,8-1,.55,0,1,.45,1,1h0c0,.55-.45,1-1,1Z" />
<path fill="{hair_shadow}" d="M70.42,55.11h7c.55,0,1-.45,1-1h0c0-.55-8-1-8-1-.55,0-1,.45-1,1h0c0,.55,.45,1,1,1Z" />
</g>`
}
return `
<g>
<path fill="{hair_shadow}" d="M56.5,51.4c-0.1,0-0.2-0.1-0.3-0.1c-1-0.4-1.9-0.5-3.1-0.4c-1.1,0.1-1.9,0.4-2.9,0.9
c-0.4,0.3-2.1,1.7-1.6,2.2c0.2,0.1,1.9-0.8,2.4-1c0.8-0.2,1.4-0.3,2.2-0.3c0.8,0,1.3,0.1,2,0.4c0,0,0.1,0.1,0.2,0.1
c1.4,0.7,1.3,1.1,2.3,0.5C59.1,52.8,57.6,52,56.5,51.4z"/>
<path fill="{hair_shadow}" d="M71.4,51.4c0.1,0,0.2-0.1,0.3-0.1c1-0.4,1.9-0.5,3.1-0.4c1.1,0.1,1.9,0.4,2.9,0.9c0.4,0.3,2.1,1.7,1.6,2.2
c-0.2,0.1-1.9-0.8-2.4-1c-0.8-0.2-1.4-0.3-2.2-0.3c-0.8,0-1.3,0.1-2,0.4c0,0-0.1,0.1-0.2,0.1c-1.4,0.7-1.3,1.1-2.3,0.5
C68.8,52.8,70.3,52,71.4,51.4z"/>
</g>`
}
func fallbackGlasses(isMale bool) string {
if isMale {
return ``
}
return ``
}
func fallbackHair(isMale bool) string {
if isMale {
return `
<g>
<path fill="{hair}" d="M42.06,50.33c-.13,1.85,.5,5.39,1.01,7.45,.36,.21,.48,.18,.84,.42,.1,.09,.06,1.82,.14,1.91h.72c-.17-1.2,.22-5.93,1.18-13.15,.88-6.64,4.38-7.08,4.38-7.08,15.47,4.13,27.41,.16,27.41,.16,3.37,2.7,2.93,4.4,3.73,9.78,.88,4.45,1.12,8.4,1.56,10.53l.9-.05c.09-.2,.06-2.07,.18-2.1,.65-.27,.54-.25,.84-.38,0,0,1.15-4.76-.14-8.81,1.14-4.79,.52-8.13,.52-8.13,1.65-4.95-4.84-11.64-4.84-11.64-1.84-4.93-7.04-4.13-7.04-4.13-.15-1.43-2.91-2.54-3.68-3.25-.77-.71-4.59,1.98-4.59,1.98-4.44-3.81-8.42-.95-8.42-.95-4.9-.48-6.43,4.45-6.43,4.45-3.68,.48-3.37,3.34-3.37,3.34-1.84,.95-2.14,4.45-2.14,4.45-4.13,2.07-2.96,4.77-2.96,4.77-1.89,3.02,.21,10.45,.21,10.45Z" />
<path fill="{hair_highlight}" d="M57.59,23.84s-2.3,11.51,5.76,17.19c0,0-5.68-4.75-5.76-17.19Z" />
<path fill="{hair_highlight}" d="M59.53,41.04s-10.43-.94-11.73-9.93c0,0,2.3,7.27,11.73,9.93Z" />
<path fill="{hair_highlight}" d="M53.67,25.93s-1.12,7.55,5.14,12.16c0,0-8.56-4.46-5.14-12.16Z" />
</g>`
}
return `
<g>
<path fill="{hair}" d="M97.05,70c-1.58-4.1-3.94-7.97-5.04-12.19-.95-3.61-.96-7.39-2.27-10.91-.03-.09-.07-.17-.1-.26,0-.39,0-.77,0-1.15,0-6.98-5.33-28.74-24.84-24.84,0,0-7.6-2.67-15.81,2.67-2.8,1.82-4.93,4.07-6.52,6.58-.15,.17-.3,.35-.45,.54-.87,1.07-3.31,4.63-5.2,7.95-2.55,3.25-2.54,7.51-1.93,11.41,.61,3.9,1.73,7.83,1.06,11.72-.63,3.69-2.82,7-4.44,10.45-1.62,3.45-2.68,7.41-1.03,10.84,.89,1.87,2.51,3.42,3.51,5.25,.93,1.73,1.28,3.69,.98,5.58-.36,2.31-1.66,4.54-1.32,6.86,.2,1.3,.93,2.48,1.95,3.47,2.14-1.85,4.56-3.47,7.01-4.99,6.6-4.1,12-8,12.4-12.1,0,0-.1-4.4-.3-6.3-1.2-1-2.3-2.1-3.5-3.4-1.6-1.6-2.8-3.7-3.9-6-1.2,.2-3.7-1.3-5.2-3.9-2-3.5-1.4-8.4-.4-9.4,.5-.5,1.4-.2,2.2,.3-.1-.83,.64,5.1,1.53,7.52-.34-2.92,.06-8.59,.39-11.51,.34-2.92,1.42-5.86,3.54-7.89,2.02-1.93,4.78-2.88,7.49-3.55,2.72-.66,5.52-1.11,8.06-2.26,2.57-1.17,4.17-2.97,5.5-5.34,1.03,2.67,2.4,5.03,4.73,6.79,1.82,1.37,4.02,2.3,5.49,4.04,1.51,1.79,2.02,4.21,2.25,6.53,.3,3.01-.02,10.73-.52,13.72,.55-1.11,1.74-8.06,1.74-8.06,.8-.4,1.69-.79,2.18-.29,1,1.1,1.5,5.9-.4,9.4-1.5,2.7-4,4.1-5.2,3.9-1.2,2.3-2.5,4.4-3.9,6-1.3,1.4-2.4,2.5-3.5,3.4-.3,2.1-.3,6.4-.2,7.1,1,3.8,6.1,7.6,12.3,11.4,2.73,1.67,5.41,3.47,7.7,5.55,1.25-.64,2.24-1.52,2.67-2.75,1.24-3.52-3.11-6.79-3.2-10.47-.09-3.27,3.11-5.81,4.7-8.77,2.11-3.92,1.36-8.55-.22-12.65Z" />
<path fill="{dress}" d="M50.46,34.45c4.04-2.72,8.81-4.19,13.62-4.99,3.39-.56,6.92-.8,10.22,.19-3.46-3.86-8.89-5.69-14.04-5.19-5.15,.49-9.98,3.17-13.52,6.95-2.73,2.91-6.7,9.37-4.51,13.5,2.26-4.18,4.11-7.68,8.24-10.45Z" />
<path fill="{hair_shadow}" d="M55,86.9s-.1-4.4-.3-6.3c-1.2-1-2.3-2.1-3.5-3.4-1.6-1.6-2.8-3.7-3.9-6-.62,.1-1.57-.25-2.56-.96,.27,1.18,.46,2.36,.39,3.57-.24,3.91-3.24,7.46-2.69,11.34,.48,3.39,3.55,5.9,4.33,9.24,.14,.6,.2,1.19,.2,1.78,4.47-3.09,7.72-6.12,8.03-9.26Z" />
<path fill="{hair_shadow}" d="M84.2,46.9c.3,4.1,.2,7.8-.1,11.3,.8-.4,1.7-.8,2.2-.3,1,1.1,1.5,5.9-.4,9.4-1.5,2.7-4,4.1-5.2,3.9-1.2,2.3-2.5,4.4-3.9,6-1.3,1.4-2.4,2.5-3.5,3.4-.3,2.1-.3,6.4-.2,7.1,1,3.8,6.1,7.6,12.3,11.4,.5,.31,1,.62,1.5,.94-2.08-2.25-3.56-4.68-2.85-8.27,.56-2.81,2.31-5.21,3.92-7.58,2.15-3.17,4.19-6.83,3.65-10.62-.36-2.55-1.85-4.77-2.84-7.14-.93-2.23-1.43-4.63-1.47-7.05-.04-2.68,.48-5.36,.31-8.04-.18-3.01-1.21-5.89-2.23-8.72-.51-1.42-1.04-2.88-1.99-4.05-.66-.81-1.5-1.44-2.39-1.99,1.72,2.61,2.89,5.99,3.19,10.33Z" />
</g>`
}
func fallbackHairColor() SVGHairColor {
return NewHairColor(
NewHex("#3a3b40"),
NewHex("#202123"),
NewHex("#4c4d51"),
)
}
func fallbackMouth(isMale bool) string {
if isMale {
return `
<g>
<path fill="#852325" d="M68.7,71.4h-9.4c-0.2,0-0.3,0.4-0.2,0.7c0.8,1.6,2.7,2.7,5,2.7c2.1,0,4.1-1.1,4.9-2.6C69.1,71.9,69,71.4,68.7,71.4z"/>
<path fill="#D02D2F" d="M68,73.4c-0.7-1-2.2-1.6-4-1.6c-1.7,0-3.3,0.7-4,1.6c1,0.9,2.4,1.5,4,1.5C65.5,74.8,67,74.3,68,73.4z"/>
<path fill="white" d="M68.7,71.4h-9.4c0.3,0.4,0.7,0.9,1.3,1c1,0.2,3.4,0.2,3.4,0.2l0,0l0,0c0,0,2.3,0,3.4-0.2C68,72.3,68.4,71.8,68.7,71.4z"/>
</g>`
}
return `
<g>
<path d="M60.3,73.5c0.8,0.3,2.8,0.8,3.7,0.7c0.9,0,2.7-0.3,3.6-0.6c1.2-0.5,1.6-0.9,2.2-1.2c0.1,0,0.2-0.1,0.2-0.1
l0,0l0,0c-0.2,0.1-0.4,0.2-0.7,0.3c-0.3,0.1-0.9,0.2-1.5,0.3c-0.3,0.3-0.3,0.3-1,0.6C66.2,73.8,64.7,74,64,74
c-0.7,0-2.3-0.3-2.9-0.6c-0.5-0.2-0.4-0.2-0.8-0.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VGPalette {
return NewPalette(
NewHex("#b3c3da"),
NewHex("#1e3a5c"),
NewHex("#00509d"),
NewHex("#003f88"),
NewHex("#003f88"),
)
}
func fallbackShape() SVGShape {
return NewShape(``, ``)
}
func fallbackSkinColor() SVGSkinColor {
return NewSkinColor(
NewHex("#ffd2b5"),
NewHex("#604d42"),
)
}
func fallbackSticker() string {
return `<path fill="{text}" d="M62.39,89.12l-16.89,8.88c-2.54,1.33-5.51-.82-5.02-3.65l3.23-18.8c.19-1.12-.18-2.27-1-3.06l-13.66-13.32c-2.05-2-.92-5.49,1.92-5.9l18.88-2.74c1.13-.16,2.1-.87,2.61-1.89l8.44-17.11c1.27-2.57,4.94-2.57,6.21,0l8.44,17.11c.5,1.02,1.48,1.73,2.61,1.89l18.88,2.74c2.84,.41,3.97,3.9,1.92,5.9l-13.66,13.32c-.82,.79-1.19,1.94-1,3.06l3.23,18.8c.48,2.83-2.48,4.98-5.02,3.65l-16.89-8.88c-1.01-.53-2.21-.53-3.22,0Z"/>`
}
func fallbackLetter() string {
return `<path fill="{text}" d="M56.06,73.83v-14.55l2.75,.08c5.35,0,8.41-1.81,8.41-7.63,0-2.2-.39-6.68-3.46-6.68s-3.38,4.4-3.38,6.76h-15.41v-1.18c-.24-11.17,7.71-18.79,18.63-18.79s19.42,8.02,19.42,19.34c0,7.47-3.54,14.7-11.72,16.51v6.13h-15.25Zm-1.1,13.21c0-4.8,4.01-8.88,8.65-8.88,5.11,0,9.36,3.85,9.36,9.12,0,4.95-4.09,8.89-9.04,8.89s-8.96-4.09-8.96-9.12Z"/>`
}