jknightdoeswork / swatchr

A color palette management system for Unity
MIT License
109 stars 15 forks source link

Black color missing when importing lospec palette .ase #5

Open hsandt opened 2 years ago

hsandt commented 2 years ago

When you Import ASE File (Browse...) and select a color palette in Photoshop ASE format downloaded from the lospec website, the resulting palette will lack black as first color.

Tried with:

2022-05-03 Copper Tech via ASE missed black

Because I don't have Photoshop, I can't verify that said palettes didn't missing the black color to start with. I didn't find a palette that as black not as first color to check if the issue occurs at other places (this matters if your parser skips any 0 at the beginning of the file, for instance; but I'd be surprised that there is no header in the format to avoid that issue).

Importing the equivalent PNG works fine.

2022-05-03 Copper Tech via PNG is OK

hsandt commented 2 years ago

I spot an error in the console log when importing the ASE:

[SwatchASEFile] File header did not match ASEF �Ā�Ā UnityEngine.Debug:LogErrorFormat (string,object[]) swatchr.SwatchASEFile:.ctor (byte[]) (at Assets/ColorPalettes/swatchr-master-2019-03-30/swatchr/InternalScripts/SwatchASEFile.cs:35) swatchr.SwatchASEFile:.ctor (string) (at Assets/ColorPalettes/swatchr-master-2019-03-30/swatchr/InternalScripts/SwatchASEFile.cs:23) swatchr.SwatchCreator:ImportASEFileBrowse () (at Assets/ColorPalettes/swatchr-master-2019-03-30/swatchr/Editor/SwatchCreator.cs:79)

So maybe the ASE was invalid indeed, or the parser failed to recognize the header and skipped the black color at the beginning along (due to 0?) for some reason.

jknightdoeswork commented 2 years ago

Thanks for reporting this bug and for using this project. Can you refer me to the exact .ase file? EDIT: I see there is a .ase file at those links. I'll look into it! Thanks!