add stereo to waveform scope, add side metering to spectrum

This commit is contained in:
Boof2015
2026-03-28 21:27:45 -04:00
parent ee234cad7c
commit 604a867708
13 changed files with 917 additions and 244 deletions
+26
View File
@@ -215,7 +215,33 @@ type ColorStop = {
color: [number, number, number]
}
const LEGACY_DEFAULT_HEAT_COLORS: [string, string, string] = [
'rgb(15, 7, 33)',
'rgb(163, 26, 121)',
'rgb(255, 241, 209)',
]
function isLegacyDefaultHeatColors(colors: [string, string, string]): boolean {
return colors.every((color, index) => {
const left = resolveColorToRgb(color)
const right = resolveColorToRgb(LEGACY_DEFAULT_HEAT_COLORS[index])
return left.r === right.r && left.g === right.g && left.b === right.b
})
}
function buildHeatStops(colors: [string, string, string]): ColorStop[] {
if (isLegacyDefaultHeatColors(colors)) {
return [
{ at: 0, color: [0, 0, 0] },
{ at: 0.14, color: [15, 7, 33] },
{ at: 0.32, color: [61, 11, 94] },
{ at: 0.54, color: [163, 26, 121] },
{ at: 0.74, color: [255, 82, 87] },
{ at: 0.9, color: [255, 166, 63] },
{ at: 1, color: [255, 241, 209] },
]
}
const low = resolveColorToRgb(colors[0])
const mid = resolveColorToRgb(colors[1])
const high = resolveColorToRgb(colors[2])