AvatarGenerator Class

Generates SVG avatars from names and options.

public static class AvatarGenerator

Methods

NameDescription
CreateSvg(string)Creates an avatar SVG string for the specified name, using the default options.
CreateSvg(string, AvatarOptions)Creates an avatar SVG string for the specified name and options.

CreateSvg overloads

CreateSvg(string)

AvatarGenerator.cs

Creates an avatar SVG string for the specified name, using the default options.

public static string CreateSvg(string name)
Parameters
name string
The full name used to compute the color and the bigram.
Returns

string The generated SVG string.

CreateSvg(string, AvatarOptions)

AvatarGenerator.cs

Creates an avatar SVG string for the specified name and options.

public static string CreateSvg(string name, AvatarOptions options)
Parameters
name string
The full name used to compute the color and default bigram.
options AvatarOptions
The generation options.
Returns

string The generated SVG string.

Remarks

Characters that are not valid in an XML document are removed from name. An explicit AvatarOptions.Bigram containing such characters is rejected instead.