I wrote a little code to control an RGB LED matrix but it seems that the Serial communication doesn't want to work (better to say I'm not good at writing codes probably!).
You may need to describe in more detail just what you are trying to do. First, do you have control of the application sending the data to the arduino so that it can be modified if needed? What exactly is the data format of the data being sent to the arduino? Is the data being sent to the arduino being sent to the arduino as single data packets one at a time for each the LEDs, or is all the LED data being sent as a single large data packet that needs to be parsed to recover the individual LED data?