From 3e998387fe61910b75e3e549c5d84e8e322c6978 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 20 Dec 2024 08:51:17 -0800 Subject: [PATCH 1/2] Blend cursorAccent with background too Fixes #5241 --- src/browser/services/ThemeService.ts | 2 +- test/playwright/SharedRendererTests.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/browser/services/ThemeService.ts b/src/browser/services/ThemeService.ts index 0dc7fcbf..cd85e0ff 100644 --- a/src/browser/services/ThemeService.ts +++ b/src/browser/services/ThemeService.ts @@ -83,7 +83,7 @@ export class ThemeService extends Disposable implements IThemeService { colors.foreground = parseColor(theme.foreground, DEFAULT_FOREGROUND); colors.background = parseColor(theme.background, DEFAULT_BACKGROUND); colors.cursor = color.blend(colors.background, parseColor(theme.cursor, DEFAULT_CURSOR)); - colors.cursorAccent = parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT); + colors.cursorAccent = color.blend(colors.background, parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT)); colors.selectionBackgroundTransparent = parseColor(theme.selectionBackground, DEFAULT_SELECTION); colors.selectionBackgroundOpaque = color.blend(colors.background, colors.selectionBackgroundTransparent); colors.selectionInactiveBackgroundTransparent = parseColor(theme.selectionInactiveBackground, colors.selectionBackgroundTransparent); diff --git a/test/playwright/SharedRendererTests.ts b/test/playwright/SharedRendererTests.ts index b0c5c499..998d51a6 100644 --- a/test/playwright/SharedRendererTests.ts +++ b/test/playwright/SharedRendererTests.ts @@ -1256,6 +1256,16 @@ export function injectSharedRendererTests(ctx: ISharedRendererTestContext): void await ctx.value.proxy.focus(); await pollFor(ctx.value.page, () => getCellColor(ctx.value, 1, 1), [128, 0, 0, 255]); }); + test.only('#5241 cursorAccent with alpha should blend color with background color', async () => { + const theme: ITheme = { + cursorAccent: '#FF000080' + }; + await ctx.value.page.evaluate(`window.term.options.theme = ${JSON.stringify(theme)};`); + await ctx.value.proxy.focus(); + await ctx.value.proxy.write('■'); + await ctx.value.proxy.write('\x1b[1D'); + await pollFor(ctx.value.page, () => getCellColor(ctx.value, 1, 1), [128, 0, 0, 255]); + }); }); } From 18c9eb196010ec082ad56adf7040ed2dca5fd391 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:01:30 -0800 Subject: [PATCH 2/2] Remove .only --- test/playwright/SharedRendererTests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/playwright/SharedRendererTests.ts b/test/playwright/SharedRendererTests.ts index 998d51a6..1d37b5c1 100644 --- a/test/playwright/SharedRendererTests.ts +++ b/test/playwright/SharedRendererTests.ts @@ -1256,7 +1256,7 @@ export function injectSharedRendererTests(ctx: ISharedRendererTestContext): void await ctx.value.proxy.focus(); await pollFor(ctx.value.page, () => getCellColor(ctx.value, 1, 1), [128, 0, 0, 255]); }); - test.only('#5241 cursorAccent with alpha should blend color with background color', async () => { + test('#5241 cursorAccent with alpha should blend color with background color', async () => { const theme: ITheme = { cursorAccent: '#FF000080' };