AutoHotkey Community

It is currently May 27th, 2012, 1:34 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Color ID picker
PostPosted: May 5th, 2009, 8:41 am 
Offline

Joined: October 9th, 2008, 6:04 am
Posts: 180
Location: Finland
I had time so i made this. I know there are many of these, but i like my own! =D Maybe someone else like it too.
Its small and simple, it has a gui what follows the cursor! =P


Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ColorIdPicker2Clipboard ;;
;;                By Tseik ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Use left-click to copy color id to clipboard and exit
; Use right-click to exit

;-------------------------------------------------------------
Stop = 0

MouseGetPos, MouseX, MouseY

MouseX += 30
MouseY += 20

Gui, Add, Edit, x1 y1 w58 vColorIdEdit
Gui, Show, x%MouseX% y%MouseY% w54 h-2, ColorIdWindow
Gui, -Caption +AlwaysOnTop

Loop
{
   MouseGetPos, MouseX, MouseY
   MouseGetPos, PixelX, PixelY
   MouseX += 30
   MouseY += 20
   
   PixelGetColor, color, %PixelX%, %PixelY%
   
   WinMove, ColorIdWindow,, %MouseX%, %MouseY%
   GuiControl,, ColorIdEdit, %color%
   
   If Stop = 1
   {
      Clipboard = %color%
      ExitApp
   } 
   Else If Stop = 2
   {
      ExitApp
   }   
}   

LButton:: Stop = 1
RButton:: Stop = 2
;-------------------------------------------------------------

_________________
was i wrong, it makes me a very sad panda!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2009, 9:56 pm 
Offline

Joined: May 15th, 2007, 8:59 pm
Posts: 169
Ahh very simpliar to one I made a while back with a hotkey.
http://www.autohotkey.com/forum/viewtop ... 856#259856

I found it useful to actually see the color to make sure I got the right shade (if it was in a gradient or very narrow).

Also you will want to use
Code:
CoordMode, Mouse, Screen
. Otherwise your gui's position is relative to the window its in.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group