pure C++ to generate rainbow-like RGB color