[fix](trx-frontend): align band chip colors with locator overlays
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -3281,9 +3281,14 @@ function mapSourceLabel(type) {
|
||||
}
|
||||
|
||||
function locatorFilterColor(type) {
|
||||
if (type === "bookmark") return "#22c55e";
|
||||
if (type === "wspr") return "#ff6a3d";
|
||||
return "#ff9b1a";
|
||||
const hues = locatorThemeHues();
|
||||
const lightTheme = currentTheme() === "light";
|
||||
const sat = lightTheme ? 66 : 76;
|
||||
const light = lightTheme ? 42 : 56;
|
||||
const hue = type === "bookmark"
|
||||
? hues.bookmark
|
||||
: (type === "wspr" ? hues.wspr : hues.ft8);
|
||||
return `hsl(${hue.toFixed(1)} ${sat}% ${light}%)`;
|
||||
}
|
||||
|
||||
function mapSourceColor(type) {
|
||||
@@ -3417,6 +3422,15 @@ function locatorBandIndex(label) {
|
||||
return idx >= 0 ? idx : 0;
|
||||
}
|
||||
|
||||
function locatorBandChipColor(label) {
|
||||
const hues = locatorThemeHues();
|
||||
const lightTheme = currentTheme() === "light";
|
||||
const hue = wrapHue(hues.bandBase + locatorBandIndex(label) * 137.508);
|
||||
const sat = lightTheme ? 68 : 78;
|
||||
const light = lightTheme ? 44 : 58;
|
||||
return `hsl(${hue.toFixed(1)} ${sat}% ${light}%)`;
|
||||
}
|
||||
|
||||
function locatorBandLabelForEntry(entry) {
|
||||
const meta = entry?.bandMeta instanceof Map ? entry.bandMeta : new Map();
|
||||
if (meta.size === 0) return null;
|
||||
@@ -3630,7 +3644,7 @@ function rebuildMapLocatorFilters() {
|
||||
bandMap.set(label, {
|
||||
key: label,
|
||||
label,
|
||||
color: locatorFilterColor(sourceType),
|
||||
color: locatorBandChipColor(label),
|
||||
kind: "band",
|
||||
sortHz: Number.isFinite(hz) ? hz : 0,
|
||||
});
|
||||
@@ -3641,7 +3655,7 @@ function rebuildMapLocatorFilters() {
|
||||
existing.sortHz = hz;
|
||||
}
|
||||
if (existing && !existing.color) {
|
||||
existing.color = locatorFilterColor(sourceType);
|
||||
existing.color = locatorBandChipColor(label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user