Android Code Snippet Get color parameters

sub : GetARGB
Author: Agraham, here http://www.b4x.com/android/forum/threads/bitmap-getpixel-color-format.29514/#post-171252
Description: Get the parameters of a color

B4X:
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


Tags: Getcolor, color, GetARGB
 
Top