coinop-logan/phace/3.0.0

NOTE: the latest version is 3.0.1

Phace

Making Phaces

fromEthAddress : Address -> Int -> Int -> Html msg

Generate a phace from an Ethereum Address. Uses 32 chraracters, leaving 6 characters near the middle unused.

Specify svg width and height (Note that values other than 100x100 have only been minimally tested)

CAUTION: If you supply a malformed Eth address (maybe you were mucking about with Eth.Utils.unsafeToAddress?), this will produce a plain div with an error message in it.

fromHexString : String -> Int -> Int -> Result Error (Html msg)

Generate a phace from a hexadecimal String. Make sure to remove any "0x" from the source first. Specify svg width and height

type Error
= NotHexString
| SourceTooSmall

Phace generation will fail if the provided source is too short or not composed of hex characters.

errorToString : Error -> String

Get an explanation from an error type.

faceColorFromAddress : Address -> Result Error ( Float, Float, Float )

Just get the primary color of the Phace. Can be used to make a unique "character color" that matches the Phace.