From 761447b3d28ce40d93a77385b0e0792c27b0377b Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Mon, 14 Nov 2022 10:33:27 +0000 Subject: [PATCH] ColorGradient - fixed edgecase in GetColor --- src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs b/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs index 060c2b0e6..3615fbfbc 100644 --- a/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs +++ b/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs @@ -245,6 +245,10 @@ public class ColorGradient : IList, IList, INotifyCollectionC //if the position is before the first stop, return that color if (stop2Index == 0) 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 int stop1Index = stop2Index - 1;