15 "#1abc9c",
"#16a085",
"#f1c40f",
16 "#f39c12",
"#2ecc71",
"#27ae60",
17 "#e67e22",
"#d35400",
"#3498db",
18 "#2980b9",
"#e74c3c",
"#c0392b",
19 "#9b59b6",
"#8e44ad",
"#bdc3c7",
20 "#34495e",
"#2c3e50",
"#95a5a6",
21 "#7f8c8d",
"#ec87bf",
"#d870ad",
22 "#f69785",
"#9ba37e",
"#b49255",
32 static $amount_of_colors;
33 if (!isset($amount_of_colors)) {
34 $amount_of_colors = count(self::$colors);
37 $color = self::$colors[crc32($this->name) % $amount_of_colors];
38 $tpl = new \ilTemplate(
'tpl.letter_avatar.svg',
true,
true,
'Services/User');
39 $tpl->setVariable(
'COLOR', $color);
40 $tpl->setVariable(
'SHORT', $this->name);
42 return 'data:image/svg+xml,' . rawurlencode(
$tpl->get());
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
Class ilUserAvatarLetter.