﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1399	_ColorSetRGB() is returning wrong color value	Beege	Jpm	"The documentation of function _ColorSetRGB() states that the parameters of the function should be an array of values in the range 0-255 in the order of [RED,GREEN,BLUE], but in the following example, ""[255,0,0]"" will return blue instead of red and vice versa for [0,0,255].
|
{{{
#Include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <Color.au3>

Global $GUI = GUICreate(""Form1"", 405, 333)
Global $R_Edit = _GUICtrlRichEdit_Create($GUI, """" & @CRLF, 32,  8, 345, 225,$ES_MULTILINE)
GUISetState(@SW_SHOW)
;                   R , G, B
Global $aRed[3] = [255, 0, 0]
Global $aBlue[3] = [0, 0, 255]

_RichEdit_Color_Append($R_Edit,'RED RED RED',  _ColorSetRGB($aRed))
_RichEdit_Color_Append($R_Edit,'BLUE BLUE BLUE', _ColorSetRGB($aBlue))

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			_GUICtrlRichEdit_Destroy($R_Edit)
			Exit
	EndSwitch
WEnd

Func _RichEdit_Color_Append($hRichEdit, $sMsg, $COLORREF)
	_GUICtrlRichEdit_AppendText($hRichEdit, @CRLF & $sMsg)
	_GUICtrlRichEdit_SetSel($hRichEdit, _GUICtrlRichEdit_GetFirstCharPosOnLine($hRichEdit), -1, True)
	_GUICtrlRichEdit_SetCharColor($hRichEdit, $COLORREF)
EndFunc   ;==>_RichEdit_Append
}}}
-AutoIt:3.3.2.0   (Os:WIN_7/X86   Language:0409 Keyboard:00000409 Cpu:X64)
|
Fixes could be to reverse the order of the FOR-LOOP in the function or change the documentation to [BLUE,GREEN,RED].

"	Bug	closed	3.3.7.0	Standard UDFs	3.3.2.0	None	Fixed	_ColorSetRGB	
