    if (pos > 0) {
         col[2] = getNumberAfterStringPos(HTTP_req, pos);
     }
-
-   Serial.println(col[0]);
    XML_response();
-   setLeds();
+   colorUpdated();
    return true;
 }
 

  apchannel = EEPROM.read(227);
  if (apchannel > 13 || apchannel < 1) apchannel = 1;
  led_amount = EEPROM.read(229);
  nopwrled = EEPROM.read(231);
  if (nopwrled > 1) nopwrled = 1;
  staticip[0] = EEPROM.read(234);
  staticip[1] = EEPROM.read(235);
  staticip[2] = EEPROM.read(236);

  server.send(200, "text/json", output);
}

void notify(){};

void setAllLeds() {
  double d = bri_t;
  double val = d /256;
  int r = col_t[0]*val;
  int g = col_t[1]*val;
  int b = col_t[2]*val;
  for (int i=0; i < led_amount; i++) {
    strip.SetPixelColor(i, RgbColor(r, g, b));
  }
  strip.Show();
}

void setLedsStandard()
{
  col_old[0] = col[0];
  col_old[1] = col[1];
  col_old[2] = col[2];
  bri_old = bri;
  col_t[0] = col[0];
  col_t[1] = col[1];
  col_t[2] = col[2];
  bri_t = bri;
  setAllLeds();
}

void colorUpdated()
{
  if (col[0] != col_old[0] && col[1] != col_old[1] && col[2] != col_old[2] && bri != bri_old)
  {
    return; //no change
  }
  notify();
  if (fadeTransition || seqTransition)
  {
    transitionActive = true;
    transitionStartTime = millis();
  } else
  {
    setLedsStandard();
  }
}

void handleTransitions()
{
  if (transitionActive)
  {
    float tper = (millis() - transitionStartTime)/transitionDelay;
    if (tper >= 1.0)
    {
      transitionActive = false;
      setLedsStandard();
      return;
    }
    if (fadeTransition)
    {
      col_t[0] = col_old[0]+((col[0] - col_old[0])/tper);
      col_t[1] = col_old[1]+((col[1] - col_old[1])/tper);
      col_t[2] = col_old[2]+((col[2] - col_old[2])/tper);
      bri_t = bri_old+((bri - bri_old)/tper);
    }
    if (seqTransition)
    {
      
    } else setAllLeds();
  }
}

void handleAnimations(){};

void setup() {
    Serial.begin(115200);
