0

I am creating an app in which user chooses two colors and the result of the two colors would be displayed in another box. No how can i do that ?

Do i need to add hex code of both the colors or what ?

  • related question was posted already. please [check link](http://stackoverflow.com/questions/11312680/how-to-set-combined-color-for-overlapped-area-of-two-different-color-objects). hope this helps – CRUSADER May 10 '13 at 10:27
  • No it didn't help, i have 9 buttons on the screen with different colors and now user clicks on any two then they are highlighted and there combination comes in the other button ( Result Button) . It id diffrent from overlapping .Any other solution would surely help. – user2314344 May 10 '13 at 10:39

1 Answers1

0

Two ways to do it.

Assuming your choice of colors does not include alpha, just create two separate views that overlap each other (good visuals if they just overlap on an area but don't entirely cover each other - just to distinguish between the two). Set each view to the chosen color with an alpha of 50%. These views will blend and you will get your desired output.

If you want to "mix colors" to produce another "useable" value, the easiest computation is to just "average" each of the RGB values. That, or find a color mixing algorithm somewhere.

josephus
  • 8,284
  • 1
  • 37
  • 57