It would be easiest to put the color-changing code in the Yellow class, but, if you must put the code in the Main class, you will need to create a loop to iterate through the nearby Yellow objects and set their colors. The range chosen to create the list of objects to iterate through needs to be somewhat larger than the range at which the color-changing takes place (at least by the largest change in distance between the Main object and a Yellow object in one act cycle). As an alternative, you could use 'getWorld().getObjects(Yellow.class)' to get a list of all Yellow objects in the world. The objects returned in the list will need to be typecast at least to the Actor class to enable changing its image. Then, within the loop, if not outside the color changing distance, which will have to be determined by Maths using 'Math.hypot', set to alternate color; else, set to original color.
Putting the code in the Yellow class would be a breeze in comparison. There would be no need for listing of objects, no need for a loop, and no need for typecasting.