Swimming with dyed hair?

I dyed my hair like in April would it be ok to swim? Or would that still ruin the color