elm-color icon indicating copy to clipboard operation
elm-color copied to clipboard

Should fromHex return a Maybe/Result, or just a value?

Open avh4 opened this issue 5 years ago • 5 comments

Currently, fromHex is fromHex : String -> Color, meant for convenience in getting colors specified in hex into Elm, and returns rgb 0 0 0 if the hex string is invalid. Should it instead return a Maybe or Result so it can clearly indicate when a parse error occurs? Or should both functions be provided?

Questions:

  • [ ] How is fromHex commonly used?
  • [ ] Should fromHex be removed from the 1.0.0 release until more info can be obtained?

avh4 avatar Sep 10 '18 05:09 avh4