gradient

CSS 3 gradients for styling SVG elements

五迷三道 提交于 2019-11-30 19:57:47
Is it possible to use CSS3 gradients for styling fill property? I know that SVG provides their own gradients. But the ideal solution for me would be: .button{ fill:#960000; fill: -webkit-gradient,linear,left bottom,left top, color-stop(0.45, #37304C),color-stop(0.73, #534D6B)); fill: -moz-linear-gradient(center bottom,#37304C 45%,#534D6B 73%); ... } When I tried to use SVG gradients, I got stucked when I tried to extract style attribute to external stylesheet. It seemed that fill:url(#linearGradientXYZ) didn't work as the gradient was defined in .svg file. No it's not yet possible to use CSS3

Gradient problems in Java

岁酱吖の 提交于 2019-11-30 17:38:40
In my program I wanted to have a translucent white to transparent gradient on my JFrame to overlay a yellow background. This works fine and it needs to be a white to transparent because of how my settings for the program work for the user. However, when I take the program into college (JRE7 to my JRE6) the gradient goes white to blackish then transparent... It isn't so bad until you start to increase the opacity of the white colour... is there anyway I can fix this? here is the relevant code from the top of my JFrame code. public class DictionaryGUI extends JFrame { protected JPanel

Android, Create gradient border?

断了今生、忘了曾经 提交于 2019-11-30 17:26:51
问题 I know it's frustrating after all similar posts at stackoverflow. I've surfed a lot of posts but i really couldn't solve my problem. So please help! I want to set a gradient border via xml like the image: How can i achieve this? 回答1: Customized as per your design, create a drawable file: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:top="8px"> <layer-list> <item> <shape android:shape="rectangle"> <solid android

Flutter - How to blend an image with a gradient colour?

馋奶兔 提交于 2019-11-30 16:47:35
问题 I am attempting to replicate a login screen design my designer did for an app. The background image uses a blendMode of softLight, the catch is that the colour it blends with is a gradient colour. Secondly there is actually two layers of different gradients (one purple gradient, one blue gradient) Original Image: Final Gradient Image Now I have tried using colorBlendMode, e.g. Image.asset( 'assets/pioneer-party.jpg', fit: BoxFit.cover, color: Color(0xff0d69ff).withOpacity(1.0), colorBlendMode

Draw transparent gradient with alpha transparency from 0 to 1

你。 提交于 2019-11-30 16:06:29
I have a dynamically generated bitmap in Android that I would like to feather from the top edge such that the border area would be fully transparent at the top and gradually change to fully opaque slightly below. Create an evenly fully-transparent top edge transparentPaint = new Paint(Paint.ANTI_ALIAS_FLAG); transparentPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OUT)); Shader shader = new LinearGradient(0, 0, 0, 20, Color.TRANSPARENT, Color.TRANSPARENT, Shader.TileMode.CLAMP); transparentPaint.setShader(shader); // the bitmap is dynamically generated beforehand Canvas c = new

How to apply multiple css radial gradients to a single element

陌路散爱 提交于 2019-11-30 15:50:59
I have the following style applied to my div element: background-image: -moz-radial-gradient(50% -10%, ellipse closest-corner, rgba(5, 5, 5, 0.7), rgba(0, 0, 0, 0) 100%); This has the desired effect (being an inner drop shadow only at the top of the div ). I would like to apply the same effect at the bottom of the div . The following line does it well, but it seems to override the first, so I can only get one or the other. background-image: -moz-radial-gradient(50% 110%, ellipse closest-corner, rgba(5, 5, 5, 0.7), rgba(0, 0, 0, 0) 100%); Can someone show me how I can have multiple radial

UILabel text color based on custom linear gradient

半世苍凉 提交于 2019-11-30 15:33:48
So I want to set the text color for a UILabel based on a gradient made in photoshop. I have the rgb values for the gradient, {211,119,95} and {199,86,56}. Is this possible? How can I do it? You might want to use one of these customizable labels: FXLabel LEffectLabel THLabel Another way if you want to target iOS 6+, with a category to UIColor You create a UIColor from a gradient: + (UIColor*) gradientFromColor:(UIColor*)c1 toColor:(UIColor*)c2 withHeight:(int)height { CGSize size = CGSizeMake(1, height); UIGraphicsBeginImageContextWithOptions(size, NO, 0); CGContextRef context =

How to make diagonal circle border gradient?

淺唱寂寞╮ 提交于 2019-11-30 15:13:35
问题 I have a problem with CSS3. I don't know how to make a diagonal round gradient border like that: I found something like this: .box { width: 250px; height: 250px; margin: auto; background: #eee; border: 20px solid transparent; -moz-border-image: -moz-linear-gradient(top left, #3acfd5 0%, #3a4ed5 100%); -webkit-border-image: -webkit-linear-gradient(top left, #3acfd5 0%, #3a4ed5 100%); border-image: linear-gradient(to bottom right, #3acfd5 0%, #3a4ed5 100%); border-image-slice: 1; } <div class=

SVG Adding radial gradient to donut chart

两盒软妹~` 提交于 2019-11-30 15:07:29
I'm drawing charts with d3.js. Is it possible to add radial gradients to donut chart, how on this picture? Erik Dahlström Assuming the arc parts are path elements that are filled you can use a radial gradient to get that result. See this similar question , we can reuse the example to arrive at: var dataset = { apples: [53245, 28479, 19697, 24037, 40245], }; var width = 460, height = 300, radius = Math.min(width, height) / 2; var color = d3.scale.category20(); var pie = d3.layout.pie() .sort(null); var arc = d3.svg.arc() .innerRadius(radius - 100) .outerRadius(radius - 50); var svg = d3.select(

How to make gradient border of an image using java?

巧了我就是萌 提交于 2019-11-30 15:06:32
How can I make an image border as gradient. I googled a lot, but didn't find correct suggestion. Any one can help me... Any suggestion please... This is an interesting one. I first thought that there should be a simple solution, using some Graphics#drawRoundRect call with the appropriate Paint , but it's not sooo simple. However, one solution is implemented in the following example: The image is painted as-it-is into a new image. Then the edges and corners are painted. These consist of rectangles. Each rectangle for one edge is filled with a GradientPaint that interpolates between "completely