0

I'm have the next task:

From the server, I get a hex value of one color. Then I need to make a picture using this value. To do this, need to use the rule for building a gradient. There are two layers. The first layer has a background color in this hex, but it must also be in blend-mode: overlay. A layer with a gradient of three colors is superimposed on top of it. Start Color - hex with opacity 0%, Center Color - # 000000 with opacity 80%, End Color - hex with opacity 100%.

I don't know how this can be done.

enter image description here

EDIT: I need to do by analogy with the code from web:

div {
    width: 300px;
    height: 300px;
    background: #ffd700;
    position: absolute;
    mix-blend-mode: overlay;
    z-index: 1;
    
}
#div2 {
  z-index: 2;
  background: linear-gradient(297deg, #ffd700 0%, rgba(0,0,0,.7) 80%, #ffd700 100%);
}
Anton Pankratov
  • 121
  • 1
  • 4
  • Does this answer your question? [ https://stackoverflow.com/questions/6115715/how-do-i-programmatically-set-the-background-color-gradient-on-a-custom-title-ba ] In this answer it is not applied for ImageView, but you can still build the GradientDrawable and apply to your view. – Rajasekhar Sep 18 '20 at 11:07
  • @Rajasekhar, Thsnks, but is not work for me. I'm edit my question, please show on it – Anton Pankratov Sep 18 '20 at 11:35

0 Answers0