I followed this description: http://worms2d.info/Palette_file
SetDirectory[NotebookDirectory[]];
ClearAll[ExportPal]
ExportPal[fnout_String,colors_List]:=Module[{colorout,length,str},colorout=Select[colors,ColorQ];
If[Length[colorout]>0,
colorout=List@@@(ColorConvert[#,"RGB"]&/@colorout);
colorout=Take[#,3]&/@colorout; (* remove alpha channel if present *)
colorout=Append[0]/@Round[255 colorout];
length=4+4+4+4+2+2+4Length[colors];
str=OpenWrite[fnout,BinaryFormat->True];
BinaryWrite[str,"RIFF"];
BinaryWrite[str,length,"Integer32"];
BinaryWrite[str,"PAL "];
BinaryWrite[str,"data"];
BinaryWrite[str,4Length[colors]+4,"Integer32"];
BinaryWrite[str,16^^0300,"Integer16"];
BinaryWrite[str,Length[colors],"Integer16"];
BinaryWrite[str,Join@@colorout,"Byte"];
Close[str]
,
Print["plz check z colors, something wrong! kthxbye!"];
Abort[]
]
]
ExportPal["out.pal",{RGBColor[0.5,0.1,0.8,0.1],Blue,Green,LABColor[0.33,-0.48,-0.54]}]
Unfortunately I don't have any software to test the pal file... so let me know if it works...