How to fill color in the inside transparent portion of vector drawable without filling color in the outside rectangualar bounds of it?

30 views Asked by At

enter image description here

In the above vector drawable, I can modify the tint of the solid portions of the drawable using say green color and apply it using PorterDuff.Mode.SRC_ATOP. But I can't seem to apply a color inside the drawable like in the drawable's eyes. If I try different modes I can just see the color apply across the entire rectangle bounds of the drawable. Is there a simple trick I'm missing here?

Also I can't have the target eye color in background because in my case there is another drawable in the background and if I had to apply red color to the eyes, then I've trace out the outline of the drawable and make that entire thing as solid red and put this drawable on top of it. I'm not sure how to create a drawable with just the outline as well, It seems there is only an option that comes with rectangular bounds and nothing like to follow along the outline of the drawable image.

I do not want to create another vector drawable and hoping I can do something programmatically to get the job done. Any ideas?

0

There are 0 answers