### RGBA Color from 32bit Hex

Solution to get the RGBA color from a 32bit Hex string.
If fx.Colors.COLOR is stored in a hex string, the build is RRGGBBAA.
Examples:
Dim hex As String = "0x0000ffff" which is fx.Colors.blue
Dim hex As String = "0xffff00ff" which is fx.Colors.yellow
'Get a RGBA Hex String as Color.
'Parameter: Hex String 8 chars length RRGGBBAA; 0x and # are removed.
'Returns Color as Paint
'Example fill the color of a Rectangle (As Node)
'Dim joRect As JavaObject = rect
'Dim hex As String = fx.Colors.blue '0x0000ffff, fx.Colors.yellow '0xffff00ff
'Dim colorPaint As Paint = GetColorFromRGBA(hex)
'joRect.RunMethod("setFill", Array(colorPaint))
`Sub GetColorFromRGBA(hex As String) As Paint
Dim a, r,g,b As Int
hex = hex.Replace("0x", "").Replace("#", "")
a = Bit.ParseInt(hex.SubString2(6,8), 16)
r = Bit.ParseInt(hex.SubString2(0,2), 16)
g = Bit.ParseInt(hex.SubString2(2,4), 16)
b = Bit.ParseInt(hex.SubString2(4,6), 16)
Return fx.Colors.ARGB(a, r, g, b)
End Sub`

Changed: , Category: Colors, File: T6C174M1262.htm, ID: 1262