spyrorocks Posted September 8, 2006 Share Posted September 8, 2006 OK, i made this utillity a few weeks ago and i use it a lot. Since i use it quite a bit, im gonna post it here for you guys to enjoy. What it does is allows you to grab the HTML colour code for any colour on your screen by dragging your mouse over the colour you want then freezing the display and copying it to your clipboard with a simple button.Commands:Push CTRL+F to freeze/Un-Freeze the colour display.Push "Copy Colour Code To Clipboard" to copy the selected colour code to your clipboard (Example: #00FF00)and thats pretty much it.Here is the code:expandcollapse popup#include<string.au3> #include <GUIConstants.au3> hotkeyset("^f", "freeze") $parent = GUICreate("Parent") $colour_pick = GUICreate("AutoColor", 305, 96, @desktopwidth - 307, @desktopheight - 20 - 130, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE), $parent) $current_colour = GUICtrlCreateLabel("", 6, 10, 87, 79) GUICtrlSetBkcolor(-1, 0xFFFFFF) GUICtrlCreateLabel("HTML Colour Code:", 106, 12, 102, 17) $text_colourcode = GUICtrlCreateInput("#FF00FF", 200, 10, 55, 21) $copy_toclip = GUICtrlCreateButton("Copy Colour Code To Clipboard", 96, 32, 175, 17, 0) GUICtrlSetFont(-1, 6, 400, 0, "MS Sans Serif") $status = GUICtrlCreateLabel("", 96, 62, 175, 17, $SS_CENTER) GUISetState(@SW_SHOW) global $freezing = 0 $colour = "" While 1 $nMsg = GUIGetMsg() if $nmsg = $GUI_EVENT_CLOSE then Exit if $nmsg = $copy_toclip then copyit() $mouse = MouseGetPos () if PixelGetcolor( $mouse[0] , $mouse[1] ) <> $colour and not $freezing then $mouse = MouseGetPos () $colour = PixelGetcolor( $mouse[0] , $mouse[1] ) GUICtrlSetBkcolor($current_colour, $colour) guictrlsetdata($text_colourcode, "#" & Hex($colour, 6)) endif WEnd func copyit() $colour = guictrlread($text_colourcode) if ClipPut ($colour) then guictrlsetdata($status, "Copyed "&$colour&" To ClipBoard") else guictrlsetdata($status, "Error Coping colourcode to clipboard.") endif endfunc func freeze() if $freezing then global $freezing = 0 guictrlsetdata($status, "Freeze Off") else global $freezing = 1 guictrlsetdata($status, "Freeze On") endif endfunc [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center] Link to comment Share on other sites More sharing options...
cppman Posted September 9, 2006 Share Posted September 9, 2006 Nice, this will come very useful(to me atleast. lol) Miva OS Project Link to comment Share on other sites More sharing options...
Valuater Posted September 9, 2006 Share Posted September 9, 2006 kinda made one similar beforehttp://www.autoitscript.com/forum/index.ph...=16789&hl=#8) Link to comment Share on other sites More sharing options...
spyrorocks Posted September 9, 2006 Author Share Posted September 9, 2006 Oh yeah. well, as long as someone likes it i guess it was worth posting. [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center] 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