data->username, 0, 1)); } public static function getAvatarColor( ?XenForoUser $user = null ): string { if( $user === null ) { $user = \Auth::user(); if( $user === null ) { return ''; } } return self::XF_AVATAR_COLORS[ crc32( $user->data->username ) % count( self::XF_AVATAR_COLORS ) ]; } }