0

I wand to Theme a app in the same Color like my CM Theme and the App only allow to use a color picker,after looking in the shard preference of the app i found something. That's the Story but not the question.

This is what i found:

<int name="color_main_window" value="-13162859" />

My question is how i can generate this int from rgb/hex and the absolutely needed way from rgb/hex to int ?

1 Answers1

0

An int is a 32-bit signed integer. So, -13161859 = 0xFF372695. A color will be represented as an ARGB int, so

a = FF
r = 37
g = 26
b = 95

The Color class has utility methods that can convert int to rgb or argb and vice versa.

tachyonflux
  • 20,103
  • 7
  • 48
  • 67