coinop-logan / phace / Phace

Making Phaces

fromEthAddress : Eth.Types.Address -> Basics.Int -> Basics.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 -> Basics.Int -> Basics.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 : Eth.Types.Address -> Result Error ( Basics.Float, Basics.Float, Basics.Float )

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