-->
Page 2 of 2

Re: How to use the jscolor Color Picker in a Webserver?

PostPosted: Sun Apr 19, 2020 12:09 am
by asking
Dietmar273 wrote:I found a solution by myself.
The key was this tutorial: https://www.esp8266.com/viewtopic.php?f=32&t=18738
Chapter 12 explains how to "Wirelessly controlling your RGB lighting".
In this example, the author uses javascript code, which is stored in the SPIFFS.
So I simply added the file "jscolor.js" to the sketch data folder.
And then I changed the index.hml file, I added the color picker and a change listener:
Code: Select all       <div>
            <input id="picker_id" class="jscolor {onFineChange:'update(this)'}" value="ffcc00">
        </div>
        <script>
            /* event listener */
            document.getElementById("picker_id").addEventListener('change', sendRGB);
        </script>

Works like a charm :-)


Dear can you help me with how to listen on Arduino Code ?i have also implemented jscolor in html webpage loaded on Nodemcu SPIFFS but don't know how to extract those R,G,B Values. any help would be appreciated.

Re: How to use the jscolor Color Picker in a Webserver?

PostPosted: Wed Sep 23, 2020 2:03 am
by a8ngus