This commit is contained in:
2025-10-02 18:53:47 -05:00
parent 4b04fc65ad
commit c0cd4ead04
34 changed files with 684 additions and 35 deletions

View File

@@ -39,11 +39,15 @@ def processPalettizedImage(asset):
if all(color in palette['pixels'] for color in imagePalette):
break
else:
palette = palettes[0] # Just to avoid reference error
print(f"No matching palette found for {assetPath}!")
# Find which pixel is missing
for color in imagePalette:
if color not in palette:
print(f"Missing color: {color}")
if color in palette['pixels']:
continue
# Convert to hex (with alpha)
hexColor = '#{:02x}{:02x}{:02x}{:02x}'.format(color[0], color[1], color[2], color[3])
print(f"Missing color: {hexColor} in palette {palette['paletteName']}")
sys.exit(1)
print(f"Converting image {assetPath} to use palette")