mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-08 03:29:44 +00:00
colors
This commit is contained in:
@@ -395,10 +395,22 @@ export const PlayerPatternSchema = z.object({
|
|||||||
patternData: PatternDataSchema,
|
patternData: PatternDataSchema,
|
||||||
colorPalette: ColorPaletteSchema.optional(),
|
colorPalette: ColorPaletteSchema.optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const PlayerColorSchema = z.object({
|
||||||
|
color: z
|
||||||
|
.string()
|
||||||
|
.regex(
|
||||||
|
/^#[0-9A-Fa-f]{6}$/,
|
||||||
|
"Color must be a valid hex code (e.g., #FF0000)",
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
export const PlayerCosmeticsSchema = z.object({
|
export const PlayerCosmeticsSchema = z.object({
|
||||||
flag: FlagSchema.optional(),
|
flag: FlagSchema.optional(),
|
||||||
pattern: PlayerPatternSchema.optional(),
|
pattern: PlayerPatternSchema.optional(),
|
||||||
|
color: PlayerColorSchema.optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const PlayerSchema = z.object({
|
export const PlayerSchema = z.object({
|
||||||
clientID: ID,
|
clientID: ID,
|
||||||
username: UsernameSchema,
|
username: UsernameSchema,
|
||||||
|
|||||||
Reference in New Issue
Block a user