Post topics, source code that relate to the Arduino Platform

User avatar
By raichea
#62512 The correct fix is to change the relevant lines in handle_color to this:

Code: Select all  if (color1.indexOf("#") >= 0)//if the string has %23 which is "#"
  {
    color = "#";//add it in as a usable character
    color += color1.substring((color1.indexOf("\x23") + 1));//add in the color code
  }


ie. "%23" should be either "\x23" or "#" and the substring adder should be 1, not 3.

There should really be some more checking of the input, but at least this works as the original was intended.