fix: update default frequency band colors

This commit is contained in:
2026-03-06 07:51:58 -08:00
parent 40521e769d
commit e6150e9513
7 changed files with 23 additions and 9 deletions

View File

@@ -37,7 +37,7 @@ export const SUBTITLE_DEFAULT_CONFIG: Pick<ResolvedConfig, 'subtitleStyle'> = {
mode: 'single',
matchMode: 'headword',
singleColor: '#f5a97f',
bandedColors: ['#ed8796', '#f5a97f', '#f9e2af', '#a6e3a1', '#8aadf4'],
bandedColors: ['#ed8796', '#f5a97f', '#f9e2af', '#8bd5ca', '#8aadf4'],
},
secondary: {
fontFamily: 'Inter, Noto Sans, Helvetica Neue, sans-serif',

View File

@@ -66,6 +66,20 @@ test('subtitleStyle autoPauseVideoOnYomitanPopup falls back on invalid value', (
);
});
test('subtitleStyle frequencyDictionary defaults to the teal fourth band color', () => {
const { context } = createResolveContext({});
applySubtitleDomainConfig(context);
assert.deepEqual(context.resolved.subtitleStyle.frequencyDictionary.bandedColors, [
'#ed8796',
'#f5a97f',
'#f9e2af',
'#8bd5ca',
'#8aadf4',
]);
});
test('subtitleStyle frequencyDictionary.matchMode accepts valid values and warns on invalid', () => {
const valid = createResolveContext({
subtitleStyle: {

View File

@@ -140,7 +140,7 @@ export function createRendererState(): RendererState {
frequencyDictionaryBand1Color: '#ed8796',
frequencyDictionaryBand2Color: '#f5a97f',
frequencyDictionaryBand3Color: '#f9e2af',
frequencyDictionaryBand4Color: '#a6e3a1',
frequencyDictionaryBand4Color: '#8bd5ca',
frequencyDictionaryBand5Color: '#8aadf4',
keybindingsMap: new Map(),

View File

@@ -296,7 +296,7 @@ body {
--subtitle-frequency-band-1-color: #ed8796;
--subtitle-frequency-band-2-color: #f5a97f;
--subtitle-frequency-band-3-color: #f9e2af;
--subtitle-frequency-band-4-color: #a6e3a1;
--subtitle-frequency-band-4-color: #8bd5ca;
--subtitle-frequency-band-5-color: #8aadf4;
text-shadow:
2px 2px 4px rgba(0, 0, 0, 0.8),
@@ -502,7 +502,7 @@ body.settings-modal-open #subtitleContainer {
}
#subtitleRoot .word.word-frequency-band-4 {
color: var(--subtitle-frequency-band-4-color, #a6e3a1);
color: var(--subtitle-frequency-band-4-color, #8bd5ca);
}
#subtitleRoot .word.word-frequency-band-5 {
@@ -609,8 +609,8 @@ body.settings-modal-open #subtitleContainer {
#subtitleRoot .word.word-frequency-band-4::selection,
#subtitleRoot .word.word-frequency-band-4 .c::selection {
color: var(--subtitle-frequency-band-4-color, #a6e3a1) !important;
-webkit-text-fill-color: var(--subtitle-frequency-band-4-color, #a6e3a1) !important;
color: var(--subtitle-frequency-band-4-color, #8bd5ca) !important;
-webkit-text-fill-color: var(--subtitle-frequency-band-4-color, #8bd5ca) !important;
}
#subtitleRoot .word.word-frequency-band-5::selection,

View File

@@ -75,7 +75,7 @@ const DEFAULT_FREQUENCY_RENDER_SETTINGS: FrequencyRenderSettings = {
topX: 1000,
mode: 'single',
singleColor: '#f5a97f',
bandedColors: ['#ed8796', '#f5a97f', '#f9e2af', '#a6e3a1', '#8aadf4'],
bandedColors: ['#ed8796', '#f5a97f', '#f9e2af', '#8bd5ca', '#8aadf4'],
};
function sanitizeFrequencyTopX(value: unknown, fallback: number): number {