Expand description
Generates 19-circle identicons in png
and in svg
format from &[u8]
input slice. Slice length could be arbitrary, as identicon generation starts with input hashing. Typical input is a public key.
Identicon example:
The identicon color scheme and elements arrangement follow the published javascript code for polkadot identicon generation. This crate is intended mainly for use by Signer.
Crate also supports generation of identicon-like images with pre-set colors in RGBA format, mainly for test purposes.
Feature "pix"
supports generation of png
images, feature "vec"
- generation of svg
images. Both are made available by default.
Re-exports§
pub use colors::Color;
Modules§
Enums§
- Identicon
Error - Errors in
png
identicon generation
Constants§
- EMPTY_
PNG - Static 30x30 transparent
png
, for rare cases when the identicon generation fails or when the data to generate identicon is unavailable
Functions§
- generate_
png - Polkadot identicon
png
data inu8
vector format, from&[u8]
input slice - generate_
png_ scaled_ custom - Data for small-sized identicon
png
, from&[u8]
input slice, larger image is generated first and then scaled down to fit the required size - generate_
png_ scaled_ custom_ with_ colors - Data for small-sized identicon
png
, with given colors, larger image is generated first and then scaled down to fit the required size - generate_
png_ scaled_ default - Data for small-sized identicon
png
, from&[u8]
input slice, with default settings used for Signer app - generate_
png_ with_ colors - Polkadot identicon
png
data inu8
vector format, with given colors - generate_
svg - Identicon
svg::Document
data, from&[u8]
input slice - generate_
svg_ with_ colors - Identicon
svg::Document
data, with given colors