diff --git a/src/utils/index.ts b/src/utils/index.ts index b0cca9e93c24bebd34b64764d193c0b4128ec231..cce06b45be2dec6aa7c99731bd9d2f8600f9e1a6 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -58,6 +58,11 @@ export function getRandomAvatarOption( usually: [NONE], }) + const hairShape = getRandomValue(topList, { + avoid: [useOption.widgets?.tops?.shape], + }) + const hairColor = getRandomFillColor() + const avatarOption: AvatarOption = { gender, @@ -66,7 +71,10 @@ export function getRandomAvatarOption( background: { color: getRandomValue(SETTINGS.backgroundColor, { - avoid: [useOption.background?.color], + avoid: [ + useOption.background?.color, + hairShape === TopsShape.Punk && hairColor, // Handle special cases and prevent color conflicts. + ], }), }, @@ -75,10 +83,8 @@ export function getRandomAvatarOption( shape: getRandomValue(SETTINGS.faceShape), }, tops: { - shape: getRandomValue(topList, { - avoid: [useOption.widgets?.tops?.shape], - }), - fillColor: getRandomFillColor(), + shape: hairShape, + fillColor: hairColor, }, ear: { shape: getRandomValue(SETTINGS.earShape, {