31function roundedRect($img,
int $x,
int $y,
int $w,
int $h,
int $r,
int $color): void {
32 imagefilledrectangle($img, $x + $r, $y, $x + $w - $r, $y + $h, $color);
33 imagefilledrectangle($img, $x, $y + $r, $x + $w, $y + $h - $r, $color);
34 imagefilledellipse($img, $x + $r, $y + $r, $r * 2, $r * 2, $color);
35 imagefilledellipse($img, $x + $w - $r, $y + $r, $r * 2, $r * 2, $color);
36 imagefilledellipse($img, $x + $r, $y + $h - $r, $r * 2, $r * 2, $color);
37 imagefilledellipse($img, $x + $w - $r, $y + $h - $r, $r * 2, $r * 2, $color);
43 for ($y = 0; $y < $h; $y++) {
44 $t = $y / max(1, $h - 1);
45 $r = (int)(244 - 18 * $t);
46 $g = (int)(249 - 28 * $t);
47 $b = (int)(255 - 22 * $t);
48 imageline($img, 0, $y, $w, $y,
c($img, $r, $g, $b));
50 imagefilledellipse($img, 260, 120, 520, 220,
c($img, 221, 238, 255, 30));
51 imagefilledellipse($img, 1060, 150, 360, 180,
c($img, 214, 232, 255, 45));
52 imagefilledellipse($img, 640, 710, 780, 96,
c($img, 24, 50, 93, 94));
76 $dark = $bodyColor ===
'blue' ?
c($img, 18, 51, 112) :
c($img, 246, 250, 255);
77 $side = $bodyColor ===
'blue' ?
c($img, 11, 35, 82) :
c($img, 224, 235, 248);
78 $rim =
c($img, 255, 255, 255, 35);
79 imagefilledellipse($img, 641, 270, 394, 72,
c($img, 25, 45, 78, 72));
80 imagefilledrectangle($img, 444, 270, 838, 560, $dark);
81 imagefilledellipse($img, 641, 560, 394, 72, $side);
82 imagefilledellipse($img, 641, 270, 394, 72, $rim);
83 imageellipse($img, 641, 270, 394, 72,
c($img, 110, 150, 205, 20));
84 imagefilledellipse($img, 865, 405, 146, 190,
c($img, 210, 225, 245, 20));
85 imagefilledellipse($img, 856, 405, 92, 132,
c($img, 238, 246, 255));
91 $base = $kind ===
'hoodie' ?
c($img, 24, 39, 64) :
c($img, 16, 26, 44);
92 $shade =
c($img, 7, 18, 35);
93 if ($kind ===
'cap') {
94 imagefilledellipse($img, 640, 385, 380, 190,
$base);
95 imagefilledellipse($img, 770, 480, 350, 90,
c($img, 12, 32, 70));
96 imagearc($img, 640, 385, 348, 164, 190, 350,
c($img, 120, 160, 220));
100 if ($kind ===
'hoodie') {
101 imagefilledellipse($img, 640, 264, 240, 190, $shade);
102 imagefilledellipse($img, 640, 290, 172, 126,
c($img, 230, 238, 250));
104 imagefilledpolygon($img, array(405,270, 530,220, 600,290, 680,290, 750,220, 875,270, 810,435, 760,412, 760,620, 520,620, 520,412, 470,435), 12,
$base);
105 imagefilledpolygon($img, array(405,270, 530,220, 520,412, 470,435), 4, $shade);
106 imagefilledpolygon($img, array(750,220, 875,270, 810,435, 760,412), 4, $shade);
107 if ($kind ===
'hoodie') {
108 roundedRect($img, 570, 505, 140, 62, 16,
c($img, 13, 28, 52));
109 imageline($img, 615, 300, 585, 440,
c($img, 210, 220, 235));
110 imageline($img, 665, 300, 695, 440,
c($img, 210, 220, 235));
116 if ($type ===
'poster') {
117 roundedRect($img, 430, 150, 420, 520, 10,
c($img, 255, 255, 255));
118 imagerectangle($img, 430, 150, 850, 670,
c($img, 194, 211, 232));
122 if ($type ===
'notebook') {
123 roundedRect($img, 448, 180, 384, 500, 22,
c($img, 19, 42, 86));
124 roundedRect($img, 486, 230, 310, 390, 14,
c($img, 240, 247, 255));
126 for ($i = 0; $i < 8; $i++) imagefilledellipse($img, 466, 235 + $i * 48, 14, 14,
c($img, 210, 225, 244));
129 $w = $type ===
'deskmat' ? 690 : 520;
130 $h = $type ===
'deskmat' ? 340 : 310;
131 $x = 640 - (int)($w / 2);
132 $y = 400 - (int)($h / 2);
133 roundedRect($img, $x, $y, $w, $h, 28,
c($img, 15, 34, 73));
134 roundedRect($img, $x + 18, $y + 18, $w - 36, $h - 36, 20,
c($img, 22, 55, 126));
135 addLogo($img,
$logo, $x + (
int)($w * .29), $y + (
int)($h * .22), (
int)($w * .42), (
int)($h * .55));
142 roundedRect($img, 555, 185, 170, 475, 52,
c($img, 230, 238, 248));
143 roundedRect($img, 580, 125, 120, 82, 24,
c($img, 28, 50, 82));
144 imagefilledrectangle($img, 590, 110, 690, 140,
c($img, 18, 34, 58));
149 roundedRect($img, 420, 330, 340, 110, 24,
c($img, 25, 47, 82));
150 roundedRect($img, 745, 350, 120, 70, 10,
c($img, 198, 211, 226));
154 roundedRect($img, 430, 235, 420, 290, 34,
c($img, 20, 42, 78));
155 roundedRect($img, 456, 260, 368, 238, 24,
c($img, 30, 72, 144));
157 imagefilledrectangle($img, 797, 315, 820, 360,
c($img, 200, 218, 238));
160 roundedRect($img, 455, 270, 370, 330, 16,
c($img, 238, 241, 245));
161 imagearc($img, 640, 278, 220, 170, 190, 350,
c($img, 45, 62, 90));
165 imagesetthickness($img, 34);
166 imagearc($img, 640, 310, 420, 300, 20, 340,
c($img, 17, 63, 145));
167 imagesetthickness($img, 1);
168 roundedRect($img, 570, 470, 140, 95, 12,
c($img, 245, 249, 255));
172 imagefilledellipse($img, 620, 260, 150, 150,
c($img, 204, 216, 232));
173 imagefilledellipse($img, 620, 260, 92, 92,
c($img, 238, 246, 255));
174 roundedRect($img, 535, 350, 210, 150, 26,
c($img, 20, 50, 105));
178 roundedRect($img, 530, 155, 220, 500, 34,
c($img, 18, 31, 52));
179 roundedRect($img, 548, 185, 184, 440, 24,
c($img, 236, 243, 252));
183 roundedRect($img, 430, 235, 420, 300, 28,
c($img, 28, 49, 78));
184 imageline($img, 450, 295, 830, 295,
c($img, 82, 112, 150));
188 roundedRect($img, 500, 170, 110, 390, 34,
c($img, 24, 42, 68));
189 roundedRect($img, 590, 390, 210, 120, 36,
c($img, 24, 42, 68));
190 roundedRect($img, 650, 170, 110, 390, 34,
c($img, 238, 242, 248));
191 roundedRect($img, 740, 390, 210, 120, 36,
c($img, 238, 242, 248));
196 imagefilledellipse($img, 640, 420, 410, 290,
c($img, 22, 39, 68));
197 imagefilledrectangle($img, 440, 420, 840, 540,
c($img, 19, 34, 61));
198 roundedRect($img, 560, 425, 160, 86, 14,
c($img, 241, 246, 252));
202 for ($i = 0; $i < 5; $i++) {
204 imagefilledellipse($img, $x, 390 + (($i % 2) * 38), 130, 130,
c($img, 255, 255, 255));
205 addLogo($img,
$logo, $x - 44, 350 + (($i % 2) * 38), 88, 72);
209 for ($i = 0; $i < 3; $i++) {
211 roundedRect($img, 390, $y, 500, 34, 17, $i === 1 ?
c($img, 225, 36, 48) :
c($img, 20, 55, 125));
212 imagefilledpolygon($img, array(890,$y, 950,$y+17, 890,$y+34), 3,
c($img, 170, 185, 205));