AHK调色板并取色

AHK调色板并取色

AHK调色板并取色

MsgBox % ChooseColorA()
MsgBox % ChooseColorH()

ChooseColorA( CR=0x0, hWnd=0x0, X=25, Y=25, Title=0, CustomColors=0, RGB=1, Flags=0x3 ) {

	Static CC, Color = "000000", S22 = "                      ", ATOU = "MultiByteToWideChar"
	if ! ( VarSetCapacity( CC ) ) {
		CCD =
		( LTrim Join
			24ZV47ZV8N8J808N8H8H8J808HC0C0CH80808HFFMFFIFFFFMFFGFFGFFIFFFFGFFFFFFGC020C88G8K1BH2K2A
			01B8O43G43G68G6FG6FG73G65G43G6FG6CG6FG72G41G2H2H2H2H2H2H2H2H2H2H2H2H2H2H2H2H2H2H2M8G4DG
			53G2H53G68G65G6CG6CG2H44G6CG67P25O4H4G8CH9GFFFFFFFF82G26G42G61G73G69G63G2H63G6FG6CG6FG7
			2G73G3ATBH35O4HEG8CG56GDG2FFFF82X25O4G6AG8CH9GFFFFFFFF82G26G43G75G73G74G6FG6DG2H63G6FG6
			CG6FG72G73G3APBH35O4G74G8CG1CGD102FFFF82X35O4G96G8CHEGCF02FFFF8H26G44G65G66G69G6EG65G2H
			43G75G73G74G6FG6DG2H43G6FG6CG6FG72G73G2H3EG3ET1H35O4GA6G2CHEH1GFFFF8H4FG4BX35N34GA6G2CH
			EH2GFFFF8H43G61G6EG63G65G6CX35N64GA6G2CHEHE04FFFF8H26G48G65G6CG7QB1H5N98H4G76G74GC602FF
			FF82TB1H5N180104H8G74GBE02FFFF82TB1H5N98G7CG28G1AGC502FFFF82X35N2C01C8H4HEGC902FFFF8H26
			G6FT2H25N98G97G14H9GDA02FFFF82G43G6FG6CG6FG72T25NACG97G14H9GDB02FFFF82G7CG53G26G6FG6CG6
			9G64P2H25NC2G7EG14H9GD302FFFF82G48G75G26G65G3AS835ND8G7CG12HCGBF02FFFF81T2H25NC2G8CG14H
			9GD402FFFF82G26G53G61G74G3AS835ND8G8AG12HCGCG2FFFF81T2H25NC2G9AG14H9GD502FFFF82G26G4CG7
			5G6DG3AS835ND8G98G12HCGC102FFFF81T2H25NF3G7EG18H9GD602FFFF82G26G52G65G64G3AS835OD017CG1
			2HCGC202FFFF81T2H25NF3G8CG18H9GD702FFFF82G26G47G72G65G65G6EG3AS835OD018AG12HCGC302FFFF8
			1T2H25NF3G9AG18H9GD802FFFF82G42G6CG26G75G65G3AW835OD0198G12HCGC402FFFF81X35N98GA6G8EHEG
			C802FFFF8H26G41G64G64G2H74G6FG2H43G75G73G74G6FG6DG2H43G6FG6CG6FG72G73O
		)
		loop 20
			StringReplace,CCD,CCD,% Chr(70+21-A_Index),% SubStr("000000000000000000000",A_Index),All
		loop % VarSetCapacity(CC,StrLen(CCD)//2,0)
			NumPut( "0x" . SubStr(CCD, 2*A_Index-1,2),CC,A_Index-1,"Char" )
	}
	NumPut( &CC+100,CC,8 ), NumPut( &CC+36,CC,16 )
	IfNotEqual,CustomColors,0, Loop, Parse, CustomColors, |
	_ := (A_LoopField<>"" && A_Index<17) ? NumPut("0x" A_LoopField,CC,36+(4*(A_Index-1))) : 0
	Title ? DllCall( ATOU, Int,0,Int,0, Str,Title S22, UInt,22, UInt,&CC+122, UInt,44 ) : 0
	NumPut(Y,CC,112,"UShort"), NumPut(X,CC,110,"UShort"), NumPut(hWnd,CC,4) ,NumPut(Flags,CC,20)
	WinExist( "ahk_id" hWnd ) ? NumPut(0,CC,104) : 0
	RGB ? NumPut((((CR&0xFF)<<16)|(CR&0xFF00)|((CR&0xFF0000)>>16)),CC,12) : NumPut(CR,CC,12)
	if ! DllCall( "comdlg32\ChooseColorA", UInt,&CC ) || ErrorLevel
		return
	DllCall( "msvcrt\sprintf", Str,Color, Str,"%06X", UInt, RGB ? ( (((CR:=NumGet(CC,12) )
	&0xFF)<<16)|(CR&0xFF00)|((CR&0xFF0000)>>16)) : NumGet(CC,12) )
	return Color
}

ChooseColorH( Color=0x0, hWnd=0x0, Flags=0x3 )  { ; CC_FULLOPEN := 0x2
	VarSetCapacity(CC,36+64,0), NumPut(36,CC), NumPut(hWnd,CC,4), NumPut(Color,CC,12)
	NumPut(&CC+36,CC,16), NumPut(Flags,CC,20), DllCall( "comdlg32\ChooseColorA", Str,CC )
	Hex:="123456789ABCDEF0",   RGB:=&CC+11
	loop 3
		HexColorCode .=  SubStr(Hex, (*++RGB >> 4), 1) . SubStr(Hex, (*RGB & 15), 1)
	return HexColorCode
}

 

给TA捐赠
共{{data.count}}人
人已捐赠
其他应用

autohotkey设计的数独游戏

2018-1-28 18:27:10

其他

AHK获取所有激活窗口的详细信息

2018-2-1 18:49:38

2 条回复 A文章作者 M管理员
  1. 晶宏

    看看

  2. ahker

    测试全是000

个人中心
购物车
优惠劵
有新私信 私信列表
搜索