connection color change from statusbar

This commit is contained in:
Jan Prochazka
2021-12-05 10:34:52 +01:00
parent a4e967f37e
commit 5ca54220b5
6 changed files with 59 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ export function getConnectionColor(connections, dbid, themeType, colorIndex, bac
const current = connections.find(x => x._id == dbid.conid);
if (!current?.connectionColor) return undefined;
const palettes = themeType == 'dark' ? presetDarkPalettes : presetPalettes;
if (colorIndex == null) return current?.connectionColor;
const color = palettes[current?.connectionColor][colorIndex];
if (backgroundStyle) return `background:${color}`;
return color;