Tint color-blind ownership symbols and center turn-order badges

This commit is contained in:
coyotte508 2026-11-25 10:22:18 +00:00
commit 85c046571f
2 changed files with 15 additions and 9 deletions

View file

@ -863,18 +863,19 @@ export class World {
}
}
}
private ownershipBadge(index: number, symbols?: string[], barbarian = false) {
private ownershipBadge(index: number, symbols?: string[], barbarian = false, color = '#25372e') {
const canvas = document.createElement('canvas');
canvas.width = canvas.height = 64;
const context = canvas.getContext('2d')!;
const ink = barbarian ? '#25372e' : color;
context.fillStyle = '#fff7e6';
context.strokeStyle = '#2d392f';
context.lineWidth = 3;
context.strokeStyle = barbarian ? '#2d392f' : color;
context.lineWidth = 3.5;
context.beginPath();
context.arc(32, 32, 29, 0, Math.PI * 2);
context.fill();
context.stroke();
context.fillStyle = '#25372e';
context.fillStyle = ink;
context.font = 'bold 42px system-ui';
context.textAlign = 'center';
context.textBaseline = 'middle';
@ -1400,6 +1401,7 @@ export class World {
player.id,
s.playerSymbols,
player.civilization === 'Barbarians',
playerColor(player.id, s.colorBlind, s.playerColors),
);
badge.position.set(markers.badge.x, markers.badge.y, markers.pole.z);
cityModel.add(badge);

View file

@ -429,10 +429,13 @@ small {
position: absolute;
right: -3px;
bottom: -3px;
display: grid;
place-items: center;
min-width: 14px;
display: flex;
align-items: center;
justify-content: center;
width: 14px;
height: 14px;
padding: 0 0 0.5px;
box-sizing: border-box;
border: 1px solid var(--line);
border-radius: 50%;
background: var(--paper);
@ -440,6 +443,7 @@ small {
font:
600 9px / 1 'DM Sans',
sans-serif;
font-variant-numeric: tabular-nums;
}
.player-emblem img {
width: 32px;
@ -814,8 +818,8 @@ small {
align-items: center;
justify-content: center;
background: #fff8e8;
color: #1f2e2b;
border: 1px solid #23332f48;
color: var(--medallion-bg, #1f2e2b);
border: 1px solid color-mix(in srgb, var(--medallion-bg, #23332f) 65%, #23332f);
font:
700 7px/1 'DM Sans',
sans-serif;