-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheyedropper.ahk
53 lines (48 loc) · 1.2 KB
/
eyedropper.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
; 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%
WinGetPos, tooltipX, tooltipY, tooltipW, tooltipH, ahk_class tooltips_class32
GUI, Color, %color%
winX := tooltipX
winY := tooltipY + tooltipH + 4
GUI, Show, x%winX% y%winY% w12 h12 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
}