This rainbow effect is called cloud iridescence
Mother Nature has many phenomena that are breathtaking if not miraculous to witness. One of them is the existence of rainbow clouds, otherwise called cloud iridescence. The multicolored hue is generated by a process called diffraction. This phenomenon looks really cool.
This occurs when water droplets or small ice crystals act as prisms and scatter the Sun’s light, splitting it into several different shades. It is rare to witness this since the cloud must be thin and have lots of water droplets of a similar size.