Diese Funktion zeigt wie man HEX to RGB manuell berechnen kann.
Ansonsten bitte die _ColorGetRGB (EN) / _ColorGetRGB (DE) Funktion verwenden.
Func hex2rgb($clr)
$h = StringInStr($clr, "0x") ? $clr : (StringInStr($clr, "#") ? "0x" & StringMid($clr, 2) : "0x" & $clr)
Return BitShift(BitAnd($h, 0xff0000), 16) & "," & BitShift(BitAnd($h, 0xff00), & "," & BitAnd($h, 0xff)
EndFunc
MsgBox(0, "hex2rgb", hex2rgb("0x77c8d2") & @CRLF & hex2rgb("#77c8d2") & @CRLF & hex2rgb("77c8d2")) ; ==> 119,200,210
[/autoit]oder
[autoit]Func hex2rgb($clr)
$h = StringInStr($clr, "0x") ? $clr : (StringInStr($clr, "#") ? "0x" & StringMid($clr, 2) : "0x" & $clr)
Return BitAnd($h / 65536, 255) & "," & BitAnd($h / 256, 255) & "," & BitAnd($h, 255)
EndFunc
MsgBox(0, "hex2rgb", hex2rgb("0x77c8d2") & @CRLF & hex2rgb("#77c8d2") & @CRLF & hex2rgb("77c8d2")) ; ==> 119,200,210
[/autoit]Verwendet werden können: 0x?????? | #?????? | ??????
Beispielergebnis: