gdotdesign / elm-ui

UI library for making web applications with Elm
https://elm-ui.netlify.com
BSD 2-Clause "Simplified" License
920 stars 39 forks source link

Cannot initialize ColorPicker with a color #95

Closed WoozyGoat closed 6 years ago

WoozyGoat commented 6 years ago

Documentation says that we can initialize ColorPicker in this way : colorPicker = Ui.ColorPicker.init Color.yellow

But when I tried that, I got this error : Functioninitis expecting the argument to be: () But it is: Color.Color

Is this a bug, or am I doing something wrong?

gdotdesign commented 6 years ago

The documentation is wrong in this case.

You can initialize a new Ui.ColorPicker with:

( colorPicker, cmd ) = 
  Ui.ColorPicker.init ()
  |> Ui.ColorPicker.setValue Color.Yellow
WoozyGoat commented 6 years ago

Thanks a lot, it works ! I close this issue.