chazzmani Posted September 10, 2007 Posted September 10, 2007 Here is small script I wrote to show you a problem I am having. If you will look at the code, it sets a color variable using a HEX color (0xDF816B). Easy enough. However, when I run the script and have the color code shown in the GUI, the color code is something I don't recognize (14647659). It doesn't look like an RGB code to me. Can someone shed any light? What color system is this new number coming from? Is it possible to show the HEX color within the box? Thanks in advance! CODE#include <GUIConstants.au3> #include <Misc.au3> #include <File.au3> $BurntOrange = 0xDF816B $GUI = GUICreate("", 200, 100, 5, 5) GUICtrlCreateLabel("Color:", 10, 54, 85, 17) $ColorDisplay = GUICtrlCreateLabel("", 95, 53, 76, 19, BitOR($SS_CENTER, $SS_SUNKEN)) GUICtrlSetBkColor($ColorDisplay, $BurntOrange) GUICtrlSetColor($ColorDisplay, 0x00ff00) GUICtrlSetFont ($ColorDisplay,9, 700) GUICtrlSetData($ColorDisplay, $BurntOrange);<========= show color code in box GUICtrlSetState(-1, $GUI_FOCUS) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect Wend
Toady Posted September 10, 2007 Posted September 10, 2007 Change that line you specified to GUICtrlSetData($ColorDisplay, "0x" & Hex($BurntOrange,6));<========= show color code in box That number your getting is an integer representation of the hex value... both same thing. www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding
Monamo Posted September 10, 2007 Posted September 10, 2007 Change that line you specified to GUICtrlSetData($ColorDisplay, "0x" & Hex($BurntOrange,6));<========= show color code in box - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]
chazzmani Posted September 10, 2007 Author Posted September 10, 2007 Change that line you specified to GUICtrlSetData($ColorDisplay, "0x" & Hex($BurntOrange,6));<========= show color code in box That number your getting is an integer representation of the hex value... both same thing. Perfect, that worked. Thank you
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