Questions tagged [radial-gradients]

A linear interpolation between two or more colors based on the distance from the center of a circle or ellipse. In radial gradients, the colors emerge from a single point and smoothly spread outward in a circular or elliptical shape unlike in linear gradients where it is from one end to another. Use this tag for any question pertaining to creation or usage of radial gradients.

Radial gradients are a linear interpolation between two or more colors based on the distance from the center of a circle or ellipse.

In radial gradients, the colors emerge from a single point and smoothly spread outward in a circular or elliptical shape unlike in linear gradients where it is from one end to another.

Radial Gradients in CSS

In CSS, a radial gradient can be created using the below syntax: (Source - W3C)

radial-gradient() = radial-gradient(
  [ [ circle               || <length> ]                          [ at <position> ]? , |
    [ ellipse              || [ <length> | <percentage> ]{2} ]    [ at <position> ]? , |
    [ [ circle | ellipse ] || <extent-keyword> ]                  [ at <position> ]? , |
    at <position> ,
  ]?
  <color-stop> [ , <color-stop> ]+
)
<extent-keyword> = closest-corner | closest-side | farthest-corner | farthest-side

Here is a sample rainbow generated using radial gradients:

.rainbow {
  height: 25vw;
  width: 50vw;
  background: -webkit-radial-gradient(50% 110%, ellipse, white 35%, violet 35%, violet 40%, indigo 40%, indigo 45%, blue 45%, blue 50%, green 50%, green 55%, yellow 55%, yellow 60%, orange 60%, orange 65%, red 65%, red 70%, white 70%);
  background: -moz-radial-gradient(50% 110%, ellipse, white 35%, violet 35%, violet 40%, indigo 40%, indigo 45%, blue 45%, blue 50%, green 50%, green 55%, yellow 55%, yellow 60%, orange 60%, orange 65%, red 65%, red 70%, white 70%);
  background: radial-gradient(ellipse at 50% 110%, white 35%, violet 35%, violet 40%, indigo 40%, indigo 45%, blue 45%, blue 50%, green 50%, green 55%, yellow 55%, yellow 60%, orange 60%, orange 65%, red 65%, red 70%, white 70%);
}

enter image description here

Useful Links/References:

353 questions
0
votes
1 answer

Applying an SVG Radial Gradient Mask to Multiple Items

I have a number of differently colored and sized svg circles that I would like to apply a radial gradient mask to. Is there a way to define a single mask that is applied to each circle by stretching it to match that circle's size? Here is what I've…
Brian
  • 563
  • 1
  • 5
  • 15
0
votes
1 answer

solution for ugly font in IE

I'm using background-image: -ms-radial-gradient(left top, circle cover, #dbd7fa 0%, #f7f6fe 56.12%); filter: progid:DXImageTransform.Microsoft.Gradient(startColorstr='#dbd7fa', endColorstr='#f7f6fe',GradientType=0); to make a radial background in…
Someone33
  • 568
  • 2
  • 8
  • 25
0
votes
1 answer

set line width to radial gradient

I am using radial gradient to draw circle. It is working fine but now I want to set border color and border width to that. I tried it but it was not working. Here is my code, CGGradientRef gradient; CGColorSpaceRef colorSpace; CGFloat locations[] =…
h999
  • 395
  • 1
  • 5
  • 21
0
votes
1 answer

radial-gradient not working in firefox

This does not work in Firefox 22: background-image: -moz-radial-gradient(48% -42%, 138px 138px, green 0%, lightblue 100%); But it works in Chrome: background-image: -webkit-radial-gradient(48% -42%, 138px 138px, green 0%, lightblue 100%); It's the…
Cotten
  • 8,787
  • 17
  • 61
  • 98
0
votes
1 answer

Visual Feedback for custom button in WPF

I have a custom button in my main window that I would like to have the ability to provide some visual feedback to the user when it is clicked, and when the mouse hovers over it. I use the RadialGrandientBrush to color my button. I would like to…
Eric after dark
  • 1,768
  • 4
  • 31
  • 79
0
votes
2 answers

I wonder if angle gradient is possible

I´m doing some testing on gradients using NSBezierPath and make some progress so far with radial gradients. see first picture. I wonder, however, if it is possible to make angle gradients as in picture 2. Anyone done this? Tia, Ronald
Ronald Hofmann
  • 1,390
  • 2
  • 15
  • 26
0
votes
1 answer
0
votes
2 answers

CSS3 Firefox radial gradient disappears

I've got an HTML5 page with the background of: background: -moz-radial-gradient(center, ellipse cover, #868c93 0%, #28343b 100%); This works fine, until the page gets long (15000px or so), at which point the background disappears entirely on…
lars
  • 99
  • 1
  • 14
0
votes
2 answers

WPF drawing using a RadialGradientBrush type effect?

Using a RadialGradientBrush is simple and allows a center colour to merge into an outer colour. This works fine as a brush for filling the inside of a Rectangle or Border. I want to achieve the effect of applying that brush as if it were a pen and…
Phil Wright
  • 22,580
  • 14
  • 83
  • 137
0
votes
1 answer

RGraph gradient applied to the single circle

I am using the RGraph and I need to create circles with a gradients, so they look to be 3D spheres. I have created a new node type called blob and I have implemented the code as follows. However, the gradient is applied to the entire canvas. Not…
igasparetto
  • 1,086
  • 1
  • 12
  • 28
-1
votes
1 answer

Change a button background to a different color by animating a radial gradient

I have a button that, when I select it, I want to add an animated class with a circle that increases in size until the entire background takes on the secondary color. The only problem is that the animation isn't working well, it's crashing. Does…
-1
votes
1 answer

How to create a circle radial gradient with custom size and position in CSS

I'm currently trying to recreate a rock paper scissors game using HTML CSS & JS Everything is going well, except the design of the buttons. I have no idea how to create a radial gradient like the one below. Any help is appreciated
Ahmad2001
  • 79
  • 6
-1
votes
1 answer

How to do radial line gradient around an image and set the % of it? CSS or SVG or anything can solve the problem

I need to develop the next style: The gradient around the image has diferents colors and can be uncompleted. How can I do that and set the % of it? For people that ask for code: body { height: 100vh; margin: 0; display: grid; place-items:…
-1
votes
3 answers

How can I make this shape with background gradients?

I want to create this shape with only background. Or may clip-path & pseudo-element. I tried so far with ::before div { height: 300px; width: 400px; background: tomato; border-radius: 0 0 5px 0; position: relative; } div::before…
doğukan
  • 23,073
  • 13
  • 57
  • 69
-1
votes
1 answer

Saving a radial gradient for web (photoshop)

I have a .psd document that consists of a radial background that I'd like to use for the web (the starting and end colors are 2 shades of gray). I tried saving this background for the web in different formats: gif, jpg (100% quality) and png.…
user2472523
  • 113
  • 1
  • 2
  • 6
1 2 3
23
24