Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linear Gradient from bottom to top

I need an Ellipse with a linear gradient from bottom(pink) to top(red).

<Ellipse Width="200" Height="200">    
    <Ellipse.Fill>

        <LinearGradientBrush StartPoint="0,1" EndPoint="1,0" > 

            <GradientStop Color="Pink" Offset="0" />

            <GradientStop Color="Red" Offset="1" />

        </LinearGradientBrush>

    </Ellipse.Fill>    
</Ellipse>

The above code shows a gradient from left bottom to top right.

I need the gradient to move from left middle to top middle.

I tried changing the starting and end point with no success. Is there another property that can be used?

It has to be a linear gradient on a ellipse. I cannot use a radial gradient here.

like image 480
Ranjith Venkatesh Avatar asked Apr 21 '16 11:04

Ranjith Venkatesh


People also ask

How do you make a linear gradient from top to bottom in CSS?

To create a linear gradient you must define at least two color stops. They are the colors the transitions are created among. It is declared on either the background or background-image properties. background: linear-gradient(direction, colour-stop1, colour-stop2, ...);

How do you do linear gradient transitions?

Linear gradient: It goes down/up/left/right/diagonally and makes smooth transitions of colors. To make a linear transition you first have to choose two color stops. Color stops are the color among which you want to make the transitions. You can also select a starting point and a direction(an angle) for the transition.

How does a linear gradient work?

Composition of a linear gradient Each point on the axis is a distinct color; to create a smooth gradient, the linear-gradient() function draws a series of colored lines perpendicular to the gradient line, each one matching the color of the point where it intersects the gradient line.

What are the three types of gradients?

There are five major types of gradients: Linear, Radial, Angle, Reflected and Diamond.


2 Answers

gradient from Bottom to Top (vertical)

<LinearGradientBrush StartPoint="0,1" EndPoint="0,0">

gradient from left middle to top middle

<LinearGradientBrush StartPoint="0,0.5" EndPoint="0.5,0">
like image 135
ASh Avatar answered Oct 26 '22 23:10

ASh


Visual representation of how it works

enter image description here

enter image description here

enter image description here

like image 39
Pavlo Datsiuk Avatar answered Oct 27 '22 01:10

Pavlo Datsiuk