; name: Eyedropper ; description: Get the color by your cursor. ; version: v1.1.0 ; author: Gooosie ; github: https://gi
; name: Eyedropper
; description: Get the color by your cursor.
; version: v1.1.0
; author: Gooosie
; github: https://github.com/gooosie/eyedropper
GUI -Caption -Resize +AlwaysOnTop +Border +ToolWindow
#Persistent
SetTimer, WatchCursor, 30
return
WatchCursor:
MouseGetPos, posX, posY
PixelGetColor, color, %posX%, %posY%, Slow RGB
colorRGB := HexToRGB(color)
;ToolTip, %posX%`, %posY%`n%color%`n%colorRGB%
ToolTip,%colorRGB%
WinGetPos, tooltipX, tooltipY, tooltipW, tooltipH, ahk_class tooltips_class32
GUI, Color, %color%
winX := tooltipX
winY := tooltipY + tooltipH + 4
;GUI, Show, x%winX% y%winY% w100 h20 NA
GUI, Show, x900 y0 w880 h30 NA
return
^h::
MouseGetPos, posX, posY
PixelGetColor, color, %posX%, %posY%, Slow RGB
Clipboard := color
return
^c::
MouseGetPos, posX, posY
PixelGetColor, color, %posX%, %posY%, Slow RGB
Clipboard := HexToRGB(color)
return
^q::
ExitApp
HexToRGB(color) {
colorR := SubStr(color, 3, 2)
colorG := SubStr(color, 5, 2)
colorB := SubStr(color, 7, 2)
colorR = 0x%colorR%
colorG = 0x%colorG%
colorB = 0x%colorB%
SetFormat, IntegerFast, D
colorR += 0
SetFormat, IntegerFast, D
colorG += 0
SetFormat, IntegerFast, D
colorB += 0
colorRGB = %colorR%`, %colorG%`, %colorB%
return colorRGB
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

