#2823 closed Bug (Completed)
_ChooseFont default color
Reported by: | careca777 | Owned by: | Melba23 |
---|---|---|---|
Milestone: | 3.3.13.15 | Component: | AutoIt |
Version: | 3.3.12.0 | Severity: | None |
Keywords: | Cc: |
Description
It says the default color is in RGB format, but it's BGR Color.
Following example shows this, select marron color, RGB 0x800000,
This RGB result is used in the next _ChooseFont which should open with the same color, but doesn't, it opens with navy blue, which is RGB 0x000080 OR BGR 0x800000!
All there is to do is change in the help file parameter:
"$iColorRef [optional] COLORREF rgbColors" to BRG colors, or fix the parameter to accept RGB.
#include <Misc.au3> #include <MsgBoxConstants.au3> Local $a_font = _ChooseFont("Arial", 8) MsgBox($MB_SYSTEMMODAL, "", "Hex BGR Color: " & $a_font[6] & @CRLF & "Hex RGB Color: " & $a_font[7]) $ChosenColor = $a_font[7] Local $a_font = _ChooseFont("Arial", 8, $ChosenColor)
Attachments (0)
Change History (4)
comment:1 Changed 10 years ago by Melba23
- Milestone set to 3.3.13.15
- Owner set to Melba23
- Resolution set to Fixed
- Status changed from new to closed
comment:2 Changed 10 years ago by Melba23
The UDF function has been modified to convert the $iColorRef parameter from RGB to BGR so the Help file is now correct.
M23
comment:3 Changed 10 years ago by Melba23
- Resolution changed from Fixed to Completed
Added by revision [10613] in version: 3.3.13.15
comment:4 Changed 9 years ago by BrunoJ
The fix applied did work for the input, but that was not the whole problem. The help states that element 5 of the return array is "COLORREF rgbColors". The value returned is actually BRG. Here is a suggested new line shown below in it's placement just before the last line:
$iColorRef = BitOR(BitShift(BitAND($iColorRef, 0x000000FF), -16), BitAND($iColorRef, 0x0000FF00), BitShift(BitAND($iColorRef, 0x00FF0000), 16)) Return StringSplit($iAttributes & "," & $sFaceName & "," & $iSize & "," & $iWeight & "," & $iColorRef & "," & '0x' & $sColor_picked & "," & '0x' & StringMid($sColor_picked, 5, 2) & StringMid($sColor_picked, 3, 2) & StringMid($sColor_picked, 1, 2), ",")
Also, the tag structure should be changed to reflect "bgrColors" instead of "rgbColors". Of course, this change will not affect operation. However, it will help avoid confusion when reading the code.
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
Fixed by revision [10606] in version: 3.3.13.15