Hello, How can I add an Alpha parameter to the function below and receive the return value as ARGB?
B4X:
Public Sub HexToColor(Hex As String) As Int
Dim bc As ByteConverter
If Hex.StartsWith("#") Then
Hex = Hex.SubString(1)
Else If Hex.StartsWith("0x") Then
Hex = Hex.SubString(2)
End If
If Hex.Length = 6 Then
Hex = "FF" & Hex
End If
Dim ints() As Int = bc.IntsFromBytes(bc.HexToBytes(Hex))
Return ints(0)
End Sub
Hello, How can I add an Alpha parameter to the function below and receive the return value as ARGB?
B4X:
Public Sub HexToColor(Hex As String) As Int
Dim bc As ByteConverter
If Hex.StartsWith("#") Then
Hex = Hex.SubString(1)
Else If Hex.StartsWith("0x") Then
Hex = Hex.SubString(2)
End If
If Hex.Length = 6 Then
Hex = "FF" & Hex
End If
Dim ints() As Int = bc.IntsFromBytes(bc.HexToBytes(Hex))
Return ints(0)
End Sub
You are correct. I'm sure I've previously used 4-byte Ints to represent colors, but maybe that was in B4A.
<JOKE>
Hang on, if none of them didn't work, does that mean that the rest of them (ie all) did work? (not that it matters now that I've deleted the posts)
</JOKE>