feat: improve character customization colors

This commit is contained in:
jwinterm
2026-07-05 21:09:52 -04:00
parent 454e6ab69a
commit 07cfe80591
9 changed files with 477 additions and 142 deletions
+17 -3
View File
@@ -1,15 +1,29 @@
const Appearance = require('../src/multiplayer/appearance');
describe('appearance catalog normalization', () => {
test('normalizes character tint and equipment slots', () => {
test('normalizes character colors and equipment slots', () => {
expect(Appearance.normalizeAppearance({
avatar: 'char-ranger',
tint: 'moss',
equipment: { body: 'mail', head: 'helm', shield: 'bad', weapon: 'bow' }
equipment: { body: 'mail', head: 'helm', shield: 'bad', weapon: 'bow' },
colors: { base: 'teal', skin: 'warm', hair: 'silver', body: 'gold', head: 'bad', shield: 'rose', weapon: 'ash' }
})).toEqual({
avatar: 'char-ranger',
tint: 'teal',
equipment: { body: 'mail', head: 'helm', shield: 'none', weapon: 'bow' },
colors: { base: 'teal', skin: 'warm', hair: 'silver', body: 'gold', head: 'none', shield: 'rose', weapon: 'ash' }
});
});
test('uses legacy tint as the default character color ramp', () => {
expect(Appearance.normalizeAppearance({
avatar: 'char-ranger',
tint: 'moss'
})).toEqual({
avatar: 'char-ranger',
tint: 'moss',
equipment: { body: 'mail', head: 'helm', shield: 'none', weapon: 'bow' }
equipment: { body: 'none', head: 'none', shield: 'none', weapon: 'none' },
colors: { base: 'moss', skin: 'natural', hair: 'copper', body: 'moss', head: 'moss', shield: 'moss', weapon: 'moss' }
});
});