dzuk-mutant/hundred-rabbits-themes-elm/1.0.0

NOTE: the latest version is 1.2.0

HRTheme

Decode theme files and use themes that conform to the Hundred Rabbits theme framework.

Because it would be impractical for HRTheme, there is no constructor function, you just manually create the record.

type alias HRTheme =
{ background : Color
, fHigh : Color
, fMed : Color
, fLow : Color
, fInv : Color
, bHigh : Color
, bMed : Color
, bLow : Color
, bInv : Color
}

A color theme that uses the Hundred Rabbits theme spec.

Because there's no central Color type in elm, you may have to convert these colours to another type when you get them to be usable.

The Color types used in this record are from avh4/elm-color.

decoder : Decoder HRTheme

Decodes a Hundred Rabbits theme SVG file/string into a usable type in Elm.

Alongside the String-based errors the XML decoder might generate, this decoder will generate errors specific to Hundred Rabbits themes:

  • Missing ID - eg. The ID 'f_low' was not found.
  • Invalid color hex - eg. The color at ID 'f_high' is not a valid hex color.