Advertisement
Guest User

autohotkey color detector

a guest
May 2nd, 2016
114
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Autohotkey 0.74 KB | None
  1. ;***********************Get Color**************************
  2. +^R::Reload      ;Reloads Script
  3. +^P::Pause       ;Pauses  Script
  4. Ins:: Suspend    ;Suspend hotkeys
  5.  
  6. ;Ctrl+Leftmousebutton  = Start stop Color Detection
  7. ;Ctrl+RightMousebutton = Copy current color to clipboard
  8. ;***********************************************************
  9.  
  10. #MaxThreadsPerHotkey 2
  11.  
  12. ^LButton::
  13. Toggle := !Toggle
  14. While Toggle {
  15.     MouseGetPos Xpos, Ypos
  16.     PixelGetColor Colour, %Xpos%, %Ypos%, RGB
  17.     StringTrimLeft Colour, Colour, 2                    ; Remove 0x
  18.     ToolTip %Colour% `n %Xpos% %Ypos%  
  19.     }
  20. ToolTip
  21. Return
  22.  
  23. ^RButton::
  24. StringTrimLeft Colour, Colour, 2                    ; Remove 0x
  25. Clipboard = %Colour%
  26. ToolTip Copied to the clipboard:`n%Colour%
  27. Sleep 3000
  28. ToolTip %Colour%
  29. Return
Advertisement
RAW Paste Data Copied
Advertisement