Red circle moves until color red is touching green. Blue circle moves until color blue is not touching yellow.