mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
ColorGradient - fixed edgecase in GetColor
This commit is contained in:
1 parent
0beddb0118
commit
761447b3d2
1 file changed
+4
@@ -246,6 +246,10 @@ public class ColorGradient : IList<ColorGradientStop>, IList, INotifyCollectionC
|
|||||||
if (stop2Index == 0)
|
if (stop2Index == 0)
|
||||||
return _stops[0].Color;
|
return _stops[0].Color;
|
||||||
|
|
||||||
|
//if the position is after the last stop, return that color
|
||||||
|
if (stop2Index == -1)
|
||||||
|
return _stops[^1].Color;
|
||||||
|
|
||||||
//interpolate between that one and the one before
|
//interpolate between that one and the one before
|
||||||
int stop1Index = stop2Index - 1;
|
int stop1Index = stop2Index - 1;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user