dv8 Posted May 19, 2006 Share Posted May 19, 2006 Here it is. I hope it'll be useful. expandcollapse popup#include <GUIConstants.au3> Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $mainwindow = GUICreate("ColorPick", 100, 155,-1,-1,$WS_SYSMENU) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") $labelR = GUICtrlCreateLabel ("R", 5,10,10,30) GUICtrlSetColor(-1,0xFF0000) GUICtrlSetFont (-1,9, 600) $input1 = GUICtrlCreateInput ("0",15,5,40,20,BITOR($WS_TABSTOP,$ES_NUMBER)) $updown1 = GUICtrlCreateUpdown($input1,BITOR($UDS_ARROWKEYS,$UDS_WRAP)) GUICtrlSetLimit(-1,255,0) GUICtrlSetOnEvent($input1, "_slider1") $label1 = GUICtrlCreateLabel ("", 60,5,20,20) GUICtrlSetBkColor(-1,0x000000) $label1_hv = GUICtrlCreateLabel ("00", 85,10,15,15) $labelG = GUICtrlCreateLabel ("G", 5,35,10,30) GUICtrlSetColor(-1,0x00FF00) GUICtrlSetFont (-1,9, 600) $input2 = GUICtrlCreateInput ("0",15,30,40,20,BITOR($WS_TABSTOP,$ES_NUMBER)) $updown2 = GUICtrlCreateUpdown($input2,BITOR($UDS_ARROWKEYS,$UDS_WRAP)) GUICtrlSetLimit(-1,255,0) GUICtrlSetOnEvent($input2, "_slider2") $label2 = GUICtrlCreateLabel ("", 60,30,20,20) GUICtrlSetBkColor(-1,0x000000) $label2_hv = GUICtrlCreateLabel ("00", 85,35,15,15) $labelB = GUICtrlCreateLabel ("B", 5,60,10,30) GUICtrlSetColor(-1,0x0000FF) GUICtrlSetFont (-1,9, 600) $input3 = GUICtrlCreateInput ("0",15,55,40,20,BITOR($WS_TABSTOP,$ES_NUMBER)) $updown3 = GUICtrlCreateUpdown($input3,BITOR($UDS_ARROWKEYS,$UDS_WRAP)) GUICtrlSetLimit(-1,255,0) GUICtrlSetOnEvent($input3, "_slider3") $label3 = GUICtrlCreateLabel ("", 60,55,20,20) GUICtrlSetBkColor(-1,0x000000) $label3_hv = GUICtrlCreateLabel ("00", 85,60,15,15) $label4 = GUICtrlCreateLabel ("", 5,80,95,20) GUICtrlSetBkColor(-1, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) $hex = GUICtrlCreateInput (hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2), 25,105,50,20,BITOR($ES_READONLY,$WS_TABSTOP,$ES_CENTER)) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func _slider1() GUICtrlSetBkColor($label1, "0x"&hex(GUICtrlRead(@GUI_CTRLID),2)&"0000") GUICtrlSetData($label1_hv,hex(GUICtrlRead(@GUI_CTRLID),2)) GUICtrlSetData($hex,hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) GUICtrlSetBkColor($label4, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) EndFunc Func _slider2() GUICtrlSetBkColor($label2, "0x00"&hex(GUICtrlRead(@GUI_CTRLID),2)&"00") GUICtrlSetData($label2_hv,hex(GUICtrlRead(@GUI_CTRLID),2)) GUICtrlSetData($hex,hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) GUICtrlSetBkColor($label4, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) EndFunc Func _slider3() GUICtrlSetBkColor($label3, "0x0000"&hex(GUICtrlRead(@GUI_CTRLID),2)) GUICtrlSetData($label3_hv,hex(GUICtrlRead(@GUI_CTRLID),2)) GUICtrlSetData($hex,hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) GUICtrlSetBkColor($label4, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) EndFunc Func CLOSEClicked() Exit EndFunc Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
Valuater Posted May 19, 2006 Share Posted May 19, 2006 (edited) its color daythere was a nice one from thatsgreat here ( today)http://www.autoitscript.com/forum/index.ph...opic=26350&hl=#8) Edited May 19, 2006 by Valuater Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 19, 2006 Moderators Share Posted May 19, 2006 Really nice job dv8! 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...
dv8 Posted May 19, 2006 Author Share Posted May 19, 2006 Really nice job dv8! 10x! Glad you like it.I tried to run it with the standard AutiIt (not the latest beta). It runs without errors, but the colors don't change.I find this a little bit strange. Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 19, 2006 Moderators Share Posted May 19, 2006 10x! Glad you like it.I tried to run it with the standard AutiIt (not the latest beta). It runs without errors, but the colors don't change.I find this a little bit strange.I would compare my 2 #include <GUIConstant.au3>'s with one another to make sure that the constants I'm using are the same, I also don't know/remember if Hex() was part of the original release, but I imagine it would have thrown you an error by now.I only use/have Beta installed now, as It does everything that the release does and a tad more. 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...
dv8 Posted May 19, 2006 Author Share Posted May 19, 2006 I would compare my 2 #include <GUIConstant.au3>'s with one another to make sure that the constants I'm using are the same, I also don't know/remember if Hex() was part of the original release, but I imagine it would have thrown you an error by now.I only use/have Beta installed now, as It does everything that the release does and a tad more.I guess, it's the HEX() function that's causing the problem. The only reason i wanted to use the alpha version is that the compiled program is 123KB (203KB - compiled with the beta). Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 19, 2006 Moderators Share Posted May 19, 2006 I guess, it's the HEX() function that's causing the problem. The only reason i wanted to use the alpha version is that the compiled program is 123KB (203KB - compiled with the beta).Sounds to me that the #include files are smaller in the release to get that kind of kb setting, did you compare the 2? 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...
dv8 Posted May 19, 2006 Author Share Posted May 19, 2006 Sounds to me that the #include files are smaller in the release to get that kind of kb setting, did you compare the 2?The included GUIConstants files are matching completely. Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 19, 2006 Moderators Share Posted May 19, 2006 The included GUIConstants files are matching completely.Ok ... Maybe the new UPX 2.0 packer is creating the extra size? I don't know lol. 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...
jefhal Posted May 19, 2006 Share Posted May 19, 2006 there was a nice one from thatsgreat here ( today)I definitely like Thatsgreat's sliders over the "updowns", but I do like dv8's composite color patch. Now if we can get them to pop up inside SciTE when you need to choose a color!! ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
dv8 Posted May 21, 2006 Author Share Posted May 21, 2006 I definitely like Thatsgreat's sliders over the "updowns", but I do like dv8's composite color patch.I made it with sliders at first, but didn't like that when you slide it the color didn't change until you let go the slider.And another advantages of the updowns is that they are smaller and you can input the values yourself. Going from updowns to sliders is easy, just a matter of changeing a fiew lines and coordinates.Now if we can get them to pop up inside SciTE when you need to choose a color!! That was the purpose of this script. I'm useing ConText for programming. It's great freeware editor, but doesn't have a color picker. So I made my own and call it useing the customizable "User Exec Keys" Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 21, 2006 Share Posted May 21, 2006 I made it with sliders at first, but didn't like that when you slide it the color didn't change until you let go the slider.And another advantages of the updowns is that they are smaller and you can input the values yourself. Going from updowns to sliders is easy, just a matter of changeing a fiew lines and coordinates.That was the purpose of this script. I'm useing ConText for programming. It's great freeware editor, but doesn't have a color picker. So I made my own and call it useing the customizable "User Exec Keys" uhmmmm mine changes its just cuz urs calls functions mine i just put in a continually checking loop Link to comment Share on other sites More sharing options...
dv8 Posted May 21, 2006 Author Share Posted May 21, 2006 uhmmmm mine changes its just cuz urs calls functions mine i just put in a continually checking loopYeap, you'r right. Anyway, I liked it better with updowns and left them.After all it's the idea that matters and it's working for me. Free Remote Desktop Software For Windows Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 21, 2006 Share Posted May 21, 2006 added in quick color patches could only think of doing it with adlibenable expandcollapse popup#include <GUIConstants.au3> $GUI = GUICreate("Color Chooser", 579, 289, 192, 125) GUISetBkColor(0xF1EFE2) $color1 = GUICtrlCreateLabel("", 24, 16, 84, 84) GUICtrlSetBkColor(-1, 0xF1EFE2) $color2 = GUICtrlCreateLabel("", 136, 16, 84, 84) GUICtrlSetBkColor(-1, 0xF1EFE2) $color3 = GUICtrlCreateLabel("", 248, 16, 84, 84) GUICtrlSetBkColor(-1, 0xF1EFE2) $color4 = GUICtrlCreateLabel("", 360, 16, 84, 84) GUICtrlSetBkColor(-1, 0xF1EFE2) $color5 = GUICtrlCreateLabel("", 472, 16, 84, 84) GUICtrlSetBkColor(-1, 0xF1EFE2) $choose1 = GUICtrlCreateRadio("Color 1", 24, 112, 65, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $choose2 = GUICtrlCreateRadio("Color 2", 136, 112, 65, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $choose3 = GUICtrlCreateRadio("Color 3", 248, 112, 65, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $choose4 = GUICtrlCreateRadio("Color 4", 360, 112, 65, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $choose5 = GUICtrlCreateRadio("Color 5", 472, 112, 65, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $input1 = GUICtrlCreateInput("", 16, 136, 81, 21, -1, $WS_EX_CLIENTEDGE) $input2 = GUICtrlCreateInput("", 128, 136, 81, 21, -1, $WS_EX_CLIENTEDGE) $input3 = GUICtrlCreateInput("", 248, 136, 81, 21, -1, $WS_EX_CLIENTEDGE) $input4 = GUICtrlCreateInput("", 352, 136, 81, 21, -1, $WS_EX_CLIENTEDGE) $input5 = GUICtrlCreateInput("", 464, 136, 81, 21, -1, $WS_EX_CLIENTEDGE) GUICtrlCreateLabel("Red", 16, 192, 24, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) GUICtrlCreateLabel("Green", 16, 216, 33, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) GUICtrlCreateLabel("Blue", 16, 240, 25, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $Red = GUICtrlCreateSlider(56, 192, 462, 21) GUICtrlSetLimit(-1,255,0) $r = GUICtrlCreateLabel("",530,192,20,20) $Green = GUICtrlCreateSlider(56, 216, 462, 21) GUICtrlSetLimit(-1,255,0) $g = GUICtrlCreateLabel("",530,216,20,20) $Blue = GUICtrlCreateSlider(56, 240, 462, 21) GUICtrlSetLimit(-1,255,0) $b = GUICtrlCreateLabel("",530,240,20,20) GUISetState(@SW_SHOW) Red() Green() Blue() WHile 1 $msg = GUIGetMsg() If $msg = $Red Then AdlibEnable("Red",150) ElseIf $msg = $Green Then AdlibEnable("Green",150) ElseIf $msg = $Blue Then AdlibEnable("Blue",150) EndIf If $msg = $GUI_EVENT_CLOSE Then Exit If GUICtrlRead($choose1) = $GUI_CHECKED Then GUICtrlSetBkColor($color1,"0x" & Hex(GUICtrlRead($Red),2) & Hex(GUICtrlRead($Green),2) & Hex(GUICtrlRead($Blue),2)) GUICtrlSetData($input1,"0x" & Hex(GUICtrlRead($Red),2) & Hex(GUICtrlRead($Green),2) & Hex(GUICtrlRead($Blue),2)) ElseIf GUICtrlRead($choose2) = $GUI_CHECKED Then GUICtrlSetBkColor($color2,"0x" & Hex(GUICtrlRead($Red),2) & Hex(GUICtrlRead($Green),2) & Hex(GUICtrlRead($Blue),2)) GUICtrlSetData($input2,"0x" & Hex(GUICtrlRead($Red),2) & Hex(GUICtrlRead($Green),2) & Hex(GUICtrlRead($Blue),2)) ElseIf GUICtrlRead($choose3) = $GUI_CHECKED Then GUICtrlSetBkColor($color3,"0x" & Hex(GUICtrlRead($Red),2) & Hex(GUICtrlRead($Green),2) & Hex(GUICtrlRead($Blue),2)) GUICtrlSetData($input3,"0x" & Hex(GUICtrlRead($Red),2) & Hex(GUICtrlRead($Green),2) & Hex(GUICtrlRead($Blue),2)) ElseIf GUICtrlRead($choose4) = $GUI_CHECKED Then GUICtrlSetBkColor($color4,"0x" & Hex(GUICtrlRead($Red),2) & Hex(GUICtrlRead($Green),2) & Hex(GUICtrlRead($Blue),2)) GUICtrlSetData($input4,"0x" & Hex(GUICtrlRead($Red),2) & Hex(GUICtrlRead($Green),2) & Hex(GUICtrlRead($Blue),2)) ElseIf GUICtrlRead($choose5) = $GUI_CHECKED Then GUICtrlSetBkColor($color5,"0x" & Hex(GUICtrlRead($Red),2) & Hex(GUICtrlRead($Green),2) & Hex(GUICtrlRead($Blue),2)) GUICtrlSetData($input5,"0x" & Hex(GUICtrlRead($Red),2) & Hex(GUICtrlRead($Green),2) & Hex(GUICtrlRead($Blue),2)) EndIf WEnd Func Red() GUICtrlSetBkColor($r,"0x" & Hex(GUICtrlRead($Red),2) & "0000") EndFunc Func Green() GUICtrlSetBkColor($g,"0x" & "00" & Hex(GUICtrlRead($Green),2) & "00") EndFunc Func Blue() GUICtrlSetBkColor($b,"0x" & "0000" & Hex(GUICtrlRead($Blue),2)) EndFunc Link to comment Share on other sites More sharing options...
eltorro Posted June 19, 2006 Share Posted June 19, 2006 (edited) Did not update the color patches for me.added in quick color patches could only think of doing it with adlibenableEdit1: autoit bbcode tags ignored so changed to code tag insteadEdit2: change if - then's to switch and select. modified code so could copy input box data.Edit3: Moved code to seperate reply. Edited June 19, 2006 by eltorro Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
eltorro Posted June 19, 2006 Share Posted June 19, 2006 However, it works fine now with the following. expandcollapse popup#include <GUIConstants.au3> $GUI = GUICreate("Color Chooser", 579, 289, 192, 125) GUISetBkColor(0xF1EFE2) $color1 = GUICtrlCreateLabel("", 24, 16, 84, 84) GUICtrlSetBkColor(-1, 0xF1EFE2) $color2 = GUICtrlCreateLabel("", 136, 16, 84, 84) GUICtrlSetBkColor(-1, 0xF1EFE2) $color3 = GUICtrlCreateLabel("", 248, 16, 84, 84) GUICtrlSetBkColor(-1, 0xF1EFE2) $color4 = GUICtrlCreateLabel("", 360, 16, 84, 84) GUICtrlSetBkColor(-1, 0xF1EFE2) $color5 = GUICtrlCreateLabel("", 472, 16, 84, 84) GUICtrlSetBkColor(-1, 0xF1EFE2) $choose1 = GUICtrlCreateRadio("Color 1", 24, 112, 65, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $choose2 = GUICtrlCreateRadio("Color 2", 136, 112, 65, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $choose3 = GUICtrlCreateRadio("Color 3", 248, 112, 65, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $choose4 = GUICtrlCreateRadio("Color 4", 360, 112, 65, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $choose5 = GUICtrlCreateRadio("Color 5", 472, 112, 65, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $input1 = GUICtrlCreateInput("", 16, 136, 81, 21, -1, $WS_EX_CLIENTEDGE) $input2 = GUICtrlCreateInput("", 128, 136, 81, 21, -1, $WS_EX_CLIENTEDGE) $input3 = GUICtrlCreateInput("", 248, 136, 81, 21, -1, $WS_EX_CLIENTEDGE) $input4 = GUICtrlCreateInput("", 352, 136, 81, 21, -1, $WS_EX_CLIENTEDGE) $input5 = GUICtrlCreateInput("", 464, 136, 81, 21, -1, $WS_EX_CLIENTEDGE) GUICtrlCreateLabel("Red", 16, 192, 24, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) GUICtrlCreateLabel("Green", 16, 216, 33, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) GUICtrlCreateLabel("Blue", 16, 240, 25, 17) GUICtrlSetBkColor(-1, 0xF1EFE2) $Red = GUICtrlCreateSlider(56, 192, 462, 21) GUICtrlSetLimit(-1,255,0) $r = GUICtrlCreateLabel("",530,192,20,20) $Green = GUICtrlCreateSlider(56, 216, 462, 21) GUICtrlSetLimit(-1,255,0) $g = GUICtrlCreateLabel("",530,216,20,20) $Blue = GUICtrlCreateSlider(56, 240, 462, 21) GUICtrlSetLimit(-1,255,0) $b = GUICtrlCreateLabel("",530,240,20,20) GUISetState(@SW_SHOW) Red() Green() Blue() WHile 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Red Red() Case $Blue Blue() Case $Green Green() Case Else Select Case GUICtrlRead($choose1) = $GUI_CHECKED If GuiCtrlRead($input1) <> _RgbHex() then GUICtrlSetBkColor($color1, _RgbHex()) GUICtrlSetData($input1, _RgbHex()) EndIf Case GUICtrlRead($choose2) = $GUI_CHECKED If GuiCtrlRead($input2) <> _RgbHex() then GUICtrlSetBkColor($color2, _RgbHex()) GUICtrlSetData($input2, _RgbHex()) EndIf Case GUICtrlRead($choose3) = $GUI_CHECKED If GuiCtrlRead($input3) <> _RgbHex() then GUICtrlSetBkColor($color3, _RgbHex()) GUICtrlSetData($input3, _RgbHex()) EndIf Case GUICtrlRead($choose4) = $GUI_CHECKED If GuiCtrlRead($input4) <> _RgbHex() then GUICtrlSetBkColor($color4, _RgbHex()) GUICtrlSetData($input4, _RgbHex()) EndIf Case GUICtrlRead($choose5) = $GUI_CHECKED If GuiCtrlRead($input5) <> _RgbHex() then GUICtrlSetBkColor($color5, _RgbHex()) GUICtrlSetData($input5, _RgbHex()) EndIf EndSelect EndSwitch WEnd Func _RgbHex() Return "0x" & Hex(GUICtrlRead($Red),2) & Hex(GUICtrlRead($Green),2) & Hex(GUICtrlRead($Blue),2) EndFunc Func Red() GUICtrlSetBkColor($r,"0x" & Hex(GUICtrlRead($Red),2) & "0000") EndFunc Func Green() GUICtrlSetBkColor($g,"0x" & "00" & Hex(GUICtrlRead($Green),2) & "00") EndFunc Func Blue() GUICtrlSetBkColor($b,"0x" & "0000" & Hex(GUICtrlRead($Blue),2)) EndFunc Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
XxXFaNtA Posted June 19, 2006 Share Posted June 19, 2006 (edited) Nice script That's why i made a while ago: expandcollapse popup#include <GUIConstants.au3> HotKeySet("{ESC}", "Quit") HotKeySet("{F5}", "F5") HotKeySet("{F6}", "F6") MsgBox(0,"Copyright:","This Program Was Made by FaNtA" & @LF & @LF & "Esc to exit" & @LF &"F5 To Get RGB Code" & @LF &"F6 To Get Hexcode") Global $GUI_Pixel[400] Global $GUI = GUICreate("Preview",80,80,0,0,$WS_POPUP+$WS_BORDER,$WS_EX_TOPMOST) Global $LastPos[2] = [0,0] $label = GUICtrlCreateLabel("",0,0,80,80) $label2 = GUICtrlCreateLabel("",25,35,40,15) GUISetState(@SW_SHOW) #region <Making the Label> $MousePos = MouseGetPos() GUICtrlSetBkColor($label,PixelGetColor($MousePos[0],$MousePos[1])) If Dec(PixelGetColor($mousePos[0],$MousePos[1])) < Dec(0x7F7F7F) Then GUICtrlSetData($label2,StringTrimLeft(Hex(PixelGetColor($MousePos[0],$MousePos[1])),2)) GUICtrlSetColor(-1,0xffFFFF) GuiCtrlSetBkColor($label2,$GUI_BKCOLOR_TRANSPARENT) Else GUICtrlSetData($label2,StringTrimLeft(Hex(PixelGetColor($MousePos[0],$MousePos[1])),2)) GUICtrlSetColor(-1,0x000000) GuiCtrlSetBkColor($label2,$GUI_BKCOLOR_TRANSPARENT) EndIf #endregion While 1 $MousePos = MouseGetPos() If ($LastPos[0] <> $MousePos[0] Or $LastPos[1] <> $MousePos[1]) Then WinMove("Preview","",$MousePos[0]+15,$MousePos[1]) $LastPos[0] = $MousePos[0] $LastPos[1] = $MousePos[1] #region <Making the Label> $MousePos = MouseGetPos() GUICtrlSetBkColor($label,PixelGetColor($MousePos[0],$MousePos[1])) If Dec(PixelGetColor($mousePos[0],$MousePos[1])) < Dec(0x7F7F7F) Then GUICtrlSetData($label2,StringTrimLeft(Hex(PixelGetColor($MousePos[0],$MousePos[1])),2)) GUICtrlSetColor(-1,0xffFFFF) GuiCtrlSetBkColor($label2,$GUI_BKCOLOR_TRANSPARENT) Else GUICtrlSetData($label2,StringTrimLeft(Hex(PixelGetColor($MousePos[0],$MousePos[1])),2)) GUICtrlSetColor(-1,0x000000) GuiCtrlSetBkColor($label2,$GUI_BKCOLOR_TRANSPARENT) EndIf #endregion EndIf Sleep(10) WEnd Func Quit() Exit EndFunc Func F5() $MousePos = MouseGetPos() ClipPut("("& Dec(StringMid(Hex(PixelGetColor($MousePos[0],$MousePos[1])),3,2)) &","& _ Dec(StringMid(Hex(PixelGetColor($MousePos[0],$MousePos[1])),5,2)) &","& _ Dec(StringMid(Hex(PixelGetColor($MousePos[0],$MousePos[1])),7,2)) &")") ToolTip("RGB-Code successfully saved into the Clipboard") EndFunc Func F6() $MousePos = MouseGetPos() ClipPut(StringTrimLeft(Hex(PixelGetColor($MousePos[0],$MousePos[1])),2)) ToolTip("Hexcode successfully saved into the Clipboard") EndFunc Edited June 19, 2006 by XxXFaNtA /[center][/center] Link to comment Share on other sites More sharing options...
Bert Posted February 1, 2007 Share Posted February 1, 2007 I made a update to the original script: expandcollapse popup#include <GUIConstants.au3> $filemake = FileOpen(@ScriptDir&"/bin/color.ini",9) FileClose($filemake) Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $mainwindow = GUICreate("ColorPicker by Dv8 ..................enhancements by Volly", 510, 155,-1,-1,$WS_SYSMENU) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") $labelR = GUICtrlCreateLabel ("R", 3,7,10,30) GUICtrlSetColor(-1,0xFF0000) GUICtrlSetFont (-1,9, 600) $input1 = GUICtrlCreateInput ("0",15,5,40,20,BITOR($WS_TABSTOP,$ES_NUMBER)) $updown1 = GUICtrlCreateUpdown($input1,BITOR($UDS_ARROWKEYS,$UDS_WRAP)) GUICtrlSetLimit(-1,255,0) GUICtrlSetOnEvent($input1, "_slider1") $label1 = GUICtrlCreateLabel ("", 60,5,20,20) GUICtrlSetBkColor(-1,0x000000) $label1_hv = GUICtrlCreateLabel ("00", 85,10,15,15) $labelG = GUICtrlCreateLabel ("G", 3,33,10,30) GUICtrlSetColor(-1,0x009600) GUICtrlSetFont (-1,9, 600) $input2 = GUICtrlCreateInput ("0",15,30,40,20,BITOR($WS_TABSTOP,$ES_NUMBER)) $updown2 = GUICtrlCreateUpdown($input2,BITOR($UDS_ARROWKEYS,$UDS_WRAP)) GUICtrlSetLimit(-1,255,0) GUICtrlSetOnEvent($input2, "_slider2") $label2 = GUICtrlCreateLabel ("", 60,30,20,20) GUICtrlSetBkColor(-1,0x000000) $label2_hv = GUICtrlCreateLabel ("00", 85,35,15,15) $labelB = GUICtrlCreateLabel ("B", 3,57,10,30) GUICtrlSetColor(-1,0x0000FF) GUICtrlSetFont (-1,9, 600) $input3 = GUICtrlCreateInput ("0",15,55,40,20,BITOR($WS_TABSTOP,$ES_NUMBER)) $updown3 = GUICtrlCreateUpdown($input3,BITOR($UDS_ARROWKEYS,$UDS_WRAP)) GUICtrlSetLimit(-1,255,0) GUICtrlSetOnEvent($input3, "_slider3") $label3 = GUICtrlCreateLabel ("", 60,55,20,20) GUICtrlSetBkColor(-1,0x000000) $label3_hv = GUICtrlCreateLabel ("00", 85,60,15,15) $label4 = GUICtrlCreateLabel ("", 12,80,80,20) GUICtrlSetBkColor(-1, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) $hex = GUICtrlCreateInput (hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2), 12,105,80,20,BITOR($ES_READONLY,$WS_TABSTOP,$ES_CENTER)) GUICtrlSetData($hex,"0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) $label_15 = GUICtrlCreateLabel ("", 120,3,70,70,$SS_SUNKEN) GUICtrlSetBkColor($label_15, IniRead(@ScriptDir&"/bin/color.ini", "color", 1, "")) $button_16 = GUICtrlCreateButton("Set", 135, 80, 40, 20) GUICtrlSetOnEvent($button_16, "_set1") $button_17 = GUICtrlCreateButton("To Clipboard", 120, 105, 70, 20) GUICtrlSetOnEvent($button_17, "_clip1") $label_18 = GUICtrlCreateLabel ("", 220,3,70,70,$SS_SUNKEN) GUICtrlSetBkColor($label_18, IniRead(@ScriptDir&"/bin/color.ini", "color", 2, "")) $button_19 = GUICtrlCreateButton("Set", 235, 80, 40, 20) GUICtrlSetOnEvent($button_19, "_set2") $button_20 = GUICtrlCreateButton("To Clipboard", 220, 105, 70, 20) GUICtrlSetOnEvent($button_20, "_clip2") $label_21 = GUICtrlCreateLabel ("", 320,3,70,70,$SS_SUNKEN) GUICtrlSetBkColor($label_21, IniRead(@ScriptDir&"/bin/color.ini", "color", 3, "")) $button_22 = GUICtrlCreateButton("Set", 335, 80, 40, 20) GUICtrlSetOnEvent($button_22, "_set3") $button_23 = GUICtrlCreateButton("To Clipboard", 320, 105, 70, 20) GUICtrlSetOnEvent($button_23, "_clip3") $label_24 = GUICtrlCreateLabel ("", 420,3,70,70,$SS_SUNKEN) GUICtrlSetBkColor($label_24, IniRead(@ScriptDir&"/bin/color.ini", "color", 4, "")) $button_25 = GUICtrlCreateButton("Set", 435, 80, 40, 20) GUICtrlSetOnEvent($button_25, "_set4") $button_26 = GUICtrlCreateButton("To Clipboard", 420, 105, 70, 20) GUICtrlSetOnEvent($button_26, "_clip4") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func _set1() GUICtrlSetBkColor($label_15, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) IniWrite(@ScriptDir&"/bin/color.ini", "color", 1, GUICtrlRead($hex)) EndFunc Func _clip1() clipput(IniRead(@ScriptDir&"/bin/color.ini", "color", 1, "")) EndFunc Func _set2() GUICtrlSetBkColor($label_18, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) IniWrite(@ScriptDir&"/bin/color.ini", "color", 2, GUICtrlRead($hex)) EndFunc Func _clip2() clipput(IniRead(@ScriptDir&"/bin/color.ini", "color", 2, "")) EndFunc Func _set3() GUICtrlSetBkColor($label_21, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) IniWrite(@ScriptDir&"/bin/color.ini", "color", 3, GUICtrlRead($hex)) EndFunc Func _clip3() clipput(IniRead(@ScriptDir&"/bin/color.ini", "color", 3, "")) EndFunc Func _set4() GUICtrlSetBkColor($label_24, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) IniWrite(@ScriptDir&"/bin/color.ini", "color", 4, GUICtrlRead($hex)) EndFunc Func _clip4() clipput(IniRead(@ScriptDir&"/bin/color.ini", "color", 4, "")) EndFunc Func _slider1() GUICtrlSetBkColor($label1, "0x"&hex(GUICtrlRead(@GUI_CTRLID),2)&"0000") GUICtrlSetData($label1_hv,hex(GUICtrlRead(@GUI_CTRLID),2)) GUICtrlSetData($hex,"0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) GUICtrlSetBkColor($label4, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) EndFunc Func _slider2() GUICtrlSetBkColor($label2, "0x00"&hex(GUICtrlRead(@GUI_CTRLID),2)&"00") GUICtrlSetData($label2_hv,hex(GUICtrlRead(@GUI_CTRLID),2)) GUICtrlSetData($hex,"0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) GUICtrlSetBkColor($label4, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) EndFunc Func _slider3() GUICtrlSetBkColor($label3, "0x0000"&hex(GUICtrlRead(@GUI_CTRLID),2)) GUICtrlSetData($label3_hv,hex(GUICtrlRead(@GUI_CTRLID),2)) GUICtrlSetData($hex,"0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) GUICtrlSetBkColor($label4, "0x"&hex(GUICtrlRead($input1),2)&hex(GUICtrlRead($input2),2)&hex(GUICtrlRead($input3),2)) EndFunc Func CLOSEClicked() Exit EndFunc The Vollatran project  My blog: http://www.vollysinterestingshit.com/ 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