Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Gradient Fill Colors #25

Open
pjacobs opened this issue Oct 23, 2019 · 0 comments
Open

Support for Gradient Fill Colors #25

pjacobs opened this issue Oct 23, 2019 · 0 comments

Comments

@pjacobs
Copy link

pjacobs commented Oct 23, 2019

I have the following Vector Drawable..

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:aapt="http://schemas.android.com/aapt"
    android:width="78dp"
    android:height="120dp"
    android:viewportWidth="78"
    android:viewportHeight="120">
  <path
      android:pathData="M8,111a31,9 0,1 0,62 0a31,9 0,1 0,-62 0z"
      android:fillColor="#000"
      android:fillAlpha=".08"
      android:fillType="evenOdd"/>
  <path
      android:name="fillColorPath"
      android:pathData="M39,109c24.667,-33.044 37,-56.377 37,-70C76,18.565 59.435,2 39,2S2,18.565 2,39c0,13.623 12.333,36.956 37,70zM39,54c7.732,0 14,-6.268 14,-14s-6.268,-14 -14,-14 -14,6.268 -14,14 6.268,14 14,14z"
      android:strokeLineJoin="round"
      android:strokeWidth="4"
      android:strokeColor="#FF50BEFF"
      android:fillType="evenOdd">
    <aapt:attr name="android:fillColor">
      <gradient 
          android:startY="39.25312"
          android:startX="39"
          android:endY="40.31242"
          android:endX="39"
          android:type="linear">
        <item android:offset="0" android:color="#FF50BEFF"/>
        <item android:offset="1" android:color="#FF4BAFFF"/>
      </gradient>
    </aapt:attr>
  </path>
</vector>

Unfortunately, since the fillColor is set to a gradient in the fillColorPath path, PathModel.getFillColor returns 0, which is incorrect. I'm gathering this is not supported?

@pjacobs pjacobs changed the title Support for gradient fill Colors Support for Gradient Fill Colors Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant