Female snakes lay eggs and stay to protect said eggs until they hatch which at that point they leave the baby snakes, their own children to fend for themselves and portect themselves from their natural predators.
Naturally with genetic differences and other variables there snakes of different colors like green and red. As well as snakes with overall different body shapes and ways of protection.
Survival of the fittest
Snakes such as the King Cobra that are darker blend into their surroundings and are highly poisonous unlike colorful snakes which thwart off predators of being poisonous however attract other animals.Which in result leads to the Darker snake living longer.
Due to the fact that the King Cobra in our case will survive more likely than that of the colorful snake it will reach its reproductive stage causing the surge of King Cobras leading to the decrease of the colorful snakes in the coming of the next generations. In result the colorful snakes will die out and all snakes will be mostly dark.