ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
Letter.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 
4 
5 use ILIAS\UI\Component as C;
7 
8 class Letter extends Avatar implements C\Symbol\Avatar\Letter
9 {
10  public function getAbbreviation() : string
11  {
12  return (substr($this->getUsername(), 0, 2));
13  }
14 
15  public function getBackgroundColorVariant() : int
16  {
17  return ((crc32($this->getAbbreviation()) % 26) + 1);
18  }
19 }