#
# ZX Next PAL palette exporter
# A Multipaint internal script
#

XREM "9-bit palette"

# RRRGGGBB .......B

A=256
FOR I=0 TO 255
	R=PEEK A
	A=A+1
	G=PEEK A
	A=A+1
	B=PEEK A
	A=A+1

	R=R/36
	G=G/36
	B=B/36

	L=R*32
	S=G*4
	L=L|S

	S=B&6
	S=S/2
	L=L|S

	H=B&1

	XBYTE L
	XBYTE H

NEXT I

# Write to file (bytes)

SAVE
