title: How to add the gradient color in color . Xml
body: <p>I am using a library . In which I am showing the activity used by my library I am using a color to cover up the screen with color. it is looking cool. </p>
  
  <p>But due to some reasons I have decided to use gradient. I have developed the beautiful gradient effect as you can see below </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>    &lt;gradient
          android:angle="90"
          android:endColor="#555994"
          android:centerColor="#b5b6d2"
  
          android:startColor="#555994"
          android:type="linear" /&gt;
  
      &lt;corners
          android:radius="0dp"/&gt;
  
  &lt;/shape&gt;
  </code></pre>
  
  <p>it is looking good. But problem is I am using library which only accepts the color or color resource. I have no other method to alter , the library is showing the activity it self , I just need to pass the color that will appear on the activity. </p>
  
  <p>Now My question is :</p>
  
  <blockquote>
    <p>Can I define directly the gradient color in the color.xml file. Or is
    there any way to convert the gradient color file which is in draw able
    , can be pick as a color. so that , the library can apply my custom
    gradient color as a back ground</p>
  </blockquote>
  
  <p>please help me . It would be a grate help . </p>
  
  <p>Edit 1:</p>
  
  <p>For those guys who are saying me to add this as a background of the image or any thing else , let me share you a little part of that line so that you can understand the case more clearly </p>
  
  <pre><code>.withColorResource(R.color.indigo)
  </code></pre>
  
  <p><strong>Here I am referencing to the purple color defined in the Color.xml, I can set any thing as a background as library only gives me option of setting color as shown above. 
  So I have made a draw able of gradient color , Now I want that how to reference the gradient as a color.</strong>  </p>