Remove the colored skins from the outsides of the yellow and red onions. Save the rest of the onion for other uses. Cut cheesecloth into 5 inch squares. Place a couple of pieces of onion skin onto a square of cheesecloth and set an egg on top. Gather the cheesecloth around the egg so that it is covered with onion skin. Secure with a rubber band. Repeat with remaining eggs and onion skins.
Fill a large pot with cold water and add the wrapped eggs. Cover and bring to a boil, then remove from the heat and let stand for 10 to 15 minutes. Afterwards, rinse the eggs under cold water and snip off the rubber bands to remove the cheesecloth. Rinse and dry the eggs.