binaryBigInt
binaryBigInt

Reputation: 1704

Color Addition in Android

How is color addition done in android? For my pathtracer i am storing a Color but i didn't find a way to get the r,g,b values back.

I think if i want to get red i do this:

returnColor.red(0)

but it doesn't work.

Since i work more with android in the last week i do more and more think why stuff is made so complicated in android? In C# you just add the r,g,b values and you don't get an integer back if you type

Color.White

Upvotes: 0

Views: 104

Answers (1)

Blackbelt
Blackbelt

Reputation: 157457

you can use the static method red of the Color class:

int red = Color.red(color)

The same class has the argb method that allows you to get the int representing your color, through the 4 components. E.g.

int color = Color.argb(255, 255, 255, 255);

Here you can find the documentation

Upvotes: 1

Related Questions