version	U12.1.00
uid	palettes.u1-1784908822-0
record	Palette_,3
	0,name
	1,keys
	2,table
record	Color_,3
	0,r
	1,g
	2,b
impl	error
link	imrutils.u
link	lists.u
link	sort.u
global	20
	0,000001,PDB_,0
	1,000011,Palette_,3
	2,000011,Color_,3
	3,000005,BuiltinPalette,1
	4,000005,CreatePalette,3
	5,000005,DrawImage,-1
	6,000005,InitializePalettes,0
	7,000005,Measure,2
	8,000005,NearColor,2
	9,000005,PaletteChars,-1
	10,000005,PaletteColor,-1
	11,000005,PaletteKey,-1
	12,000005,RGB,1
	13,000005,makepalette,2
	14,000005,palette_colors,1
	15,000005,keyseq,-2
	16,000005,color_range,2
	17,000005,colorseq,1
	18,000005,sort_colors,1
	19,000005,value,1

proc BuiltinPalette
	local	0,001000,name
	local	1,000000,BuiltinPalette
	local	2,000000,proc
	con	0,010000,12,120,141,154,145,164,164,145,103,150,141,162,163
	con	1,002000,1,0
	declend
	filen	palettes.icn
	line	132
	colm	11
	synt	any
	mark	L1
	pnull
	var	1
	var	2
	str	0
	int	1
	line	134
	colm	26
	synt	any
	invoke	2
	line	134
	colm	19
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	mark	L3
	var	1
	var	0
	line	136
	colm	25
	synt	any
	invoke	1
	line	136
	colm	4
	synt	any
	pret
lab L3
	synt	any
	pfail
	unmark
lab L2
	pnull
	line	138
	colm	1
	synt	any
	pfail
	end
proc CreatePalette
	local	0,001000,name
	local	1,001000,keys
	local	2,001000,colors
	local	3,000020,i
	local	4,000020,k
	local	5,000020,t
	local	6,000000,InitializePalettes
	local	7,000000,BuiltinPalette
	local	8,000000,cset
	local	9,000000,table
	local	10,000000,ColorValue
	local	11,000000,PDB_
	local	12,000000,Palette_
	con	0,002000,1,1
	declend
	line	140
	colm	11
	synt	any
lab L1
	init	L3
	mark	L2
	var	6
	line	143
	colm	30
	synt	any
	invoke	0
	unmark
lab L2
	einit	L1
lab L3
	mark	L4
	line	145
	colm	4
	synt	if
	mark0
	var	7
	var	0
	line	145
	colm	21
	synt	any
	invoke	1
	unmark
	line	145
	colm	33
	synt	any
	pfail
	line	145
	colm	4
	synt	endif
	unmark
lab L4
	mark	L5
	line	147
	colm	4
	synt	if
	mark0
	pnull
	pnull
	var	1
	line	147
	colm	7
	synt	any
	size
	pnull
	var	8
	var	1
	line	147
	colm	21
	synt	any
	invoke	1
	line	147
	colm	16
	synt	any
	size
	line	147
	colm	13
	synt	any
	numne
	unmark
	line	147
	colm	33
	synt	any
	pfail
	line	147
	colm	4
	synt	endif
	unmark
lab L5
	mark	L6
	line	149
	colm	4
	synt	if
	mark0
	pnull
	pnull
	var	1
	line	149
	colm	7
	synt	any
	size
	pnull
	var	2
	line	149
	colm	16
	synt	any
	size
	line	149
	colm	13
	synt	any
	numne
	unmark
	line	149
	colm	29
	synt	any
	pfail
	line	149
	colm	4
	synt	endif
	unmark
lab L6
	mark	L7
	pnull
	var	5
	var	9
	line	151
	colm	14
	synt	any
	invoke	0
	line	151
	colm	6
	synt	any
	asgn
	unmark
lab L7
	mark	L8
	line	153
	colm	4
	synt	every
	mark0
	pnull
	var	3
	pnull
	int	0
	pnull
	var	2
	line	153
	colm	20
	synt	any
	size
	push1
	line	153
	colm	17
	synt	any
	toby
	line	153
	colm	12
	synt	any
	asgn
	pop
	mark0
	pnull
	pnull
	var	5
	pnull
	var	1
	var	3
	line	154
	colm	13
	synt	any
	subsc
	line	154
	colm	8
	synt	any
	subsc
	mark	L11
	var	10
	pnull
	var	2
	var	3
	line	154
	colm	38
	synt	any
	subsc
	line	154
	colm	31
	synt	any
	invoke	1
	line	154
	colm	43
	synt	any
	esusp
	goto	L12
lab L11
	line	154
	colm	45
	synt	any
	pfail
lab L12
	line	154
	colm	18
	synt	any
	asgn
	unmark
lab L9
	efail
lab L10
	line	153
	colm	4
	synt	endevery
	unmark
lab L8
	mark	L13
	pnull
	pnull
	var	11
	var	0
	line	156
	colm	8
	synt	any
	subsc
	var	12
	var	0
	var	1
	var	5
	line	156
	colm	26
	synt	any
	invoke	3
	line	156
	colm	15
	synt	any
	asgn
	unmark
lab L13
	mark	L14
	mark	L15
	pnull
	var	11
	var	0
	line	158
	colm	15
	synt	any
	subsc
	line	158
	colm	4
	synt	any
	pret
lab L15
	synt	any
	pfail
	unmark
lab L14
	pnull
	line	160
	colm	1
	synt	any
	pfail
	end
proc DrawImage
	local	0,001000,args
	local	1,000020,palette_pixels
	local	2,000020,palette_lookup
	local	3,000020,keys
	local	4,000020,c
	local	5,000020,i
	local	6,000020,row
	local	7,000020,imr
	local	8,000040,draw_image
	local	9,000000,proc
	local	10,000000,type
	local	11,000000,push
	local	12,000000,imstoimr
	local	13,000000,BuiltinPalette
	local	14,000000,PDB_
	local	15,000000,copy
	local	16,000000,cset
	local	17,000000,move
	local	18,000000,put
	local	19,000000,upto
	local	20,000000,Fg
	local	21,000000,DrawPoint
	con	0,010000,9,104,162,141,167,111,155,141,147,145
	con	1,002000,1,0
	con	2,002000,1,1
	con	3,010000,6,167,151,156,144,157,167
	con	4,002000,1,4
	declend
	line	164
	colm	11
	synt	any
lab L1
	init	L3
	mark	L2
	pnull
	var	8
	var	9
	str	0
	int	1
	line	168
	colm	30
	synt	any
	invoke	2
	line	168
	colm	23
	synt	any
	asgn
	unmark
lab L2
	einit	L1
lab L3
	mark	L4
	line	170
	colm	4
	synt	if
	mark0
	pnull
	var	10
	pnull
	var	0
	int	2
	line	170
	colm	16
	synt	any
	subsc
	line	170
	colm	11
	synt	any
	invoke	1
	str	3
	line	170
	colm	21
	synt	any
	lexne
	unmark
	var	11
	var	0
	line	170
	colm	50
	synt	any
	keywd	window
	line	170
	colm	43
	synt	any
	invoke	2
	line	170
	colm	4
	synt	endif
	unmark
lab L4
	mark	L5
	pnull
	var	7
	mark	L6
	var	12
	pnull
	var	0
	int	4
	line	172
	colm	24
	synt	any
	subsc
	line	172
	colm	19
	synt	any
	invoke	1
	line	172
	colm	29
	synt	any
	esusp
	goto	L7
lab L6
	mark	L8
	var	8
	var	0
	invoke	-1
	line	172
	colm	31
	synt	any
	pret
lab L8
	synt	any
	pfail
lab L7
	line	172
	colm	8
	synt	any
	asgn
	unmark
lab L5
	mark	L9
	line	174
	colm	4
	synt	if
	mark0
	var	13
	pnull
	var	7
	line	174
	colm	25
	synt	any
	field	palette
	line	174
	colm	21
	synt	any
	invoke	1
	unmark
	mark	L10
	var	8
	var	0
	invoke	-1
	line	174
	colm	40
	synt	any
	pret
lab L10
	synt	any
	pfail
	line	174
	colm	4
	synt	endif
	unmark
lab L9
	mark	L11
	pnull
	var	2
	mark	L12
	pnull
	pnull
	pnull
	var	14
	pnull
	var	7
	line	176
	colm	32
	synt	any
	field	palette
	line	176
	colm	28
	synt	any
	subsc
	line	176
	colm	23
	synt	any
	nonnull
	line	176
	colm	42
	synt	any
	field	table
	line	176
	colm	49
	synt	any
	esusp
	goto	L13
lab L12
	line	176
	colm	51
	synt	any
	pfail
lab L13
	line	176
	colm	19
	synt	any
	asgn
	unmark
lab L11
	mark	L14
	pnull
	var	1
	var	15
	var	2
	line	177
	colm	26
	synt	any
	invoke	1
	line	177
	colm	19
	synt	any
	asgn
	unmark
lab L14
	mark	L15
	pnull
	var	3
	var	16
	pnull
	var	7
	line	179
	colm	20
	synt	any
	field	pixels
	line	179
	colm	16
	synt	any
	invoke	1
	line	179
	colm	9
	synt	any
	asgn
	unmark
lab L15
	mark	L16
	line	181
	colm	4
	synt	every
	mark0
	pnull
	pnull
	var	1
	line	181
	colm	10
	synt	any
	bang
	pnull
	line	181
	colm	29
	synt	any
	llist	0
	line	181
	colm	26
	synt	any
	asgn
	pop
lab L17
	efail
lab L18
	line	181
	colm	4
	synt	endevery
	unmark
lab L16
	mark	L19
	line	183
	colm	4
	synt	every
	mark0
	pnull
	var	4
	pnull
	var	3
	line	183
	colm	15
	synt	any
	bang
	line	183
	colm	12
	synt	any
	asgn
	pop
	mark0
	mark	L22
	pnull
	var	5
	int	1
	line	184
	colm	9
	synt	any
	asgn
	unmark
lab L22
	pnull
	var	7
	line	185
	colm	10
	synt	any
	field	pixels
	line	185
	colm	18
	synt	any
	bscan
lab L23
	line	186
	colm	10
	synt	while
	mark0
	pnull
	var	6
	var	17
	pnull
	var	7
	line	186
	colm	31
	synt	any
	field	width
	line	186
	colm	27
	synt	any
	invoke	1
	line	186
	colm	20
	synt	any
	asgn
	unmark
	mark	L23
	mark	L26
	var	6
	line	187
	colm	17
	synt	any
	bscan
	line	188
	colm	16
	synt	every
	mark0
	var	18
	pnull
	var	1
	var	4
	line	188
	colm	40
	synt	any
	subsc
	pnull
	var	19
	var	4
	line	188
	colm	49
	synt	any
	invoke	1
	int	2
	line	188
	colm	53
	synt	any
	minus
	var	5
	line	188
	colm	25
	synt	any
	invoke	3
	pop
lab L27
	efail
lab L28
	line	188
	colm	16
	synt	endevery
	line	187
	colm	17
	synt	any
	escan
	unmark
lab L26
	pnull
	var	5
	dup
	int	2
	line	190
	colm	15
	synt	any
	plus
	asgn
lab L24
	unmark
	goto	L23
lab L25
	line	186
	colm	10
	synt	endwhile
	line	185
	colm	18
	synt	any
	escan
	unmark
lab L20
	efail
lab L21
	line	183
	colm	4
	synt	endevery
	unmark
lab L19
	mark	L29
	line	195
	colm	4
	synt	every
	mark0
	pnull
	var	4
	pnull
	var	3
	line	195
	colm	15
	synt	any
	bang
	line	195
	colm	12
	synt	any
	asgn
	pop
	mark0
	mark	L32
	mark	L33
	var	20
	pnull
	var	2
	var	4
	line	196
	colm	24
	synt	any
	subsc
	line	196
	colm	9
	synt	any
	invoke	1
	line	196
	colm	29
	synt	any
	esusp
	goto	L34
lab L33
	line	196
	colm	31
	synt	any
	pfail
lab L34
	unmark
lab L32
	var	21
	pnull
	var	1
	var	4
	line	197
	colm	33
	synt	any
	subsc
	invoke	-1
	unmark
lab L30
	efail
lab L31
	line	195
	colm	4
	synt	endevery
	unmark
lab L29
	mark	L35
	mark	L36
	pnull
	line	200
	colm	4
	synt	any
	pret
lab L36
	synt	any
	pfail
	unmark
lab L35
	pnull
	line	202
	colm	1
	synt	any
	pfail
	end
proc InitializePalettes
	local	0,000000,PDB_
	local	1,000000,table
	local	2,000000,type
	local	3,000000,runerr
	local	4,000000,InitializePalettes
	con	0,010000,5,164,141,142,154,145
	con	1,002000,3,777
	con	2,002000,1,1
	declend
	line	206
	colm	11
	synt	any
	mark	L1
	pnull
	pnull
	var	0
	line	208
	colm	4
	synt	any
	null
	var	1
	line	208
	colm	18
	synt	any
	invoke	0
	line	208
	colm	10
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	line	210
	colm	4
	synt	if
	mark0
	pnull
	var	2
	var	0
	line	210
	colm	11
	synt	any
	invoke	1
	str	0
	line	210
	colm	18
	synt	any
	lexne
	unmark
	var	3
	int	1
	line	210
	colm	41
	synt	any
	invoke	1
	line	210
	colm	4
	synt	endif
	unmark
lab L2
	mark	L3
	pnull
	var	4
	int	2
	line	212
	colm	23
	synt	any
	asgn
	unmark
lab L3
	mark	L4
	mark	L5
	pnull
	line	214
	colm	4
	synt	any
	pret
lab L5
	synt	any
	pfail
	unmark
lab L4
	pnull
	line	216
	colm	1
	synt	any
	pfail
	end
proc Measure
	local	0,001000,s1
	local	1,001000,s2
	local	2,000020,color1
	local	3,000020,color2
	local	4,000000,RGB
	con	0,002000,1,2
	declend
	line	218
	colm	11
	synt	any
	mark	L1
	pnull
	var	2
	var	4
	var	0
	line	221
	colm	17
	synt	any
	invoke	1
	line	221
	colm	11
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	3
	var	4
	var	1
	line	222
	colm	17
	synt	any
	invoke	1
	line	222
	colm	11
	synt	any
	asgn
	unmark
lab L2
	mark	L3
	mark	L4
	pnull
	pnull
	pnull
	pnull
	pnull
	var	2
	line	224
	colm	18
	synt	any
	field	r
	pnull
	var	3
	line	224
	colm	29
	synt	any
	field	r
	line	224
	colm	21
	synt	any
	minus
	int	0
	line	224
	colm	33
	synt	any
	power
	pnull
	pnull
	pnull
	var	2
	line	224
	colm	46
	synt	any
	field	g
	pnull
	var	3
	line	224
	colm	57
	synt	any
	field	g
	line	224
	colm	49
	synt	any
	minus
	int	0
	line	224
	colm	61
	synt	any
	power
	line	224
	colm	37
	synt	any
	plus
	pnull
	pnull
	pnull
	var	2
	line	225
	colm	14
	synt	any
	field	b
	pnull
	var	3
	line	225
	colm	25
	synt	any
	field	b
	line	225
	colm	17
	synt	any
	minus
	int	0
	line	225
	colm	29
	synt	any
	power
	line	224
	colm	65
	synt	any
	plus
	line	224
	colm	4
	synt	any
	pret
lab L4
	synt	any
	pfail
	unmark
lab L3
	pnull
	line	227
	colm	1
	synt	any
	pfail
	end
proc NearColor
	local	0,001000,name
	local	1,001000,s
	local	2,000020,palette_lookup
	local	3,000020,k
	local	4,000020,measure
	local	5,000020,close_key
	local	6,000020,color
	local	7,000000,ColorValue
	local	8,000000,PDB_
	local	9,000000,key
	local	10,000000,Measure
	con	0,002000,1,3
	con	1,002000,1,2
	con	2,002000,2,16
	con	3,002000,1,1
	con	4,002000,1,0
	declend
	line	231
	colm	11
	synt	any
	mark	L1
	pnull
	var	4
	pnull
	int	0
	pnull
	pnull
	pnull
	int	1
	int	2
	line	234
	colm	22
	synt	any
	power
	int	3
	line	234
	colm	27
	synt	any
	minus
	int	1
	line	234
	colm	32
	synt	any
	power
	line	234
	colm	17
	synt	any
	mult
	line	234
	colm	12
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	6
	mark	L3
	var	7
	var	1
	line	236
	colm	23
	synt	any
	invoke	1
	line	236
	colm	27
	synt	any
	esusp
	goto	L4
lab L3
	line	236
	colm	29
	synt	any
	pfail
lab L4
	line	236
	colm	10
	synt	any
	asgn
	unmark
lab L2
	mark	L5
	pnull
	var	2
	mark	L6
	pnull
	pnull
	pnull
	var	8
	var	0
	line	238
	colm	28
	synt	any
	subsc
	line	238
	colm	23
	synt	any
	nonnull
	line	238
	colm	35
	synt	any
	field	table
	line	238
	colm	42
	synt	any
	esusp
	goto	L7
lab L6
	line	238
	colm	44
	synt	any
	pfail
lab L7
	line	238
	colm	19
	synt	any
	asgn
	unmark
lab L5
	mark	L8
	line	240
	colm	4
	synt	every
	mark0
	pnull
	var	3
	var	9
	var	2
	line	240
	colm	18
	synt	any
	invoke	1
	line	240
	colm	12
	synt	any
	asgn
	pop
	mark0
	line	241
	colm	7
	synt	if
	mark0
	pnull
	var	4
	dup
	var	10
	pnull
	var	2
	var	3
	line	241
	colm	44
	synt	any
	subsc
	var	6
	line	241
	colm	29
	synt	any
	invoke	2
	line	241
	colm	18
	synt	any
	numgt
	asgn
	unmark
	mark	L11
	pnull
	var	5
	var	3
	line	242
	colm	19
	synt	any
	asgn
	unmark
lab L11
	line	243
	colm	9
	synt	if
	mark0
	pnull
	var	4
	int	4
	line	243
	colm	20
	synt	any
	numeq
	unmark
	unmark
	unmark
	pnull
	goto	L10
	line	243
	colm	9
	synt	endif
	line	241
	colm	7
	synt	endif
	unmark
lab L9
	efail
lab L10
	line	240
	colm	4
	synt	endevery
	unmark
lab L8
	mark	L12
	mark	L13
	pnull
	var	5
	line	246
	colm	11
	synt	any
	nonnull
	line	246
	colm	4
	synt	any
	pret
lab L13
	synt	any
	pfail
	unmark
lab L12
	pnull
	line	248
	colm	1
	synt	any
	pfail
	end
proc PaletteChars
	local	0,001000,args
	local	1,000020,name
	local	2,000040,palette_chars
	local	3,000000,InitializePalettes
	local	4,000000,proc
	local	5,000000,type
	local	6,000000,get
	local	7,000000,BuiltinPalette
	local	8,000000,PDB_
	con	0,010000,12,120,141,154,145,164,164,145,103,150,141,162,163
	con	1,002000,1,0
	con	2,002000,1,1
	con	3,010000,6,167,151,156,144,157,167
	declend
	line	252
	colm	11
	synt	any
lab L1
	init	L3
	mark	L2
	mark	L4
	var	3
	line	257
	colm	25
	synt	any
	invoke	0
	unmark
lab L4
	pnull
	var	2
	var	4
	str	0
	int	1
	line	258
	colm	28
	synt	any
	invoke	2
	line	258
	colm	21
	synt	any
	asgn
	unmark
lab L2
	einit	L1
lab L3
	mark	L5
	line	261
	colm	4
	synt	if
	mark0
	pnull
	var	5
	pnull
	var	0
	int	2
	line	261
	colm	16
	synt	any
	subsc
	line	261
	colm	11
	synt	any
	invoke	1
	str	3
	line	261
	colm	21
	synt	any
	lexeq
	unmark
	var	6
	var	0
	line	261
	colm	41
	synt	any
	invoke	1
	line	261
	colm	4
	synt	endif
	unmark
lab L5
	mark	L6
	pnull
	var	1
	pnull
	var	0
	int	2
	line	263
	colm	16
	synt	any
	subsc
	line	263
	colm	9
	synt	any
	asgn
	unmark
lab L6
	mark	L7
	line	265
	colm	4
	synt	ifelse
	mark	L8
	var	7
	var	1
	line	265
	colm	21
	synt	any
	invoke	1
	unmark
	mark	L10
	var	2
	var	1
	line	265
	colm	53
	synt	any
	invoke	1
	line	265
	colm	33
	synt	any
	pret
lab L10
	synt	any
	pfail
	goto	L9
lab L8
	mark	L11
	pnull
	pnull
	pnull
	var	8
	var	1
	line	266
	colm	22
	synt	any
	subsc
	line	266
	colm	17
	synt	any
	nonnull
	line	266
	colm	29
	synt	any
	field	keys
	line	266
	colm	9
	synt	any
	pret
lab L11
	synt	any
	pfail
lab L9
	line	265
	colm	4
	synt	endifelse
	unmark
lab L7
	pnull
	line	268
	colm	1
	synt	any
	pfail
	end
proc PaletteColor
	local	0,001000,args
	local	1,000020,palette_lookup
	local	2,000020,name
	local	3,000020,s
	local	4,000040,palette_color
	local	5,000000,InitializePalettes
	local	6,000000,proc
	local	7,000000,type
	local	8,000000,get
	local	9,000000,BuiltinPalette
	local	10,000000,PDB_
	con	0,010000,12,120,141,154,145,164,164,145,103,157,154,157,162
	con	1,002000,1,0
	con	2,002000,1,1
	con	3,010000,6,167,151,156,144,157,167
	con	4,002000,1,2
	declend
	line	272
	colm	11
	synt	any
lab L1
	init	L3
	mark	L2
	mark	L4
	var	5
	line	277
	colm	25
	synt	any
	invoke	0
	unmark
lab L4
	pnull
	var	4
	var	6
	str	0
	int	1
	line	278
	colm	28
	synt	any
	invoke	2
	line	278
	colm	21
	synt	any
	asgn
	unmark
lab L2
	einit	L1
lab L3
	mark	L5
	line	281
	colm	4
	synt	if
	mark0
	pnull
	var	7
	pnull
	var	0
	int	2
	line	281
	colm	16
	synt	any
	subsc
	line	281
	colm	11
	synt	any
	invoke	1
	str	3
	line	281
	colm	21
	synt	any
	lexeq
	unmark
	var	8
	var	0
	line	281
	colm	41
	synt	any
	invoke	1
	line	281
	colm	4
	synt	endif
	unmark
lab L5
	mark	L6
	pnull
	var	2
	pnull
	var	0
	int	2
	line	283
	colm	16
	synt	any
	subsc
	line	283
	colm	9
	synt	any
	asgn
	unmark
lab L6
	mark	L7
	pnull
	var	3
	pnull
	var	0
	int	4
	line	284
	colm	13
	synt	any
	subsc
	line	284
	colm	6
	synt	any
	asgn
	unmark
lab L7
	mark	L8
	line	286
	colm	4
	synt	if
	mark0
	var	9
	var	2
	line	286
	colm	21
	synt	any
	invoke	1
	unmark
	mark	L9
	var	4
	var	2
	var	3
	line	286
	colm	53
	synt	any
	invoke	2
	line	286
	colm	33
	synt	any
	pret
lab L9
	synt	any
	pfail
	line	286
	colm	4
	synt	endif
	unmark
lab L8
	mark	L10
	pnull
	var	1
	mark	L11
	pnull
	pnull
	pnull
	var	10
	var	2
	line	288
	colm	28
	synt	any
	subsc
	line	288
	colm	23
	synt	any
	nonnull
	line	288
	colm	35
	synt	any
	field	table
	line	288
	colm	42
	synt	any
	esusp
	goto	L12
lab L11
	line	288
	colm	44
	synt	any
	pfail
lab L12
	line	288
	colm	19
	synt	any
	asgn
	unmark
lab L10
	mark	L13
	mark	L14
	pnull
	pnull
	var	1
	var	3
	line	290
	colm	26
	synt	any
	subsc
	line	290
	colm	11
	synt	any
	nonnull
	line	290
	colm	4
	synt	any
	pret
lab L14
	synt	any
	pfail
	unmark
lab L13
	pnull
	line	292
	colm	1
	synt	any
	pfail
	end
proc PaletteKey
	local	0,001000,args
	local	1,000020,name
	local	2,000020,s
	local	3,000040,palette_key
	local	4,000000,InitializePalettes
	local	5,000000,proc
	local	6,000000,type
	local	7,000000,get
	local	8,000000,BuiltinPalette
	local	9,000000,NearColor
	con	0,010000,10,120,141,154,145,164,164,145,113,145,171
	con	1,002000,1,0
	con	2,002000,1,1
	con	3,010000,6,167,151,156,144,157,167
	con	4,002000,1,2
	declend
	line	296
	colm	11
	synt	any
lab L1
	init	L3
	mark	L2
	mark	L4
	var	4
	line	301
	colm	25
	synt	any
	invoke	0
	unmark
lab L4
	pnull
	var	3
	var	5
	str	0
	int	1
	line	302
	colm	26
	synt	any
	invoke	2
	line	302
	colm	19
	synt	any
	asgn
	unmark
lab L2
	einit	L1
lab L3
	mark	L5
	line	305
	colm	4
	synt	if
	mark0
	pnull
	var	6
	pnull
	var	0
	int	2
	line	305
	colm	16
	synt	any
	subsc
	line	305
	colm	11
	synt	any
	invoke	1
	str	3
	line	305
	colm	21
	synt	any
	lexeq
	unmark
	var	7
	var	0
	line	305
	colm	41
	synt	any
	invoke	1
	line	305
	colm	4
	synt	endif
	unmark
lab L5
	mark	L6
	pnull
	var	1
	pnull
	var	0
	int	2
	line	307
	colm	16
	synt	any
	subsc
	line	307
	colm	9
	synt	any
	asgn
	unmark
lab L6
	mark	L7
	pnull
	var	2
	pnull
	var	0
	int	4
	line	308
	colm	13
	synt	any
	subsc
	line	308
	colm	6
	synt	any
	asgn
	unmark
lab L7
	mark	L8
	line	310
	colm	4
	synt	ifelse
	mark	L9
	var	8
	var	1
	line	310
	colm	21
	synt	any
	invoke	1
	unmark
	mark	L11
	var	3
	var	1
	var	2
	line	310
	colm	51
	synt	any
	invoke	2
	line	310
	colm	33
	synt	any
	pret
lab L11
	synt	any
	pfail
	goto	L10
lab L9
	mark	L12
	var	9
	var	1
	var	2
	line	311
	colm	25
	synt	any
	invoke	2
	line	311
	colm	9
	synt	any
	pret
lab L12
	synt	any
	pfail
lab L10
	line	310
	colm	4
	synt	endifelse
	unmark
lab L8
	pnull
	line	313
	colm	1
	synt	any
	pfail
	end
proc RGB
	local	0,001000,s
	local	1,000020,color
	local	2,000000,Color_
	local	3,000000,ColorValue
	local	4,000000,tab
	local	5,000000,upto
	local	6,000000,move
	con	0,020000,1,054
	con	1,002000,1,1
	con	2,002000,1,0
	declend
	line	315
	colm	11
	synt	any
	mark	L1
	pnull
	var	1
	var	2
	line	318
	colm	19
	synt	any
	invoke	0
	line	318
	colm	10
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	var	3
	var	0
	line	320
	colm	14
	synt	any
	invoke	1
	line	320
	colm	18
	synt	any
	bscan
	mark	L3
	pnull
	pnull
	var	1
	line	321
	colm	12
	synt	any
	field	r
	var	4
	var	5
	cset	0
	line	321
	colm	26
	synt	any
	invoke	1
	line	321
	colm	21
	synt	any
	invoke	1
	line	321
	colm	15
	synt	any
	asgn
	pop
	var	6
	int	1
	line	322
	colm	11
	synt	any
	invoke	1
	pop
	pnull
	pnull
	var	1
	line	323
	colm	12
	synt	any
	field	g
	var	4
	var	5
	cset	0
	line	323
	colm	26
	synt	any
	invoke	1
	line	323
	colm	21
	synt	any
	invoke	1
	line	323
	colm	15
	synt	any
	asgn
	pop
	var	6
	int	1
	line	324
	colm	11
	synt	any
	invoke	1
	pop
	pnull
	pnull
	var	1
	line	325
	colm	12
	synt	any
	field	b
	var	4
	int	2
	line	325
	colm	21
	synt	any
	invoke	1
	line	325
	colm	15
	synt	any
	asgn
	line	326
	colm	9
	synt	any
	esusp
	goto	L4
lab L3
	line	326
	colm	11
	synt	any
	pfail
lab L4
	line	320
	colm	18
	synt	any
	escan
	unmark
lab L2
	mark	L5
	mark	L6
	var	1
	line	328
	colm	4
	synt	any
	pret
lab L6
	synt	any
	pfail
	unmark
lab L5
	pnull
	line	330
	colm	1
	synt	any
	pfail
	end
proc makepalette
	local	0,001000,name
	local	1,001000,clist
	local	2,000020,keys
	local	3,000040,alphan
	local	4,000000,CreatePalette
	con	0,002000,1,0
	con	1,002000,1,1
	declend
	line	332
	colm	11
	synt	any
lab L1
	init	L3
	mark	L2
	pnull
	var	3
	pnull
	line	336
	colm	22
	synt	any
	keywd	digits
	line	336
	colm	33
	synt	any
	keywd	letters
	line	336
	colm	30
	synt	any
	cat
	line	336
	colm	19
	synt	any
	asgn
	unmark
lab L2
	einit	L1
lab L3
	mark	L4
	line	338
	colm	4
	synt	if
	mark0
	pnull
	pnull
	var	1
	line	338
	colm	7
	synt	any
	size
	int	0
	line	338
	colm	14
	synt	any
	numeq
	unmark
	line	338
	colm	23
	synt	any
	pfail
	line	338
	colm	4
	synt	endif
	unmark
lab L4
	mark	L5
	pnull
	var	2
	line	341
	colm	7
	synt	ifelse
	mark	L6
	pnull
	pnull
	var	1
	line	341
	colm	10
	synt	any
	size
	pnull
	var	3
	line	341
	colm	19
	synt	any
	size
	line	341
	colm	17
	synt	any
	numlt
	unmark
	var	3
	goto	L7
lab L6
	line	342
	colm	12
	synt	any
	keywd	cset
lab L7
	line	341
	colm	7
	synt	endifelse
	line	340
	colm	9
	synt	any
	asgn
	unmark
lab L5
	mark	L8
	mark	L9
	var	4
	var	0
	pnull
	var	2
	int	1
	dup
	pnull
	var	1
	line	344
	colm	32
	synt	any
	size
	line	344
	colm	30
	synt	any
	plus
	synt	any
	sect
	var	1
	line	344
	colm	17
	synt	any
	invoke	3
	line	344
	colm	48
	synt	any
	esusp
	goto	L10
lab L9
	line	344
	colm	50
	synt	any
	pfail
lab L10
	unmark
lab L8
	mark	L11
	mark	L12
	pnull
	line	346
	colm	4
	synt	any
	pret
lab L12
	synt	any
	pfail
	unmark
lab L11
	pnull
	line	348
	colm	1
	synt	any
	pfail
	end
proc palette_colors
	local	0,001000,p
	local	1,000020,clist
	local	2,000000,put
	local	3,000000,PaletteColor
	local	4,000000,PaletteChars
	declend
	line	350
	colm	11
	synt	any
	mark	L1
	pnull
	var	1
	pnull
	line	353
	colm	13
	synt	any
	llist	0
	line	353
	colm	10
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	line	355
	colm	4
	synt	every
	mark0
	var	2
	var	1
	var	3
	var	0
	pnull
	var	4
	var	0
	line	355
	colm	50
	synt	any
	invoke	1
	line	355
	colm	37
	synt	any
	bang
	line	355
	colm	33
	synt	any
	invoke	2
	line	355
	colm	13
	synt	any
	invoke	2
	pop
lab L3
	efail
lab L4
	line	355
	colm	4
	synt	endevery
	unmark
lab L2
	mark	L5
	mark	L6
	var	1
	line	357
	colm	4
	synt	any
	pret
lab L6
	synt	any
	pfail
	unmark
lab L5
	pnull
	line	359
	colm	1
	synt	any
	pfail
	end
proc keyseq
	local	0,001000,palette
	local	1,001000,colors
	local	2,000020,chars
	local	3,000000,PaletteChars
	local	4,000000,upto
	local	5,000000,PaletteKey
	declend
	line	361
	colm	11
	synt	any
	mark	L1
	pnull
	var	2
	var	3
	var	0
	line	364
	colm	25
	synt	any
	invoke	1
	line	364
	colm	10
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	line	366
	colm	4
	synt	suspend
	mark0
	var	4
	var	5
	var	0
	pnull
	var	1
	line	366
	colm	37
	synt	any
	bang
	line	366
	colm	27
	synt	any
	invoke	2
	var	2
	line	366
	colm	16
	synt	any
	invoke	2
	line	366
	colm	4
	synt	any
	psusp
	pop
lab L3
	efail
lab L4
	line	366
	colm	4
	synt	endsuspend
	unmark
lab L2
	pnull
	line	368
	colm	1
	synt	any
	pfail
	end
proc color_range
	local	0,001000,color
	local	1,001000,range
	local	2,000020,r
	local	3,000020,g
	local	4,000020,b
	local	5,000000,tab
	local	6,000000,upto
	local	7,000000,move
	con	0,002000,1,2
	con	1,002000,2,16
	con	2,020000,1,054
	con	3,002000,1,1
	con	4,002000,1,0
	con	5,010000,1,054
	declend
	line	370
	colm	11
	synt	any
	mark	L1
	pnull
	var	1
	pnull
	pnull
	int	0
	int	1
	line	373
	colm	15
	synt	any
	power
	var	1
	line	373
	colm	20
	synt	any
	div
	line	373
	colm	10
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	var	0
	line	375
	colm	10
	synt	any
	bscan
	mark	L3
	pnull
	var	2
	var	5
	var	6
	cset	2
	line	376
	colm	20
	synt	any
	invoke	1
	line	376
	colm	15
	synt	any
	invoke	1
	line	376
	colm	9
	synt	any
	asgn
	unmark
lab L3
	mark	L4
	var	7
	int	3
	line	377
	colm	11
	synt	any
	invoke	1
	unmark
lab L4
	mark	L5
	pnull
	var	3
	var	5
	var	6
	cset	2
	line	378
	colm	20
	synt	any
	invoke	1
	line	378
	colm	15
	synt	any
	invoke	1
	line	378
	colm	9
	synt	any
	asgn
	unmark
lab L5
	mark	L6
	var	7
	int	3
	line	379
	colm	11
	synt	any
	invoke	1
	unmark
lab L6
	mark	L7
	pnull
	var	4
	var	5
	int	4
	line	380
	colm	15
	synt	any
	invoke	1
	line	380
	colm	9
	synt	any
	asgn
	unmark
lab L7
	mark	L8
	pnull
	pnull
	pnull
	pnull
	pnull
	var	2
	var	1
	line	381
	colm	17
	synt	any
	mult
	str	5
	line	381
	colm	26
	synt	any
	cat
	pnull
	var	3
	var	1
	line	381
	colm	39
	synt	any
	mult
	line	381
	colm	33
	synt	any
	cat
	str	5
	line	381
	colm	48
	synt	any
	cat
	pnull
	var	4
	var	1
	line	381
	colm	61
	synt	any
	mult
	line	381
	colm	55
	synt	any
	cat
	line	381
	colm	7
	synt	any
	pret
lab L8
	synt	any
	pfail
	line	375
	colm	10
	synt	any
	escan
	unmark
lab L2
	pnull
	line	384
	colm	1
	synt	any
	pfail
	end
proc colorseq
	local	0,001000,palette
	local	1,000000,PaletteColor
	local	2,000000,PaletteChars
	declend
	line	386
	colm	11
	synt	any
	mark	L1
	line	388
	colm	4
	synt	suspend
	mark0
	var	1
	var	0
	pnull
	var	2
	var	0
	line	388
	colm	47
	synt	any
	invoke	1
	line	388
	colm	34
	synt	any
	bang
	line	388
	colm	24
	synt	any
	invoke	2
	line	388
	colm	4
	synt	any
	psusp
	pop
lab L2
	efail
lab L3
	line	388
	colm	4
	synt	endsuspend
	unmark
lab L1
	pnull
	line	390
	colm	1
	synt	any
	pfail
	end
proc sort_colors
	local	0,001000,colors
	local	1,000000,isort
	local	2,000000,value
	declend
	line	392
	colm	11
	synt	any
	mark	L1
	mark	L2
	var	1
	var	0
	var	2
	line	394
	colm	16
	synt	any
	invoke	2
	line	394
	colm	4
	synt	any
	pret
lab L2
	synt	any
	pfail
	unmark
lab L1
	pnull
	line	396
	colm	1
	synt	any
	pfail
	end
proc value
	local	0,001000,s
	local	1,000020,color
	local	2,000000,RGB
	con	0,002000,1,2
	declend
	line	398
	colm	11
	synt	any
	mark	L1
	pnull
	var	1
	var	2
	var	0
	line	401
	colm	16
	synt	any
	invoke	1
	line	401
	colm	10
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	mark	L3
	pnull
	pnull
	pnull
	pnull
	var	1
	line	403
	colm	16
	synt	any
	field	r
	int	0
	line	403
	colm	19
	synt	any
	power
	pnull
	pnull
	var	1
	line	403
	colm	30
	synt	any
	field	g
	int	0
	line	403
	colm	33
	synt	any
	power
	line	403
	colm	23
	synt	any
	plus
	pnull
	pnull
	var	1
	line	403
	colm	44
	synt	any
	field	b
	int	0
	line	403
	colm	47
	synt	any
	power
	line	403
	colm	37
	synt	any
	plus
	line	403
	colm	4
	synt	any
	pret
lab L3
	synt	any
	pfail
	unmark
lab L2
	pnull
	line	405
	colm	1
	synt	any
	pfail
	end
