The current day is split into quadrants (alpha, beta, gamma, delta), current quadrant is determined and starting/ending colors are defined for each quadrant and transition colors are interpolated between the two. Depending on how far into the quadrant you are the appropriate transition color is output in RGB