WerWolv / ImHex-Patterns

Hex patterns, include patterns and magic files for the use with the ImHex Hex Editor
https://github.com/WerWolv/ImHex
GNU General Public License v2.0
625 stars 164 forks source link

Photoshop ASE palette pattern #189

Open mgerhardy opened 9 months ago

mgerhardy commented 9 months ago
struct Block {
    be u16 Type;
    be u32 BlockLength;
    be u16 NameLength;
    be char16 Name[NameLength];
    if (Type == 1) {
        char ColorSpace[4];
        if (ColorSpace == "RGB " || ColorSpace == "LAB ") {
            be float rgb[3];
        } else if(ColorSpace == "CMYK") {
            be float cymk[4];
        } else if (ColorSpace == "Gray") {
            be float gray;
        }
        be u16 colorType;
    } else if (Type == 49153) {
        u8 unknown[BlockLength - 4];
    } else if (Type == 49154) {
        u8 unknown[BlockLength - 4];
    } else {
        u8 unknown[BlockLength];
    }
};

struct Header {
    u8 magic[4];
    be u16 versionMajor;
    be u16 versionMinor;
    be u32 blocks;
    Block b[blocks];
};

Header hdr @0x00;

files on lospec:

https://lospec.com/palette-list/periwinkle-is-a-weird-word.ase

C3pa commented 1 month ago

Have you considered opening a PR with your pattern?