It is attractive to use an optical nanorouter by artificial nanostructures to substitute the traditional Bayer filter for an image array sensor, which, however, poses great challenges in balancing the design strategy and the ease of fabrication. Here, we implement and compare two inverse design schemes for rapid optimization of RGGB Bayer-type optical nanorouter. One is based on the multiple Mie scattering theory and the adjoint gradient that is applicable to arrays of nanospheres with varying sizes, and the other is based on the rigorous coupled wave analysis and the genetic algorithm. In both cases, we study layered nanostructures that can be efficiently modeled respectively which greatly accelerates the inverse design. It is shown that the color-dependent peak collection efficiencies of nanorouters designed in the two methods for red, green, and blue wavelengths reach 37%, 44%, and 45% and 52%, 50%, and 66%, respectively. We further demonstrate color nanorouters that provide light focusing to four quadrants working in both the visible and infrared bands, which promises multispectral imaging applications.