Led keeps on after statement is reached

pert:
Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you're using the Arduino Web Editor you will not have access to this useful tool but it's still unacceptable to post poorly formatted code. I recommend you to use the standard IDE instead.

There's nothing in your code that would ever change the state of the LED pin back to LOW.

hi, i used the autoformat thingy (ctrl+t)

If im not mistaken in this while loop i made an if statement ''if x==255 then digital.write led,high'' so when the value isn't 255 the led wont light up right, so i asumed the led would turn low again when it loses the 255 value. how would you suggest to do this otherwise?

void receiveEvent(int howMany) {
  while (1 < Wire.available()) { // loop through all but the last
    char c = Wire.read(); // receive byte as a character
    Serial.print(c);         // print the character
  }
  int x = Wire.read();    // receive byte as an integer
  Serial.println(x);         // print the integer
  if  (x == 255) {

    digitalWrite(LED, HIGH);
    delay(5000);
    return;
  }

}