Sub getARGB(Color As Int) As Int()
Dim res(4) As Int
res(0) = Bit.UnsignedShiftRight(Bit.AND(Color, 0xff000000), 24)
res(1) = Bit.UnsignedShiftRight(Bit.AND(Color, 0xff0000), 16)
res(2) = Bit.UnsignedShiftRight(Bit.AND(Color, 0xff00), 8)
res(3) = Bit.AND(Color, 0xff)
Return res
End Sub
Sub GetColor(hex As String) As Double
Dim bc As ByteConverter
Dim r,g,b As Int
' #E3E2E1
'Log(hex.SubString2(1,3))
r = Bit.ParseInt(hex.SubString2(1,3), 16)
g = Bit.ParseInt(hex.SubString2(3,5), 16)
b = Bit.ParseInt(hex.SubString2(5,7), 16)
Return Colors.RGB(r, g, b)
End Sub
Sub Activity_Create(FirstTime As Boolean)
Log(GetColor("#E3E2E1"))
Log(Colors.RGB(227, 226, 225))
Sub Get_IntColor(HexColor As String) As Int
Dim res As Int
If HexColor.StartsWith("#") Then
res = Bit.ParseInt(HexColor.Replace("#", ""), 16)
res = Bit.Or(res, 0xFF000000) 'alfa
Else
res = 0
End If
Return res
End Sub