feat: Add colorblind mode

This commit introduces a colorblind mode for red-green color blindness.

- Adds a new color palette with colorblind-friendly colors.

- Adds a user setting to toggle colorblind mode.

- Modifies the color allocation logic to use the new palette when the setting is enabled.

- Adds a button to the settings modal to toggle the feature.
This commit is contained in:
Restart2008
2025-10-26 17:01:17 -07:00
parent 9f1fc12b6b
commit c79e8022b9
9 changed files with 113 additions and 13 deletions
@@ -136,6 +136,12 @@ export class SettingsModal extends LitElement implements Layer {
this.requestUpdate();
}
private onToggleColorblindModeButtonClick() {
this.userSettings.toggleColorblindMode();
this.eventBus.emit(new RefreshGraphicsEvent());
this.requestUpdate();
}
private onToggleRandomNameModeButtonClick() {
this.userSettings.toggleRandomName();
this.requestUpdate();
@@ -321,6 +327,31 @@ export class SettingsModal extends LitElement implements Layer {
</div>
</button>
<button
class="flex gap-3 items-center w-full text-left p-3 hover:bg-slate-700 rounded text-white transition-colors"
@click="${this.onToggleColorblindModeButtonClick}"
>
<img
src=${darkModeIcon}
alt="colorblindModeIcon"
width="20"
height="20"
/>
<div class="flex-1">
<div class="font-medium">
${translateText("user_setting.colorblind_mode_label")}
</div>
<div class="text-sm text-slate-400">
${translateText("user_setting.colorblind_mode_desc")}
</div>
</div>
<div class="text-sm text-slate-400">
${this.userSettings.colorblindMode()
? translateText("user_setting.on")
: translateText("user_setting.off")}
</div>
</button>
<button
class="flex gap-3 items-center w-full text-left p-3 hover:bg-slate-700 rounded text-white transition-colors"
@click="${this.onToggleSpecialEffectsButtonClick}"