根据时间变化的太阳颜色的RGB值公式

   BYTE r, g, b;
   float C = 8.0f;


   // set sun
   r = (255-C/sqrt(1-cos(m_time))*0.03);
   g = (255-C/sqrt(1-cos(m_time))*0.75);
   b = (255-C/sqrt(1-cos(m_time))*0.97);
 

   // set sky
   r = (255-C/sqrt(1-cos(m_time))*0.73);
   g = (255-C/sqrt(1-cos(m_time))*0.05);
   b = (255-C/sqrt(1-cos(m_time))*0.07);

原文地址:https://www.cnblogs.com/oiramario/p/375469.html