Der_Andi Posted February 25, 2007 Share Posted February 25, 2007 I searched, but i didn't found what i need. So i wrote it by myself. A simple color picker. Retrieves the color under your mouse pointer and shows it in AutoIt-friendly hex format. Press the button, to copy the "0x......"-value into clipboard. Hit the [Ctrl]-Key on your keyboard once, to lock/unlock the GUI. That's all. Happy programming. expandcollapse popup#include <GuiConstants.au3> #include <Misc.au3> GuiCreate("ColorPicker", 170, 80, -1, -1, -1, $ws_ex_topmost + $ws_ex_toolwindow) GUISetFont(9, 400, 0, "Verdana") $lbl_color = GuiCtrlCreateLabel("", 10, 10, 60, 60, $ss_center + $ss_centerimage) GUICtrlSetFont(-1, 9, 600) $lbl_hex = GuiCtrlCreateLabel("0x", 80, 10, 80, 20, $ss_center + $ss_sunken + $ss_centerimage) $cmd_copy = GuiCtrlCreateButton("", 80, 40, 80, 30, $bs_icon) GUICtrlSetImage($cmd_copy, "shell32.dll", 134, 0) GUICtrlSetTip($cmd_copy, "Copy hex-value into clipboard") $last = 0 GuiSetState() While 1 $msg = GuiGetMsg() $col = PixelGetColor(MouseGetPos(0), MouseGetPos(1)) Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $col <> $last And GUICtrlRead($lbl_color) = "" GUICtrlSetData($lbl_hex, "0x" & Hex($col, 6)) GUICtrlSetBkColor($lbl_color, "0x" & Hex($col, 6)) $last = $col Case _IsPressed("11") = 1 If GUICtrlRead($lbl_color) = "[Lock]" Then GUICtrlSetData($lbl_color, "") Else GUICtrlSetData($lbl_color, "[Lock]") If $col < 3000000 Then GUICtrlSetColor($lbl_color, 0xFFFFFF) Else GUICtrlSetColor($lbl_color, 0x000000) EndIf EndIf Sleep(200) Case $msg = $cmd_copy ClipPut(GUICtrlRead($lbl_hex)) EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 25, 2007 Moderators Share Posted February 25, 2007 http://www.autoitscript.com/forum/index.ph...c=16789&hl= Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Der_Andi Posted February 25, 2007 Author Share Posted February 25, 2007 I know, there are 100's of those tools out there. Link to comment Share on other sites More sharing options...
jvanegmond Posted February 25, 2007 Share Posted February 25, 2007 I know, there are 100's of those tools out there. Why would you make another? github.com/jvanegmond Link to comment Share on other sites More sharing options...
Der_Andi Posted February 26, 2007 Author Share Posted February 26, 2007 well, the one's i tested, didn't exactly fulfill my needs. Link to comment Share on other sites More sharing options...
Ed_Maximized Posted February 26, 2007 Share Posted February 26, 2007 well, the one's i tested, didn't exactly fulfill my needs. I support you Der_Andi. I improve it a little adding a color chart!!! color_picker.zip At least it is usefull for me!!! Ed ShapedGUI Creator : Shaped gui the easy way!!!Txt2au3 : the easy way to include text files into your program without fileinstall_GUICreateWithTiledBackground : Put a GIF in the background of your formsSQLite Database BrowserAnimated GIF UDF : Put animations in your GUI's Link to comment Share on other sites More sharing options...
jvanegmond Posted February 26, 2007 Share Posted February 26, 2007 well, the one's i tested, didn't exactly fulfill my needs.Well, if someone supports you I can't argue with you. Nice job github.com/jvanegmond Link to comment Share on other sites More sharing options...
Chupa Posted February 27, 2007 Share Posted February 27, 2007 maybe one of you guys could add a 15 by 15 pixels window that would act as a magnifing glass, attached to the mouse cursor... Link to comment Share on other sites More sharing options...
jvanegmond Posted February 27, 2007 Share Posted February 27, 2007 maybe one of you guys could add a 15 by 15 pixels window that would act as a magnifing glass, attached to the mouse cursor...Try the search button. It exists. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Will66 Posted February 27, 2007 Share Posted February 27, 2007 I know, there are 100's of those tools out there. Color Cop ==>95kbhard to beat at that size and price Link to comment Share on other sites More sharing options...
Der_Andi Posted February 27, 2007 Author Share Posted February 27, 2007 attached to the mouse cursor... Ah, you prefer a GUI that hunts for your mouse? expandcollapse popup#include <GuiConstants.au3> #include <Misc.au3> GuiCreate("ColorPicker", 170, 80, -1, -1, -1, $ws_ex_topmost + $ws_ex_toolwindow) GUISetFont(9, 400, 0, "Verdana") $lbl_color = GuiCtrlCreateLabel("", 10, 10, 60, 60, $ss_center + $ss_centerimage) GUICtrlSetFont(-1, 9, 600) $lbl_hex = GuiCtrlCreateLabel("0x", 80, 10, 80, 20, $ss_center + $ss_sunken + $ss_centerimage) $cmd_copy = GuiCtrlCreateButton("", 80, 40, 80, 30, $bs_icon) GUICtrlSetImage($cmd_copy, "shell32.dll", 134, 0) GUICtrlSetTip($cmd_copy, "Copy hex-value into clipboard") $last = 0 GuiSetState() While 1 $msg = GuiGetMsg() $x = MouseGetPos(0) $y = MouseGetPos(1) If GUICtrlRead($lbl_color) = "" Then Select Case $x < @DesktopWidth/2 And $y < @DesktopHeight/2 ;top-left $offX = 20 $offY = 20 Case $x > @DesktopWidth/2 And $y < @DesktopHeight/2 ;top-right $offX = -20 - 176 $offY = 20 Case $x < @DesktopWidth/2 And $y > @DesktopHeight/2 ;bottom-left $offX = 20 $offY = -20 - 106 Case $x > @DesktopWidth/2 And $y > @DesktopHeight/2 ;bottom-right $offX = -20 - 176 $offY = -20 - 106 EndSelect WinMove("ColorPicker", "0x", $x + $offX, $y + $offY) EndIf $col = PixelGetColor($x, $y) Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $col <> $last And GUICtrlRead($lbl_color) = "" GUICtrlSetData($lbl_hex, "0x" & Hex($col, 6)) GUICtrlSetBkColor($lbl_color, "0x" & Hex($col, 6)) $last = $col Case _IsPressed("11") = 1 If GUICtrlRead($lbl_color) = "[Lock]" Then GUICtrlSetData($lbl_color, "") Else GUICtrlSetData($lbl_color, "[Lock]") If $col < 3000000 Then GUICtrlSetColor($lbl_color, 0xFFFFFF) Else GUICtrlSetColor($lbl_color, 0x000000) EndIf EndIf Sleep(200) Case $msg = $cmd_copy ClipPut(GUICtrlRead($lbl_hex)) EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
GEOSoft Posted February 27, 2007 Share Posted February 27, 2007 Color Cop ==>95kbhard to beat at that size and price Or my personal favorite George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
therks Posted February 28, 2007 Share Posted February 28, 2007 (edited) Why would you make another?To me it always seemed like one of those scripts that everyone has to make their own version of at one time or another. Almost like a rite of passage. ...I made one too (actually I made two, but the first one was kinda crappy)...Source is included in the .zip.The main things I added in mine were a few options I never saw in others. You can fade from one colour to another (gradient), invert the colours, save swatches (which are really just ini files). I wrote a rather long readme one night while I was at work. Edited February 28, 2007 by Saunders My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
HardHackz Posted February 28, 2007 Share Posted February 28, 2007 Hmm...for the lock, do you use a hot key? Because the documentation says that Ctrl by it self cannot be used as a hot key. [center]My BlogOldSock Programs (AutoIT Apps)A Message to Hackers! (NOT SKIDDIES!)OldSock Programs is my little "company."[/center] Link to comment Share on other sites More sharing options...
therks Posted March 5, 2007 Share Posted March 5, 2007 Not quite sure who you're talking to HardHackz, but I would guess the answer to your question is that someone is using the IsPressed UDF to check to see if the Ctrl key is pressed. Check the manual for IsPressed. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
RocTx Posted April 3, 2007 Share Posted April 3, 2007 I always thought "X Drop" was a good one.http://www.autoitscript.com/forum/index.ph...27&hl=xdropRocTx Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now