portal avatar color

This commit is contained in:
Yuri Kuznetsov
2024-03-29 11:34:52 +02:00
parent b6807091a5
commit 6c62dbc604
+7 -2
View File
@@ -47,10 +47,11 @@ use LasseRafn\StringScript;
*/
class Avatar extends Image
{
protected string $systemColor = '#a4b5bd';
private string $systemColor = '#a4b5bd';
private string $portalColor = '#c9a3d1';
/** @var string[] */
protected $colorList = [
private array $colorList = [
'#6fa8d6',
'#edc555',
'#d4729b',
@@ -68,6 +69,10 @@ class Avatar extends Image
return $this->metadata->get(['app', 'avatars', 'systemColor']) ?? $this->systemColor;
}
if ($user->isPortal()) {
return $this->metadata->get(['app', 'avatars', 'portalColor']) ?? $this->portalColor;
}
$hash = $user->getId();
$length = strlen($hash);