;---------- ---------- ---------- ---------- ---------- ; 作成者のURL ---> http://www.setsuki.com/ ;---------- ---------- ---------- ---------- ---------- #module ;---------- ---------- ---------- ---------- ---------- ; デフォルトのパレットに変換 ;---------- ---------- ---------- ---------- ---------- #deffunc paldef int a mref bm,67 if( bm.3 == 0 ) : return ; デフォルトパレットの設定 dim def,256 def(001) = 0x000000, 0x800000, 0x008000, 0x808000, 0x000080, 0x800080, 0x008080, 0xc0c0c0 def(009) = 0xc0dcc0, 0xa6caf0, 0x040404, 0x080808, 0x0c0c0c, 0x111111, 0x161616, 0x1c1c1c def(017) = 0x222222, 0x292929, 0x555555, 0x4d4d4d, 0x424242, 0x393939, 0xff7c80, 0xff5050 def(025) = 0xd60093, 0xccecff, 0xefd6c6, 0xe7e7d6, 0xada990, 0x330000, 0x660000, 0x990000 def(033) = 0xcc0000, 0x003300, 0x333300, 0x663300, 0x993300, 0xcc3300, 0xff3300, 0x006600 def(041) = 0x336600, 0x666600, 0x996600, 0xcc6600, 0xff6600, 0x009900, 0x339900, 0x669900 def(049) = 0x999900, 0xcc9900, 0xff9900, 0x00cc00, 0x33cc00, 0x66cc00, 0x99cc00, 0xcccc00 def(057) = 0xffcc00, 0x66ff00, 0x99ff00, 0xccff00, 0x000033, 0x330033, 0x660033, 0x990033 def(065) = 0xcc0033, 0xff0033, 0x003333, 0x333333, 0x663333, 0x993333, 0xcc3333, 0xff3333 def(073) = 0x006633, 0x336633, 0x666633, 0x996633, 0xcc6633, 0xff6633, 0x009933, 0x339933 def(081) = 0x669933, 0x999933, 0xcc9933, 0xff9933, 0x00cc33, 0x33cc33, 0x66cc33, 0x99cc33 def(089) = 0xcccc33, 0xffcc33, 0x33ff33, 0x66ff33, 0x99ff33, 0xccff33, 0xffff33, 0x000066 def(097) = 0x330066, 0x660066, 0x990066, 0xcc0066, 0xff0066, 0x003366, 0x333366, 0x663366 def(105) = 0x993366, 0xcc3366, 0xff3366, 0x006666, 0x336666, 0x666666, 0x996666, 0xcc6666 def(113) = 0x009966, 0x339966, 0x669966, 0x999966, 0xcc9966, 0xff9966, 0x00cc66, 0x33cc66 def(121) = 0x99cc66, 0xcccc66, 0xffcc66, 0x00ff66, 0x33ff66, 0x99ff66, 0xccff66, 0xff00cc def(129) = 0xcc00ff, 0x009999, 0x993399, 0x990099, 0xcc0099, 0x000099, 0x333399, 0x660099 def(137) = 0xcc3399, 0xff0099, 0x006699, 0x336699, 0x663399, 0x996699, 0xcc6699, 0xff3399 def(145) = 0x339999, 0x669999, 0x999999, 0xcc9999, 0xff9999, 0x00cc99, 0x33cc99, 0x66cc66 def(153) = 0x99cc99, 0xcccc99, 0xffcc99, 0x00ff99, 0x33ff99, 0x66cc99, 0x99ff99, 0xccff99 def(161) = 0xffff99, 0x0000cc, 0x330099, 0x6600cc, 0x9900cc, 0xcc00cc, 0x003399, 0x3333cc def(169) = 0x6633cc, 0x9933cc, 0xcc33cc, 0xff33cc, 0x0066cc, 0x3366cc, 0x666699, 0x9966cc def(177) = 0xcc66cc, 0xff6699, 0x0099cc, 0x3399cc, 0x6699cc, 0x9999cc, 0xcc99cc, 0xff99cc def(185) = 0x00cccc, 0x33cccc, 0x66cccc, 0x99cccc, 0xcccccc, 0xffcccc, 0x00ffcc, 0x33ffcc def(193) = 0x66ff99, 0x99ffcc, 0xccffcc, 0xffffcc, 0x3300cc, 0x6600ff, 0x9900ff, 0x0033cc def(201) = 0x3333ff, 0x6633ff, 0x9933ff, 0xcc33ff, 0xff33ff, 0x0066ff, 0x3366ff, 0x6666cc def(209) = 0x9966ff, 0xcc66ff, 0xff66cc, 0x0099ff, 0x3399ff, 0x6699ff, 0x9999ff, 0xcc99ff def(217) = 0xff99ff, 0x00ccff, 0x33ccff, 0x66ccff, 0x99ccff, 0xccccff, 0xffccff, 0x33ffff def(225) = 0x66ffcc, 0x99ffff, 0xccffff, 0xff6666, 0x66ff66, 0xffff66, 0x6666ff, 0xff66ff def(233) = 0x66ffff, 0xa50021, 0x5f5f5f, 0x777777, 0x868686, 0x969696, 0xcbcbcb, 0xb2b2b2 def(241) = 0xd7d7d7, 0xdddddd, 0xe3e3e3, 0xeaeaea, 0xf1f1f1, 0xf8f8f8, 0xfffbf0, 0xa0a0a4 def(249) = 0x808080, 0xff0000, 0x00ff00, 0xffff00, 0x0000ff, 0xff00ff, 0x00ffff, 0xffffff ; 1 ビットの場合 if( a == 1 ){ repeat 255,1 : palette cnt,255,255,255 : loop : palette 0,0,0,0,1 return } ; 4 ビットの場合 if( a == 4 ){ repeat 7,1 palette cnt, def.cnt>>16&0xFF, def.cnt>>8&0xFF, def.cnt&0xFF loop repeat 8,248 palette cnt-240, def.cnt>>16&0xFF, def.cnt>>8&0xFF, def.cnt&0xFF loop repeat 240,16 : palette cnt, 0,0,0 : loop ; 8 ビットの場合 } else { repeat 255,1 palette cnt, def.cnt>>16&0xFF, def.cnt>>8&0xFF, def.cnt&0xFF loop } palette 0, def&0xFF, def>>8&0xFF, def>>16&0xFF, 1 return ;---------- ---------- ---------- ---------- ---------- #global #define EM_LINESCROLL $B6 //任意の方向にスクロール #define EM_GETLINECOUNT $BA //行数の取得 #define EM_SETSEL $B1 //指定した範囲を選択状態に設定 #define EM_LINEFROMCHAR $C9 //指定の文字位置の行番号 #define EM_LINEINDEX $BB //指定の行の先頭の文字位置の取得 #define EM_SCROLLCARET $B7 //意味 現在のカーソル位置を表示するようにスクロール #define EM_LINELENGTH $C1 buffer 2,100,100,1 : paldef 8 ans="" : notesel ans x=0 : y=0 repeat 256 gsel 2 : mref pal,69 r=peek(pal,cnt*3) g=peek(pal,cnt*3+1) b=peek(pal,cnt*3+2) noteadd strf("%06X", ( r << 16 ) | ( g << 8 ) | b ) gsel 0 color 0,0,0 : boxf x,y,x+10,y+10 color r,g,b : boxf x+1,y+1,x+9,y+9 x+=15 : if x>=(15*16) : x=0 : y+=15 loop gsel 0,1 font "MS ゴシック",16 : objmode 2 pos 0, ginfo_winy-200 mesbox ans, ginfo_winx,200 onclick *click_mouse stop *click_mouse pget mousex,mousey if( mousex < 15*16 )&&( mousey < 15*16 ){ numb = (mousey/15)*16 + (mousex/15) //行の先頭位置を取得 sendmsg objinfo(0,2), EM_LINEINDEX, numb, 0 : off = stat //行の文字数を取得 sendmsg objinfo(0,2), EM_LINELENGTH, numb, 0 : fin = stat // 選択位置を変更 sendmsg objinfo(0,2), EM_SETSEL, off, off+fin // 現在のカーソル位置を表示するようにスクロール (EM_SCROLLCARET) sendmsg objinfo(0,2), EM_SCROLLCARET,0,0 title "(No."+numb+") R="+ginfo_r+" G="+ginfo_g+" B="+ginfo_b } else { title "R="+ginfo_r+" G="+ginfo_g+" B="+ginfo_b } stop