diff --git a/BTCPayServer/Controllers/WalletsController.cs b/BTCPayServer/Controllers/WalletsController.cs index 5b94bc87f..045af6e72 100644 --- a/BTCPayServer/Controllers/WalletsController.cs +++ b/BTCPayServer/Controllers/WalletsController.cs @@ -115,7 +115,7 @@ namespace BTCPayServer.Controllers "#ff7619", "#84b6eb", "#5319e7", - "#000000", + "#cdcdcd", "#cc317c", }; @@ -173,7 +173,12 @@ namespace BTCPayServer.Controllers allColors .GroupBy(k => k) .OrderBy(k => k.Count()) - .ThenBy(k => Array.IndexOf(LabelColorScheme, k.Key)) + .ThenBy(k => { + var indexInColorScheme = Array.IndexOf(LabelColorScheme, k.Key); + + // Ensures that any label color which may not be in our label color scheme is given the least priority + return indexInColorScheme == -1 ? double.PositiveInfinity : indexInColorScheme; + }) .First().Key; walletBlobInfo.LabelColors.Add(addlabel, chosenColor); await WalletRepository.SetWalletInfo(walletId, walletBlobInfo);