From 3a351c5139010128b20c2644218ae17543f9637a Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Thu, 18 Jan 2024 16:57:38 +0100 Subject: [PATCH] Fixed accent color for `any` outputs --- src/renderer/helpers/accentColors.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/renderer/helpers/accentColors.ts b/src/renderer/helpers/accentColors.ts index fa9faf3de..295333df2 100644 --- a/src/renderer/helpers/accentColors.ts +++ b/src/renderer/helpers/accentColors.ts @@ -29,17 +29,16 @@ const colorList = lazy(() => { const defaultColorList = [defaultColor] as const; export const getTypeAccentColors = (inputType: Type): readonly [string, ...string[]] => { - if (inputType.type === 'any') { - return defaultColorList; - } - const colors: string[] = []; - for (const { type, color } of colorList()) { + const allColors = colorList(); + for (const { type, color } of allColors) { if (!isDisjointWith(type, inputType)) { colors.push(color); } } - return colors.length > 0 ? (colors as [string, ...string[]]) : defaultColorList; + return colors.length > 0 && colors.length < allColors.length + ? (colors as [string, ...string[]]) + : defaultColorList; }; export const getCategoryAccentColor = (categories: CategoryMap, category: CategoryId) => {