19 declare(strict_types=1);
    33         "#0e6252", 
"#107360", 
"#aa890a", 
"#c87e0a", 
"#176437", 
"#196f3d", 
"#bf6516", 
"#a04000", 
"#1d6fa5", 
"#1b557a",
    34         "#bf2718", 
"#81261d", 
"#713b87", 
"#522764", 
"#78848c", 
"#34495e", 
"#2c3e50", 
"#566566", 
"#90175a", 
"#9e2b6e",
    35         "#d22f10", 
"#666d4e", 
"#715a32", 
"#83693a", 
"#963a30", 
"#e74c3c"    40         static $amount_of_colors;
    41         if (!isset($amount_of_colors)) {
    42             $amount_of_colors = count(self::$colors);
    45         $color = self::$colors[crc32($this->name) % $amount_of_colors];
    46         $tpl = new \ilTemplate(
'tpl.letter_avatar.svg', 
true, 
true, 
'Services/User');
    47         $tpl->setVariable(
'COLOR', $color);
    48         $tpl->setVariable(
'SHORT', $this->name);
    50         return 'data:image/svg+xml,' . rawurlencode($tpl->get());
 
Class ilUserAvatarLetter.