ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Letter.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ILIAS\UI\Component as C;
24 
25 class Letter extends Avatar implements C\Symbol\Avatar\Letter
26 {
27  public function getAbbreviation(): string
28  {
29  return (mb_substr($this->getUsername(), 0, 2));
30  }
31 
32  public function getBackgroundColorVariant(): int
33  {
34  return ((crc32($this->getAbbreviation()) % 26) + 1);
35  }
36 }