CodyBarrett Posted October 9, 2009 Posted October 9, 2009 is there a function to get a color matrix? like in _ChooseColor () but i want to make a realtime ColorToHEX converter and ahve THAT color from the matrix converted to HEX in a loop form... i cant find any thing on the forums about it... and No WINAPI functions... any help you guys? [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
Malkey Posted October 10, 2009 Posted October 10, 2009 is there a function to get a color matrix? like in _ChooseColor () but i want to make a realtime ColorToHEX converter and ahve THAT color from the matrix converted to HEX in a loop form... i cant find any thing on the forums about it... and No WINAPI functions... any help you guys? Here is an example answering one interpretation of what your post is about. ; #include <Array.au3> ; A colour matrix - an array filled with colours in decimal format. Local $aColMat[5][5] = [[0xff0000, 0x00FF00, 0x0000FF, 0x123456, Random(0, 0xFFFFFF, 1)], _ [Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1)], _ [Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1)], _ [Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1)], _ [Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1), Random(0, 0xFFFFFF, 1)]] _ArrayDisplay($aColMat, "random colours Dec. format") _ArrayToHex($aColMat, 1) _ArrayDisplay($aColMat, "Colours converted to Hex. format") ; $iReturnType similar to $iReturnType parameter in _ChooseColor fuction. Func _ArrayToHex(ByRef $aArr, $iReturnType) For $x = 0 To UBound($aColMat) - 1 For $y = 0 To UBound($aColMat, 2) - 1 Select Case $iReturnType = 1 ; Reverse colour channel order as orig. array with hex format. $aArr[$x][$y] = "0x" & StringRegExpReplace(Hex($aArr[$x][$y], 6), "(.{2})(.{2})(.{2})", "\3\2\1") Case $iReturnType = 2 ; Same colour channel order as orig. array with hex format. $aArr[$x][$y] = "0x" & Hex($aArr[$x][$y], 6) EndSelect Next Next Return 1 EndFunc ;==>_ArrayToHex ;
CodyBarrett Posted October 10, 2009 Author Posted October 10, 2009 wow.. thanks..thats interesting.. but i was kinda thinking of that Image, of all the colors on the right hand side of _ChooseColor... is there a way to get that? cause then Pixel get color would work to get what one is chosen... but i need that image.. i can make everything else but i was wondering how to get that image onto a GUI [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
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