Spectrum color picker get the value of the color

mengmeng picture mengmeng · Oct 11, 2013 · Viewed 17.2k times · Source

I implemented Spectrum's color picker just fine

But I don't know how to get the value inside the texfield using javascript. Can someone help me?

Answer

Bob Tate picture Bob Tate · Dec 5, 2013

Another way to also get it, if the input field method does not work for you, is directly from spectrum itself.

$("#font_color").spectrum('get');

or

$("#font_color").spectrum('get').toHexString();

To get it converted.