Frame
This commit is contained in:
@@ -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")
|
||||
|
Reference in New Issue
Block a user