src/AircraftTrajectories/Views/NoiseContourForm.cs
/// <summary>
/// Interpolates the colors between chosen noise values
/// </summary>
/// <param name="lowerBound"></param>
/// <param name="upperBound"></param>
/// <param name="numberOfIntervals"></param>
/// <returns></returns>
Interpolates the colors between chosen noise values
Interpolates the colors between chosen noise values
private Color[] InterpolateColors(Color lowerBound, Color upperBound, int numberOfIntervals)
		{
			Color[] colorPalette = new Color[numberOfIntervals];
			int interval_A = (upperBound.A - lowerBound.A) / numberOfIntervals;
			int interval_R = (upperBound.R - lowerBound.R) / numberOfIntervals;
			int interval_G = (upperBound.G - lowerBound.G) / numberOfIntervals;
			int interval_B = (upperBound.B - lowerBound.B) / numberOfIntervals;
			int current_A = lowerBound.A;
			int current_R = lowerBound.R;
			int current_G = lowerBound.G;
			int current_B = lowerBound.B;
			for (var i = 0; i < numberOfIntervals; i++)
			{
				colorPalette[i] = Color.FromArgb(current_A, current_R, current_G, current_B);
				current_A += interval_A;
				current_R += interval_R;
				current_G += interval_G;
				current_B += interval_B;
			}
			return colorPalette;
		}
private Color [ ] InterpolateColors ( Color lowerBound , Color upperBound , int numberOfIntervals ) { Color [ ] colorPalette = new Color [ numberOfIntervals ] ; int interval_A = ( upperBound . A - lowerBound . A ) / numberOfIntervals ; int interval_R = ( upperBound . R - lowerBound . R ) / numberOfIntervals ; int interval_G = ( upperBound . G - lowerBound . G ) / numberOfIntervals ; int interval_B = ( upperBound . B - lowerBound . B ) / numberOfIntervals ; int current_A = lowerBound . A ; int current_R = lowerBound . R ; int current_G = lowerBound . G ; int current_B = lowerBound . B ; for ( var i = 0 ; i < numberOfIntervals ; i ++ ) { colorPalette [ i ] = Color . FromArgb ( current_A , current_R , current_G , current_B ) ; current_A += interval_A ; current_R += interval_R ; current_G += interval_G ; current_B += interval_B ; } return colorPalette ; }
Interpolates the colors between chosen noise values
Interpolates the colors between chosen noise values
None
lowerBound
Color
None
upperBound
Color
None
numberOfIntervals
int
None