Problem in getting the output (language: Processing and Arduino IDE)
If you read the documentation for Serial::read() at https://processing.org/reference/libraries/serial/Serial_read_.html 

it says:
"Returns a number between 0 and 255 for the next byte that's waiting in the buffer. Returns -1 if there is no byte, although this should be avoided by first cheacking available() to see if data is available."

Either before calling "Draw" function, or inside "Draw", you should first check:

if(port.available()){
  //do your checking for X value and set text as you are doing before

}


IMPORTANT - you are only ever sending the lower byte (values 0-255) from Arduino when you do Serial.write(x). That is only 1 byte. The "int" return from an analogue read is 10 bits, and needs 2 bytes to store the information from 0-1023. 

You should use the Arduino function Map() to scale it down from 0-1023 to 0-255. It looks like your application should be okay with this, in terms of resolution.

  int val = analogRead(ldr1);
  val = map(val, 0, 1023, 0, 255);
  Serial.write(val); //now you will not lose information


On the Processing side, you would then look at values from 0-255 to determine daylight/times of day.