title: How to get parameter in CoffeeScript event handler
body: <p>How does one go about accessing the parameters of an event handler in CoffeeScript?</p>
  
  <p>I have created a color picker widget in Dashing (<a href="http://dashing.io" rel="nofollow">http://dashing.io</a>).
  The color picker is based on Spectrum (<a href="https://bgrins.github.io/spectrum/#events" rel="nofollow">https://bgrins.github.io/spectrum/#events</a>), and publishes an onchange event with a color parameter.</p>
  
  <p>When the user clicks a color in the palette, the color name/code is generated on the front-end by the Spectrum color picker widget.</p>
  
  <p>Here's an excerpt of what the existing colorpicker code looks like:</p>
  
  <pre><code>change: function(color) {
      color.toHexString(); // i.e. #ff0000
  }
  </code></pre>
  
  <p>The implementation guide of the color picker is here:
  <a href="https://bgrins.github.io/spectrum/#events" rel="nofollow">https://bgrins.github.io/spectrum/#events</a></p>
  
  <p>In my coffeescript file, I have </p>
  
  <pre><code>$(@node).on 'change', (evt) =&gt; @handleChanged evt
  
    postState: (newState) -&gt;
      $.post '/openhab/dispatch',
        deviceId: @get('device'),
        command: newState
  
    handleChanged: (evt) -&gt;
      @postState("test")
  </code></pre>
  
  <p>I would like to be able to access the color parameter of the Spectrum color picker in the handleChanged function, and pass it on to the postState function in place of the "test" placeholder.</p>
  
  <p>Feel free to criticise - I am 100% lost when it comes to this high-level Coffeescript, Ruby on Rails environment, as I usually work in C, at register level on embedded devices.</p>