From d75915f4cc63d2db48df5072caca8ef9317e37bc Mon Sep 17 00:00:00 2001 From: Boof2015 <75185879+Boof2015@users.noreply.github.com> Date: Thu, 23 Apr 2026 00:59:58 -0400 Subject: [PATCH] fix transparency on solid mode in specrogram --- .../components/ScopeSettingsSection.tsx | 2 +- src/renderer/visualizers/Spectrogram.ts | 16 ++++++------ test/renderer-helpers.test.ts | 26 +++++++++++++++++++ 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/renderer/components/ScopeSettingsSection.tsx b/src/renderer/components/ScopeSettingsSection.tsx index 1be5d92..2961589 100644 --- a/src/renderer/components/ScopeSettingsSection.tsx +++ b/src/renderer/components/ScopeSettingsSection.tsx @@ -440,7 +440,7 @@ export default function ScopeSettingsSection({ onChange={(value) => onUpdate('spectrogram', { colorScheme: value as ScopeSettings['spectrogram']['colorScheme'] })} > - + { + const imageData = renderSpectrogramColumnImage({ + colorScheme: 'mono', + lineColor: 'rgb(10, 20, 30)', + }, [0, 0.5, 1]) + + assert.deepEqual(imageData.slice(0, 3), [10, 20, 30]) + assert.equal(imageData[3], 0) + assert.deepEqual(imageData.slice(4, 7), [10, 20, 30]) + assert.equal(imageData[7], 128) + assert.deepEqual(imageData.slice(8, 11), [10, 20, 30]) + assert.equal(imageData[11], 255) +}) + +test('Spectrogram solid color honors authored tint alpha', () => { + const imageData = renderSpectrogramColumnImage({ + colorScheme: 'mono', + lineColor: 'rgba(100, 150, 200, 0.5)', + }, [0.5, 1]) + + assert.deepEqual(imageData.slice(0, 3), [100, 150, 200]) + assert.equal(imageData[3], 64) + assert.deepEqual(imageData.slice(4, 7), [100, 150, 200]) + assert.equal(imageData[7], 128) +}) + test('Spectrogram keeps the historical display dB range for line thickness', () => { const dom = installFakeCanvasDom() const dataSource = {