Dim myString As String
myString = intToExString(-16777216)
Log(myString)
private Sub intToExString(i As Int) As String
Dim hexstr As String
hexstr = Bit.ToHexString(i)
Return hexstr
End Sub
Dim myString As String
myString = intToExString(-16777216)
Log(myString)
private Sub intToExString(i As Int) As String
Dim hexstr As String
hexstr = Bit.ToHexString(i)
Return hexstr
End Sub
I tried and tried a similar code as well and with both, the color does not come out right. I have added "#" or "0x" to the bigging and the color does not come out right.
Public Sub IntColorToCssRGBA(color As Int) As String
Dim BC As ByteConverter
Dim ARGB() As Byte = BC.IntsToBytes(Array As Int(color))
Dim Alpha As Double = (Bit.And(ARGB(0),0XFF) / 255)
Return $"rgba(${Bit.And(ARGB(1),0XFF)},${Bit.And(ARGB(2),0XFF)},${Bit.And(ARGB(3),0xFF)},${NumberFormat2(Alpha,1,2,2,False)})"$
End Sub
Out of curiosity, why can't you change it directly on the Label?
Public Sub IntColorToCssRGBA(color As Int) As String
Dim BC As ByteConverter
Dim ARGB() As Byte = BC.IntsToBytes(Array As Int(color))
Dim Alpha As Double = (Bit.And(ARGB(0),0XFF) / 255)
Return $"rgba(${Bit.And(ARGB(1),0XFF)},${Bit.And(ARGB(2),0XFF)},${Bit.And(ARGB(3),0xFF)},${NumberFormat2(Alpha,1,2,2,False)})"$
End Sub
Out of curiosity, why can't you change it directly on the Label?