Feature/Move theme system from core to client-side ThemeProvider (#4108)

**Add approved & assigned issue number here:** 

Resolves #2549

## Description:

Themes are purely for the client's rendering, and the server doesn't
need context on them. This PR moves `Theme.ts` from
`src/core/configuration` to `src/client/theme` and moves affiliation
colors to `render-settings.json`.

This is to support the ability to add additional themes more quickly,
such as colorblind-friendly themes. No visible changes occur from this
refactor.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory

## Please put your Discord username so you can be contacted if a bug or
regression is found:

jetaviz

---------

Co-authored-by: Josh Harris <josh@wickedsick.com>
This commit is contained in:
noahschmal
2026-06-02 02:32:08 -07:00
committed by GitHub
parent d8c127a462
commit 2c8a66625c
23 changed files with 150 additions and 88 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ import { colord, Colord } from "colord";
import {
ColorAllocator,
selectDistinctColorIndex,
} from "../src/core/configuration/ColorAllocator";
} from "../src/client/theme/ColorAllocator";
import {
blue,
botColor,
@@ -12,7 +12,7 @@ import {
red,
teal,
yellow,
} from "../src/core/configuration/Colors";
} from "../src/client/theme/Colors";
import { ColoredTeams } from "../src/core/game/Game";
const mockColors: Colord[] = [
+1 -5
View File
@@ -7,10 +7,10 @@
*/
import { colord } from "colord";
import { Theme } from "../../src/client/theme/Theme";
import { GameView } from "../../src/client/view/GameView";
import { PlayerView } from "../../src/client/view/PlayerView";
import { Config } from "../../src/core/configuration/Config";
import { Theme } from "../../src/core/configuration/Theme";
import {
NameViewData,
PlayerType,
@@ -45,10 +45,6 @@ export function stubTheme(): Theme {
falloutColor: () => white,
font: () => "Arial",
textColor: () => "#000000",
selfColor: () => white,
allyColor: () => white,
neutralColor: () => grey,
enemyColor: () => grey,
spawnHighlightColor: () => white,
spawnHighlightSelfColor: () => white,
spawnHighlightTeamColor: () => white,