mirror of
https://github.com/Codennnn/vue-color-avatar.git
synced 2024-12-22 12:02:38 +00:00
Handle case
This commit is contained in:
parent
e855c18cc4
commit
f9243a41bc
@ -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, {
|
||||
|
Loading…
Reference in New Issue
Block a user