forgot to commit the script

This commit is contained in:
Midnoclose 2023-03-02 00:33:19 -08:00
parent 63e0663679
commit 75f7d1ef84

26
src/System/Utils/GPLPalette.ZC Executable file
View file

@ -0,0 +1,26 @@
U0 PaletteExportGPL(U8* name="Palette", CBGR24 *pal=NULL) {
I64 i;
U8 *filename;
CDoc *out = DocNew;
if (!pal)
{
pal = MAlloc(sizeof(CBGR24) * COLORS_NUM);
GrPaletteGet(pal);
}
filename = ExtDefault(name, "gpl");
StrCopy(out->filename.name, filename);
Free(filename);
out->flags |= DOCF_PLAIN_TEXT | DOCF_NO_CURSOR;
DocPrint(out, "GIMP Palette\nName: %s\nColumns: 16\n", name);
for(i = 0; i < COLORS_NUM; i++)
DocPrint(out, "%d %d %d Zeal%d\n", pal[i].r, pal[i].g, pal[i].b, i);
Free(pal);
DocWrite(out);
DocDel(out);
}