Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Commit 1ac904d

Browse files
committed
Added new constructor to RegularLightSpectrum
1 parent 5e8a627 commit 1ac904d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ColorSharp/src/LightSpectrums/RegularLightSpectrum.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ public RegularLightSpectrum (double minWaveLength, IList<double> amplitudes, dou
7575
Amplitudes = new ReadOnlyCollection<double> (amplitudes);
7676
}
7777

78+
// Constructor
79+
public RegularLightSpectrum (IList<double> amplitudes, double nmPerStep, double maxWavelength, AConvertibleColor dataSource=null) : base(dataSource)
80+
{
81+
NmPerStep = nmPerStep;
82+
MaxWaveLength = maxWavelength;
83+
MinWaveLength = maxWavelength - nmPerStep * (amplitudes.Count - 1);
84+
Amplitudes = new ReadOnlyCollection<double> (amplitudes);
85+
}
86+
7887
#endregion
7988

8089

0 commit comments

Comments
 (0)