radial-gradients

Gradient colors from d3.scale.category10() with opacity change on a svg circle?

坚强是说给别人听的谎言 提交于 2019-12-08 08:43:01
问题 I am trying to apply the colors from the color = d3.scale.category10(); var to the gradient for the circle svg, what am I doing wrong? All I am seeing is the first color of the color = d3.scale.category10(); (which is blue) to 0% opacity gradient but that is all. If I take the gradient out then I see the range I want which is from 1-4? Thanks in advance! var nodes = d3.range(300).map(function() { return {radius: Math.random() * 12 + 4}; }), root = nodes[0], color = d3.scale.category10(); root

RadialGradientBrush on Rounded-Corner Rectangle

你。 提交于 2019-12-08 00:23:08
问题 I have a Rectangle with rounded corners (but not an ellipse), something like this: <Rectangle Stroke="Black" StrokeThickness="2" RadiusX="50" RadiusY="100"> <Rectangle.Fill> <RadialGradientBrush RadiusY="0.5"> <GradientStop Color="Black" Offset="1" /> <GradientStop Color="White" Offset="0.8" /> </RadialGradientBrush> </Rectangle.Fill> </Rectangle> I want to use a gradient fill from black to white. How can I specify this in order to make the fill keep the shape of the rounded rectangle,

animate radial-gradient CSS3 : move from left to right?

試著忘記壹切 提交于 2019-12-07 13:13:30
问题 I want animate a background with a radial-gradient radial-gradient(circle, rgba(255,255,255,0.8) 0, rgba(255,255,255,0) 100%) , to move it from left to right http://jsfiddle.net/odsb1fjh/2/ how can I do to animate this radial-gradient to move infinite on div from left to right? I have already try animation and keyframe background-position: left/right bottom; but don't works. 回答1: "but we can see the border of "square" where is the light radial" - Why use radial background at all, simply use:

CABasicAnimation creates empty default value copy of CALayer

穿精又带淫゛_ 提交于 2019-12-07 00:06:28
I have a custom CALayer that draws radial gradients. It works great except during animation. It seems that each iteration of CABasicAnimation creates a new copy of the CALayer subclass with empty, default values for the properties: In the screenshot above, you see that CABasicAnimation has created a new copy of the layer and is updating gradientOrigin but none of the other properties have come along for the ride. This has the result of not rendering anything during the animation. Here's a GIF: Here's what is should look like: Here's the animation code: let animation = CABasicAnimation(keyPath:

RadialGradientBrush on Rounded-Corner Rectangle

白昼怎懂夜的黑 提交于 2019-12-06 08:32:29
I have a Rectangle with rounded corners (but not an ellipse), something like this: <Rectangle Stroke="Black" StrokeThickness="2" RadiusX="50" RadiusY="100"> <Rectangle.Fill> <RadialGradientBrush RadiusY="0.5"> <GradientStop Color="Black" Offset="1" /> <GradientStop Color="White" Offset="0.8" /> </RadialGradientBrush> </Rectangle.Fill> </Rectangle> I want to use a gradient fill from black to white. How can I specify this in order to make the fill keep the shape of the rounded rectangle, instead of being an ellipse? For a rounded rectangle you can do it all in XAML using radial gradients for the

animate radial-gradient CSS3 : move from left to right?

廉价感情. 提交于 2019-12-06 01:28:08
I want animate a background with a radial-gradient radial-gradient(circle, rgba(255,255,255,0.8) 0, rgba(255,255,255,0) 100%) , to move it from left to right http://jsfiddle.net/odsb1fjh/2/ how can I do to animate this radial-gradient to move infinite on div from left to right? I have already try animation and keyframe background-position: left/right bottom; but don't works. "but we can see the border of "square" where is the light radial" - Why use radial background at all, simply use: div div { position: absolute; width: 250px; height: 250px; background-color: black; background-image: url

createRadialGradient and transparency

喜欢而已 提交于 2019-12-05 07:06:38
I'm playing around with createRadialGradient() on HTML5 canvas. It works like a charm, except when I'm trying to implement (semi-)transparency. I made this jsFiddle to make things hopefully clearer: http://jsfiddle.net/rfLf6/1/ . function circle(x, y, r, c) { ctx.beginPath(); var rad = ctx.createRadialGradient(x, y, 1, x, y, r); rad.addColorStop(0, c); rad.addColorStop(1, 'transparent'); ctx.fillStyle = rad; ctx.arc(x, y, r, 0, Math.PI*2, false); ctx.fill(); } ctx.fillRect(0, 0, 256, 256); circle(128, 128, 200, 'red'); circle(64, 64, 30, 'green'); What is happening is a circle (radial gradient

Is there a way to draw a CGContextDrawRadialGradient as an oval instead of a perfect circle?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 11:51:48
问题 I need a radial gradient in the shape of an oval or ellipse and it seems like it CGContextDrawRadialGradient can only draw a perfect circle. I've been drawing to a square context then copying/drawing into a rectangular context. Any better way to do this? Thanks! 回答1: The only way I've found to do this is as Mark F suggested, but I think the answer needs an example to be easier to understand. Draw an elliptical gradient in a view in iOS (and using ARC): - (void)drawRect:(CGRect)rect {

how to make a css gradient stop after so many pixels?

可紊 提交于 2019-12-03 11:19:08
问题 -moz-radial-gradient(center -200px , ellipse farthest-corner, #323C49 0%, #718299 65%) no-repeat scroll 0 0 transparent; I have this code above and i just realized that this gradient goes from top to bottom. Is there any way to make it stop the whole gradient after 30px. I can make adjustments as necessary, but how do you get the gradients to complete itself after 30px? 回答1: You can use the background-size property together. like this: div { height:100px; background:-moz-radial-gradient

android create pie dount with gradient

血红的双手。 提交于 2019-12-03 00:42:11
Is there any way to create circle with gradient like this ? As far as i get is this: <shape android:innerRadiusRatio="3" android:thicknessRatio="10" android:shape="ring"> <gradient android:endColor="@color/cyan_dark" android:startColor="@color/red" android:type="radial" android:gradientRadius="340" android:centerX="50%" android:centerY="0" /> </shape> XML <ProgressBar android:id="@+id/yourId" style="?android:attr/progressBarStyleHorizontal" android:layout_width="89dp" android:layout_height="89dp" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:max="100"