Models
Classes used to facilitate the module's usage.
Last updated
Was this helpful?
Classes used to facilitate the module's usage.
Last updated
Was this helpful?
options
(): all possible basic options (work for all styles)
default_options
(): a dict with all default options
styles
(): all available styles
All colors used for this module are made with this class. This uses HTML/hex color codes.
Note that html_code
can also be transparent
when used for the backgroundColor
option!
Returns: : when called as string it will return the color code
Raises: : an incorrect html color code is given
html_code
"transparent"
HTML/hex color code. This can be a list of strings if backgroundType
has been set to "gradientLinear"
Get a random valid HTML color code.
Not to be initialized!
Returns a dict with the JSON schema (all properties) of the given avatar style.
style
N/A
The name of the style you want to get the schema of.
Get an avatar style from a string.
style_str
N/A
The string to form a style.
list
= all_styles
adventurer
adventurer_neutral
avataaars
avataaars_neutral
big_ears
big_ears_neutral
big_smile
bottts
bottts_neutral
croodles
croodles_neutral
dylan
fun_emoji
glass
icons
identicon
initials
lorelei
lorelei_neutral
micah
miniavs
notionists
notionists_neutral
open_peeps
personas
pixel_art
pixel_art_neutral
rings
shapes
thumbs
Not to be initiated!
format_str
N/A
The string to form a format.
list
= all_formats
svg
webp
avif
png
jpg
jpeg
json
flip
False
Whether to flip the image vertically
rotate
default 0
min 0
, max 360
Rotate the avatar
scale
default 100
min 0
, max 200
Scale of the drawn avatar
radius
default 0
min 0
, max 50
Radius of the avatar (borders)
size
default 256
min 1
, max 256
Size of the avatar (in pixels)
backgroundColor
DColor("transparent")
Background color for the avatar image
backgroundType
solid
The type of background (only solid
or gradientLinear
)
backgroundRotation
0
The background's rotation (only with gradientLinear
)
translateX
default 0
min -100
, max 100
Move the avatar horizontally
translateY
default 0
min -100
, max 100
Move the avatar vertically
randomizeIds
default False
Randomize the IDs in the generated SVG/XML, can be useful if the avatars are included directly in HTML and you want to avoid ID conflicts.
**kwargs
Any
N/A
Kwargs
empty
default_options
= default
| []
Returns: : the instance with a random color.
Returns: : the dictionary containing the avatar style's schema.
Get a random style for .
Returns: : returns a random Style string.
Returns: : returns a Style string from the given string if the style exists.
For more info check .
Returns: : returns a Format string from the given string if the format exists.
Returns: : the instance to use for .