title: JQuery color picker change hex value
body: <p>I'm using this colorpicker <a href="http://www.eyecon.ro/colorpicker" rel="nofollow">http://www.eyecon.ro/colorpicker</a> and am trying to capture the hex value so that I can use it on the server side to store the selected color.</p>
  
  <p>I'm unable to get the selected color after changing the default color.</p>
  
  <p>Here is my code:</p>
  
  <pre><code> var currentHex = '#0000ff';
              alert(currentHex);
              $('#colorSelector').ColorPicker({
                  color: currentHex,
                  onShow: function (colpkr) {
                      $(colpkr).fadeIn(500);
                      return false;
                  },
                  onHide: function (colpkr) {
                      $(colpkr).fadeOut(500);
                      return false;
                  },
                  onChange: function (hsb, hex, rgb) {
                      // every time a new colour is selected, this function is called
                      currentHex = hex;
                      $('#mycolor').val = currentHex;
                  }
              });
  </code></pre>
  
  <p>Html:</p>
  
  <pre><code>&lt;div id="colorSelector"&gt;&lt;div style="background-color: rgb(62, 62, 189); "&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;input type="text" maxlength="6" size="6" id="mycolor" value="00ff00"&gt;
  </code></pre>
  
  <p>Here is my <strong><a href="http://jsfiddle.net/ZRWEd/" rel="nofollow">Demo</a></strong></p>