I just downloaded this code and created a Custom Dialog colorpicker. Question is
what format is the int ColorResult ? and is there a way of getting the RGB information from this number ?
TIA.
B4X:
Sub btnSelectColor_Click
Dim cw As ColorWheelDialog
cw.Initialize
cw.ShowAsync(Me, "Select Color")
Wait For (cw) Color_Result(Success As Boolean)
If Success Then
Activity.Color = cw.ColorResult
End If
End Sub
No - it's an int value. If you want to get the ARGB, try this:
B4X:
Private Sub GetARGB(color as Int)
Private alpha As Int = Bit.UnsignedShiftRight(Bit.And(color, 0xff0000), 24)
Private red As Int = Bit.UnsignedShiftRight(Bit.And(color, 0xff0000), 16)
Private green As Int = Bit.UnsignedShiftRight(Bit.And(color, 0xff00), 8)
Private blue As Int = Bit.And(color, 0xff)
End Sub