Why dp people see the rainbow as a symbol of hope?

There is a Biblical story about a flood for which Noah and his family had built the ark, a boat that held a male and a female of every kind of animal. The flood was visited on earth by God in order to wipe out the human race just about all of whom had become sinners. After the rains of the flood the first rainbow was seen and it symbolized a new beginning and a promise by God that he would never do a similar thing again