Topological photonic crystals (PCs) can support topologically protected states of light. These states are immune to backscattering and can be used to construct a variety of optical devices. One promising application of topological PCs is the formation of a topological rainbow. We propose a method for realizing a topological rainbow based on cavity-coupled topological edge state (TES) in a topological photonic crystal waveguide (TPCW). This is a new type of cavity coupled TPCW, in which the cavity is located inside the waveguide at the interface between two topologically distinct PCs. We demonstrated that by varying the cavity length in the TPCW, the separation of different frequencies of topological states can be controlled. Moreover, we showed that the topological rainbow is unaffected by the cavity shape inside the TPCW. This method is more robust and versatile than previous methods, as it is unaffected by the cavity shape. This makes it possible to create topological rainbow in a wide variety of high-performance devices. For example, it could be used to build topological rainbow in integrated circuits, which would be very difficult if the cavity shape was precisely controlled. We hope our findings will inspire further research in this area and lead to the development of new and innovative optical devices.