Download
Pixelget2 will follow your cursor around the screen, showing the current pixel color in a small tooltip-like display nearby. The middle mouse button copies the current color to clipboard in RGB format, ready for pasting anywhere you like. Click on the tray icon to toggle GUI hide/show. User can customise font and background color via .ini file.
Changelog:
* Added hotkey for collecting colors [Ctrl]+[F] - writes the current color value to colors.txt - useful when want to get lots of colors, new values are appended to file automatically. (Thanks Titan for the idea!)
* Changed name of .ini file to avoid confusion with .txt file created in same directory.
* Added option to change hotkeys for collecting colors and copy to clipboard via .ini file.
* Added color mode option - user can now choose between pasting color values as hexidecimal or decimal.
* Pixelget2 now autoadjusts its position when the mouse is near the right/bottom edge of the screen to keep it showing on screen. (Thanks Titan!)
Code:
#SingleInstance force
setbatchlines, -1
SetWinDelay, -1
menu, tray, tip, pixelget2
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
toggle = 0
IniRead, FontColor, settings.ini, font, color
IniRead, BGColor, settings.ini, background, color
IniRead, Clpbrd, settings.ini, to clipboard, hotkey
IniRead, Cllct, settings.ini, collect colors, hotkey
IniRead, Mode, settings.ini, color mode, hex/dec
Hotkey, %Clpbrd%, Clipboard
Hotkey, %Cllct%, Collect
sleep, 100
Gui, +ToolWindow +AlwaysOnTop -SysMenu -Caption +Border
Gui, color, c%bgcolor%
Gui, Font, c%fontcolor% s8 wBold, Lucida Console
Gui, Add, Text, x2 y7 w66 +center vCurrentPixel, %color%
SetTimer, Get, 100
Menu, Tray, NoStandard ; only use this menu
Menu, Tray, Click, 1 ; Remove this line if you prefer double-click vs. single-click.
Menu, Tray, Add, &Show/Hide, View
Menu, Tray, Default, &Show/Hide
Menu, Tray, Add, &Edit Settings, Settings
Menu, Tray, Add, &Reload, Reload
Menu, Tray, Add, E&xit, Exit
return
Get:
MouseGetPos, MouseX, MouseY ; get mouse coords
if (MouseX >= (A_ScreenWidth * 0.90))
textx := MouseX - 80
else
textx := MouseX + 20
if (MouseY >= (A_ScreenHeight * 0.92))
texty := MouseY - 40
else
texty := MouseY + 20
PixelGetColor, color, %MouseX%, %MouseY%, RGB ; get pixel color
GuiControl, , CurrentPixel, %color%
Gui, Show, NoActivate w70 h25 x%textx% y%texty%, pixelget2
return
Clipboard:
ControlGetText, color, Static1, pixelget2
StringTrimLeft, color, color, 2
if mode = dec
gosub, hex2dec
else
Clipboard = %color%
Return
Collect:
ControlGetText, color, Static1, pixelget2
StringTrimLeft, color, color, 2
if mode = dec
{
gosub, hex2dec
FileAppend, %color%`n, colors.txt
return
}
else
Clipboard = %color%
FileAppend, %color% `n, colors.txt
return
^Q::
exitapp
View:
if toggle = 0
{
toggle = 1
Gui, Submit
SetTimer, Get, off
pause
suspend
}
else
{
toggle = 0
SetTimer, Get, 100
pause
suspend
}
return
Settings:
run, settings.ini
return
Reload:
reload
return
Exit:
exitapp
hex2dec:
StringMid, r, color, 1, 2
StringMid, g, color, 3, 2
StringMid, b, color, 5, 2
red = 0x%r%
green = 0x%g%
blue = 0x%b%
SetFormat, integer, d
red += 0
green +=0
blue +=0
SetFormat, integer, hex
color = %red%`,%green%`,%blue%
Clipboard = %color%
return