There are different reasons as to y an animal has bright colors. warnings courtship and camouflage would be the usual suspects. It depends on the animals and the local flora. Insects can try to look like flowers, predators can try to imitate local flora, birds for courtship, poison dart frogs as warnings, and many amphibians do it for warnings.