Sign in to follow this  
Followers 0
buzz44

_ChooseColor()

2 posts in this topic

The optional parametre, $i_colorref, in the ChooseColor() function is passed as BGR when it should be RGB, correct? See below

#include <Misc.au3>

$color = _ChooseColor (2, 0xFF0000); << Red
If (@error) Then
   MsgBox(0, "", "Error _ChooseColor: " & @error)
Else
   MsgBox(0,"_ChooseColor","Hex RGB Color: " & $color)
EndIf

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

that's a hex number not a colorref, red would be 255, example of yellow would be 65535

Edit: one way to get your colorref from a rgb hex is to reverse the r and b in the hex 0xFF0000 becomes 0x0000FF then turn it into a ref by Int(0x0000FF) which will give you 255.

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0