FSO.SimAntics.VMArchitecture.SetTimeOfDay C# (CSharp) Method

SetTimeOfDay() public method

public SetTimeOfDay ( double time ) : void
time double
return void
        public void SetTimeOfDay(double time)
        {
            Color col1 = m_TimeColors[(int)Math.Floor(time * (m_TimeColors.Length - 1))]; //first colour
            Color col2 = m_TimeColors[(int)Math.Floor(time * (m_TimeColors.Length - 1)) + 1]; //second colour
            double Progress = (time * (m_TimeColors.Length - 1)) % 1; //interpolation progress (mod 1)

            WorldUI.OutsideColor = Color.Lerp(col1, col2, (float)Progress); //linearly interpolate between the two colours for this specific time.
        }