randomize
title "hbgGX^[Y ver0.00000250"
//ver0.000.00110.000

buffer 2
gsel 0

dim list_palette,8,3
dim image,16,16,16

gosub *l_rnd_palette
gosub *l_generate_image
gosub *l_draw

cursor = 0
phase = 0

while
getkey key,1
if key = 1:gosub *l_leftclick
if mousex >= 32 & mousey >= 320 & mousex < 32+65*8 & mousey < 450{
	cursor = (mousey-320)/64*8+(mousex-32)/64
}
gosub *l_draw
await 10
wend

stop

*l_draw
	redraw 0
	color 255,255,255
	boxf 0,0,639,479

	//摜g
	color 0,0,0
	boxf 31,319,32+65*8,320+130
	color 255,255,255
	repeat(16)
	boxf 33+65*(cnt\8),321+65*(cnt/8),95+65*(cnt\8),383+65*(cnt/8)
	loop

	//pbgJ[
	color 0,0,0
	boxf 320,39,559,232
	repeat(8)
	color list_palette(cnt,0),list_palette(cnt,1),list_palette(cnt,2)
	boxf 322,cnt*24+41,557,cnt*24+62
	loop

	//摜
	i = 0
	while i<16
	y = 0
	while y<16
	x = 0
	while x<16
	color list_palette(image(x,y,i),0),list_palette(image(x,y,i),1),list_palette(image(x,y,i),2)
	boxf 33+65*(i\8)+x*4,321+65*(i/8)+y*4,36+65*(i\8)+x*4,324+65*(i/8)+y*4
	x+
	wend
	y+
	wend
	i+
	wend

	//摜
	y = 0
	while y<16
	x = 0
	while x<16
	color list_palette(image(x,y,cursor),0),list_palette(image(x,y,cursor),1),list_palette(image(x,y,cursor),2)
	boxf 16*x,16*y,16*x+15,16*y+15
	x+
	wend
	y+
	wend

	//ObhC
	color 128,128,128
	repeat(17)
	line 0,16*cnt,256,16*cnt
	line 16*cnt,0,16*cnt,256
	loop

	//bZ[W
	color 0,0,0
	boxf 0,456,480,480
	color 255,128,0
	pos 0,456
	mes "hbgG8IĂB"
	
	redraw 1
	return

*l_rnd_palette
	i = 0
	while i<8
	c = 0
	while c<3
	list_palette(i,c) = rnd(256)
	c+
	wend
	i+
	wend
	return

*l_generate_image
	i = 0
	while i<16
	y = 0
	while y<16
	x = 0
	while x<16
	image(x,y,i) = rnd(8)
	x+
	wend
	y+
	wend
	i+
	wend
	return

*l_leftclick
	if mousex >= 320 & mousex <560 & mousey >= 40 & mousey < 232{
		dot_cur = (mousey-40)/24
		dialog "",33
		list_palette(dot_cur,0) = ginfo_r
		list_palette(dot_cur,1) = ginfo_g
		list_palette(dot_cur,2) = ginfo_b		
	}
	return
//dialog "",33
//color ginfo_r,ginfo_g,ginfo_b
//boxf 0,0,640,480

