Play gradient of the image

Asked

Viewed 203 times

2

How can I generate a gradient as in this image?

As she has more of a tone of the same color, I’m not able to leave equal.

.box {
  background-image: linear-gradient( to right, #ff7a2d, #ff507b ); 
  width: 100%;
  height: 300px;
  -webkit-transform: skewY(-1.5deg);
  -moz-transform: skewY(-1.5deg);
  -ms-transform: skewY(-1.5deg);
  -o-transform: skewY(-1.5deg);
  transform: skewY(-1.5deg);
}
<div class="box">
      <div class="wrapper">
      </div>
 </div>

inserir a descrição da imagem aqui

  • Young I edited my reply response according to your comment, with a saturation in colors using mix-Bland-mode, then look there

1 answer

2


Young woman changing the linear-gradiente for radia-gradiente I was able to achieve a result very close to the image. I also used 4 colors and not 2, starting from the top of the box on the right.

The CSS of the gradient looks like this:

background-image: radial-gradient(circle at top right, #ff9bb4, #ff507b, #ff7a2d, #f55a00 );

See the result:

.box {
  margin-top: 100px;
  background-image: radial-gradient(circle at top right, #ff9bb4, #ff507b, #ff7a2d, #f55a00 );
  width: 100%;
  height: 300px;
  -webkit-transform: skewY(-1.5deg);
  -moz-transform: skewY(-1.5deg);
  -ms-transform: skewY(-1.5deg);
  -o-transform: skewY(-1.5deg);
  transform: skewY(-1.5deg);
}
<div class="box">
    <div class="wrapper">
    </div>
</div>

OBS: The wider the BOX but tenuous will be the degrade and transition of colors, the narrower the BOX, but noticeable will be the transition between one color and another.


EDIT: Variation with Two Gradients, one linear and another radial, one over the other with mix-blend-mode: overlay;.

According to your comment in my reply is the mix-blend-mode: overlay; that will give the tone "saturated" both at the top of the gradient and at the bottom. But to do this I needed to create another element above the gradient, because to use the bland-mode I needed to separate the backgrounds, you couldn’t use both in one element.

See how it looked in the Snippet below

.bgc {
    position: relative;
  background-image: radial-gradient(circle at top right, #ff9bb4, #ff507b, #ff7a2d, #f55a00 ) ;
  width: 100%;
  height: 300px;
  -webkit-transform: skewY(-1.5deg);
  -moz-transform: skewY(-1.5deg);
  -ms-transform: skewY(-1.5deg);
  -o-transform: skewY(-1.5deg);
  transform: skewY(-1.5deg);
}
.filtro {
    width: 100%;
    height: 300px;
    background-image: linear-gradient(rgba(255,255,255,0.2), rgba(255,255,255,0), rgba(0,0,0,0),rgba(0,0,0,0.4));
    background-size: cover;
    position: absolute;
    top: 0;
    right: 0;
    mix-blend-mode: overlay;
}
<div class="bgc">
    <div class="filtro"></div>
</div>

You can work the transparencies of the linear-gradiente, until you reach the has that you think ideal.

  • Is it possible to pass more colors as a parameter? Why at the bottom has a darker shade of colors.

  • Yes it is possible, look at the second part of the answer, in the edition I made.

  • The problem is that decreasing the transparency leaves a darker tone and not a stronger shade of the respective color. That is, an orange almost red and a pink stronger.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.