Normally the PMW3901 Optical Flow Sensor is used by flying drones to measure the distance moved over the ground. In the case of a Mecanum-wheeled robot, the PMW3901's camera would be mounted just over its 80mm minimum focal distance and its x,y output used for the robot's odometry, i.e., to measure how far the robot has traveled.
While the sensor itself provides numeric values, this video shows a test rig using a 5x5 RGB LED matrix that indicates which direction the sensor has moved by color: red for port movement, green for starboard, cyan for forward and yellow for aft.
There's a blog entry and YouTube video about the Pimoroni PMW3901 Optical Flow Sensor: