The function returns the following error codes:
0 ... everything OK -1 ... the color palette cannot be written to the disk