user29688: I've got an ESP8266 (NodeMCU) and I am trying to understand the ESP8266WebServer library, as how to use the results across functions.
In my setup function, I have the following:
   server.on("/marquee", []() {
      varOne = server.arg("baseColor");
      varTwo = server.arg("marqueeColor");
      server.send(200, "text/html", webPage);
      Serial.println("Marquee  activated");
      state = true;
      ledMode = "marquee";  
    });

In my loop, I detect the ledMode and if it is set to marquee then it runs the following FastLED function, amongst others:
fill_solid(leds, NUM_LEDS, 0xFF0000);

What I am trying to figure out is how I go from taking a hex color code of say FF0000 from the URL parameter, and use that in my fill_solid function.
server.arg stores get the parameter as a string, so I am not sure what needs to be done.  Also, using a variable name in place of the Hex code in the fill_solid function results in an error due to not expecting the variable

user13432: 
server.arg stores get the parameter as a string, so I am not sure what needs to be done. 

The parameter needs to be converted to an uint32_t (and then to a CRGB or CHSV struct). The simplest way is to use the C library function strtoul 
uint32_t color = strtoul(arg, NULL, 16);

This can be improved so that it checks that a number was scanned, etc.
Cheers!

29688: <p>I've got an ESP8266 (NodeMCU) and I am trying to understand the ESP8266WebServer library, as how to use the results across functions.</p>

<p>In my setup function, I have the following:</p>

<pre><code>   server.on("/marquee", []() {
      varOne = server.arg("baseColor");
      varTwo = server.arg("marqueeColor");
      server.send(200, "text/html", webPage);
      Serial.println("Marquee  activated");
      state = true;
      ledMode = "marquee";  
    });
</code></pre>

<p>In my loop, I detect the ledMode and if it is set to marquee then it runs the following FastLED function, amongst others:</p>

<pre><code>fill_solid(leds, NUM_LEDS, 0xFF0000);
</code></pre>

<p>What I am trying to figure out is how I go from taking a hex color code of say <code>FF0000</code> from the URL parameter, and use that in my <code>fill_solid</code> function.</p>

<p>server.arg stores get the parameter as a string, so I am not sure what needs to be done.  Also, using a variable name in place of the Hex code in the <code>fill_solid</code> function results in an error due to not expecting the variable</p>
 13432: <blockquote>
  <p>server.arg stores get the parameter as a string, so I am not sure what needs to be done. </p>
</blockquote>

<p>The parameter needs to be converted to an uint32_t (and then to a CRGB or CHSV struct). The simplest way is to use the C library function <a href="http://www.nongnu.org/avr-libc/user-manual/group__avr__stdlib.html#gaea44aa48bda8261f794dcb2d1e7ab2b2" rel="nofollow noreferrer">strtoul</a> </p>

<pre><code>uint32_t color = strtoul(arg, NULL, 16);
</code></pre>

<p>This can be improved so that it checks that a number was scanned, etc.</p>

<p>Cheers!</p>
