Swimming pool water is not the most likely explanation for a sudden change in tooth colour by itself, although frequent exposure to improperly pH-balanced chlorinated pool water has been associated with dental erosion in swimmers.
Since you noticed the change only recently and particularly in the front teeth, other causes such as surface staining, enamel changes/erosion, early demineralization, or a problem involving the tooth pulp should also be considered. Tooth discoloration can be either extrinsic (surface) or intrinsic (within the tooth), and the appropriate treatment depends on the cause.
Swimming may be relevant, but it would be difficult to establish from the history alone that it is the cause.
Next Steps
I would recommend an in-person dental examination to determine whether the colour change is on the surface of the enamel or within the tooth. Your dentist can assess the enamel, look for erosion/demineralization or staining, and perform pulp testing and an X-ray if either tooth appears intrinsically discoloured.
If it is simply surface staining, professional cleaning and polishing may be sufficient. If there is enamel erosion or early demineralization, the management will be different and may include fluoride/remineralization measures and addressing the underlying cause.
Until then, continue brushing twice daily with a fluoride toothpaste and avoid abrasive/charcoal whitening products.
Health Tips
You don’t necessarily need to stop swimming, but it would be sensible to ask the swimming facility whether the pool pH and chlorine levels are regularly monitored and maintained. Avoid deliberately keeping pool water in your mouth.
If the colour change is mainly in one tooth, particularly if it is becoming grey/brown, or if you develop pain, sensitivity, tenderness or swelling, please have it examined promptly because trauma or pulpal changes can also cause discoloration.