鼠标停留在桌面上任意位置,F1,将该位置像素赋于主题1的颜色
F1::
color:= GetMouseColor()
oRGB := HexToRGB(color)
SetThemeColor(5,oRGB)
oRGB := 0
return
F2::
color:= GetMouseColor()
oRGB := HexToRGB(color)
SetThemeColor(6,oRGB)
oRGB := 0
return
F3::
color:= GetMouseColor()
oRGB := HexToRGB(color)
SetThemeColor(7,oRGB)
oRGB := 0
return
F4::
color:= GetMouseColor()
oRGB := HexToRGB(color)
SetThemeColor(8,oRGB)
oRGB := 0
return
GetMouseColor(){
MouseGetPos, mouseX, mouseY
CoordMode, Pixel, Screen
PixelGetColor, color, %mouseX%, %mouseY%, RGB
;~ StringRight color,color,8
return color
}
HexToRGB(HexColor){
RR := SubStr(HexColor, 3, 2)
GG := SubStr(HexColor, 5, 2)
BB := SubStr(HexColor, 7, 2)
oRGB16 := "0x" BB GG RR
oRGB := ToBase(oRGB16,10)
return oRGB
}
SetThemeColor(Index,oRGB){
try{
oPPT := ComObjActive("powerpoint.Application")
oDess := oPPT.ActivePresentation.Designs
loop, % oDess.Count
oDess.item(A_Index).SlideMaster.Theme.ThemeColorScheme(index).RGB := oRGB
}
return
}
ToBase(n,b){
return (n < b ? "" : ToBase(n//b,b)) . ((d:=Mod(n,b)) < 10 ? d : Chr(d+55))
}