Search code examples
javaandroidkotlinbitmask

How can I find the color color created with bitmask?


how can I find the color created with bitmask? For example, what is the color equivalent of this expression?

color = -16777216 

Solution

  • You can easily do this with Integer.toHexString.

    val bitmaskColor = -16777216
    Log.e("HEX",Integer.toHexString(bitmaskColor)) // ff000000