I have a program that fades two RGB colors. Since the fading of color can be interpreted as a wave, i want to know how do i change my update color function so that i can define a frequency and amplitude. I want to make the fading go fast if i increase the frequency and get bigger circles when i increase the amplitude.Can you provide me the mathematical formula.How do i change the code below to incorporate that. Any help, thanks.
bool updateColorValue(float ¤tValue, uchar goalValue, float deltaValue, Lights::MSecs dtime) { if (deltaValue == 0) return true; currentValue += deltaValue * dtime; if ((deltaValue < 0 && currentValue <= goalValue) || (deltaValue > 0 && currentValue >= goalValue)) { currentValue = goalValue; return true; } else return false; } void setCurrentGoal (uint goalNum) { _currentGoal = goalNum; RGB color = _goalColors[_currentGoal]; _deltaColor.R = (color.R - _currentColor.R)/(double)_period; _deltaColor.G = (color.G - _currentColor.G)/(double)_period; _deltaColor.B = (color.B - _currentColor.B)/>/(double)_period; }