Frost128 Posted September 11, 2007 Posted September 11, 2007 topic says most of it, I need help to get the colour picker to work because im working on making a thing for gta modding to make alot of stuff easier so if anyone could help i need a script that has the colour picker a pic of the colour and a button to choose the colour i will take all the help i can get thanks
Lee Bussy Posted September 11, 2007 Posted September 11, 2007 (edited) topic says most of it, I need help to get the colour picker to work because im working on making a thing for gta modding to make alot of stuff easier so if anyone could help i need a script that has the colour picker a pic of the colour and a button to choose the colourI'm not sure if I'm understanding you correctly. If you need to get the color on the screen you would use PixelGetColor(). If you needed to pick a color under the mouse cursor for example, you could use it with MouseGetPos(). (Tested) I would think something like: $pos = MouseGetPos() $col = PixelGetColor($pos[0], $pos[1]) MsgBox(0, "", "Color @ " & $pos[0] & "," & $pos[1] & " = " & $col) If that's not what you mean, some clarification is in order (at least for me). Edited September 11, 2007 by Lee Bussy
ofLight Posted September 11, 2007 Posted September 11, 2007 (edited) $pos = MouseGetPos() $col = PixelGetColor($pos[0], $pos[1]) MsgBox(0,"", "Color @ " & $pos[0] & "," & $pos[1] & " = " & $col) I am not shur what he wants exactly either lol, ur to fast Lee Edited September 11, 2007 by ofLight There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly
Nahuel Posted September 11, 2007 Posted September 11, 2007 Go here http://www.autoitscript.com/forum/index.php?showtopic=52284
xcal Posted September 11, 2007 Posted September 11, 2007 Maybe _ChooseColor How To Ask Questions The Smart Way
Frost128 Posted September 12, 2007 Author Posted September 12, 2007 (edited) I meant the colour picker like in ms paint it has rgb boxes and the whole gradient areathis is what im talking about: Edited September 12, 2007 by Frost128
anixon Posted September 13, 2007 Posted September 13, 2007 I meant the colour picker like in ms paint it has rgb boxes and the whole gradient area this is what im talking about: This code will get you started CODE#include <Misc.au3> #NoTrayIcon $color = 0 $customcolor = 0 ;Create the colour palette $gui = GUICreate("",500,400,-1,-1,0x80000000+0x00400000,0x00000008+0x00000080) $label = GUICtrlCreateLabel("",10,5,150,15,-1,0x00100000) GUICtrlCreateGroup("", 250, 0, 250, 400) GUICtrlCreatePic("", -1, -1, -1, -1) GUICtrlSetImage(-1, @ScriptDir & "\colourpalette.jpg", -1, 4) ;Colour Palette Image GUISetState() ;Colour under mouse pointer while 1 If _IsPressed("1B") then ExitLoop $pos = MouseGetPos() $customcolor = PixelGetColor($pos[0],$pos[1]) if $customcolor <> $color then GUICtrlSetData($label,"Colour Under Mouse") GUICtrlSetColor($label,"0x" & Hex($customcolor,6)) $color = $customcolor EndIf sleep(10) WEnd You can create a colour palette as a *.jpg image. Saves an awful lot of coding. I guess that you could use a digital camera to capture a suitable image. Or capture the image on the screen and use a suitable program to edit out those bits which you do not want and then save it as an image file. Any other functionality you will have to code. Anyway I hope that it gets you started. Ant....
therks Posted September 14, 2007 Posted September 14, 2007 Or since he just wants the Windows color picker, he can do this. #include <Misc.au3> $color = _ChooseColor(2, 0x0080ff, 2) MsgBox(0,'Color',$color) My AutoIt Stuff | My Github
anixon Posted September 14, 2007 Posted September 14, 2007 Or since he just wants the Windows color picker, he can do this. #include <Misc.au3> $color = _ChooseColor(2, 0x0080ff, 2) MsgBox(0,'Color',$color) Like most things in life there is always more than one way of doing something or anything for that matter. Boy am I glad that I am not a cat or if I lived in New Zealand an opossum. Thanks for the information - very elegant. Ant..
Madza91 Posted October 14, 2007 Posted October 14, 2007 This code will get you started CODE#include <Misc.au3> #NoTrayIcon $color = 0 $customcolor = 0 ;Create the colour palette $gui = GUICreate("",500,400,-1,-1,0x80000000+0x00400000,0x00000008+0x00000080) $label = GUICtrlCreateLabel("",10,5,150,15,-1,0x00100000) GUICtrlCreateGroup("", 250, 0, 250, 400) GUICtrlCreatePic("", -1, -1, -1, -1) GUICtrlSetImage(-1, @ScriptDir & "\colourpalette.jpg", -1, 4) ;Colour Palette Image GUISetState() ;Colour under mouse pointer while 1 If _IsPressed("1B") then ExitLoop $pos = MouseGetPos() $customcolor = PixelGetColor($pos[0],$pos[1]) if $customcolor <> $color then GUICtrlSetData($label,"Colour Under Mouse") GUICtrlSetColor($label,"0x" & Hex($customcolor,6)) $color = $customcolor EndIf sleep(10) WEnd You can create a colour palette as a *.jpg image. Saves an awful lot of coding. I guess that you could use a digital camera to capture a suitable image. Or capture the image on the screen and use a suitable program to edit out those bits which you do not want and then save it as an image file. Any other functionality you will have to code. Anyway I hope that it gets you started. Ant.... How should i use and write that color in ini file? [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
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