gradient

Android Gradient on Lollipop not working. - API 21

我们两清 提交于 2019-11-27 03:30:15
问题 When I try to use Gradient on Lollipop, it doesnt work. While it works on all previous versions. Here is my example: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:type="radial" android:gradientRadius="500" android:startColor="#00417e" android:endColor="#001b34" /> 回答1: It is a bug. Check this here: https://code.google.com/p/android/issues/detail?id=77862 回答2: I had the same problem and created 2 different files: in drawables

Is there a -moz-mask CSS property, like -webkit-mask-image?

牧云@^-^@ 提交于 2019-11-27 03:16:19
问题 It seems -moz-mask-image is not supported in Firefox. I am attempting a foreground gradient. I can't use an image as i need the text to be selectable. Does anyone have any ideas for Firefox? This version works in chrome and safari css: -webkit-mask-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.16, rgba(0,0,0,0)), color-stop(0.52, rgba(0,0,0,.5)), color-stop(0.77, rgba(0,0,0,1))); -moz-mask: -moz-gradient(linear, left bottom, left top, color-stop(0.16, rgba(0,0,0,0)),

SVG angular gradient

断了今生、忘了曾经 提交于 2019-11-27 03:09:55
问题 Is there a way to do an 'angular gradient' in SVG? (I don't know the official term -- it's the kind of gradient you see in color-pickers, where it varies by angle.) SVG seems to support only linear and radial gradients, but I'm thinking there might be some way to use a transform to simulate what I want. thanks! 回答1: There's no standard support to do angular (conical) gradients. But see http://wiki.inkscape.org/wiki/index.php/Advanced_Gradients#Conical_gradient for some approximation methods

Blocky gradient effect in CSS3

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 02:15:59
Is it possible to make the below gradient look more "blocky", so that instead of switching from green to red gradually, it's done in steps like the below picture? Desired effect: Currently: #gradients { background-image: -webkit-gradient(linear, left bottom, right bottom, color-stop(0, #00FF00), color-stop(0.5, #FFFF00), color-stop(1, #FF0000)); background-image: -o-linear-gradient(right, #00FF00 0%, #FFFF00 50%, #FF0000 100%); background-image: -moz-linear-gradient(right, #00FF00 0%, #FFFF00 50%, #FF0000 100%); background-image: -webkit-linear-gradient(right, #00FF00 0%, #FFFF00 50%, #FF0000

SVG: why does external css override inline style for text?

只谈情不闲聊 提交于 2019-11-27 02:05:05
问题 I'm playing with using an SVG gradientFill as a way to visually 'truncate' long text strings in a d3.js chart. It seems that an external css style for fill will override the inline gradient fill style in the SVG... is that always the case? How can I enforce that gradient fill? In this test case I've defined a linear gradient in the svg defs, and then apply the gradient fill to two groups of text. http://jsfiddle.net/rolfsf/uX2kH/3/ var labelColWidth = 200; var svg = d3.select('#test').append(

CSS3 gradient rendering issues from transparent to white

喜欢而已 提交于 2019-11-27 02:03:06
问题 I am having issues with cross browser rendering of CSS3 gradients. This is happening when I am trying to create a gradient from transparent colour to white. The file I am using to test with is: http://f.cl.ly/items/0E2C062x3O161b09261i/test.html CSS used is: background-image: linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,1) 100%); background-image: -o-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,1) 100%);

Alpha-gradient on Android

你说的曾经没有我的故事 提交于 2019-11-27 01:35:52
问题 I need to create an alpha-gradient on the edge of the ImageView. Preferably using only XML. Image for example 回答1: Here the solution the image look like below picture code for that : Prepare shape drawable res/drawable/gradient_shape.xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#00FFFFFF" android:endColor="#FFFFFFFF" android:type="linear" /> </shape> Define layout: activity_main.xml: <ImageView

Drawing gradient over image in ios

佐手、 提交于 2019-11-27 01:24:54
问题 How to create gradient colour look like following image programatically. 回答1: When you say "apply it over the image as a gradient", do you mean as a mask (revealing the image at the top, having it fade the image to transparent at the bottom)? If that's the case, you can apply that gradient as a mask, using CAGradientLayer : CAGradientLayer *gradientMask = [CAGradientLayer layer]; gradientMask.frame = self.imageView.bounds; gradientMask.colors = @[(id)[UIColor whiteColor].CGColor, (id)[UIColor

Gradient along links in D3 Sankey diagram

六月ゝ 毕业季﹏ 提交于 2019-11-27 01:03:31
问题 Here is jsfiddle of a Sankey diagram : I am trying to modify colors of the links so that the color of each link is actually gradient from its source node color to its target node color. (it is assumed that opacity will remain 0.2 or 0.5 depending whether a mouse hovers or not over the link; so links will remain a little "paler" than nodes) I took a look at this nice and instructive example, which draws this gradient filled loop: However, I simply couldn't integrate that solution to mine, it

Transparent Background Image with a Gradient

牧云@^-^@ 提交于 2019-11-27 00:58:51
问题 Today I was designing a transparent PNG background that would only sit in the top left of a div, and the rest of the div would maintain a gradient background for all transparent areas of the PNG, and the rest of the div itself. It might be better to explain through the code I thought might work: #mydiv .isawesome { /* Basic color for old browsers, and a small image that sits in the top left corner of the div */ background: #B1B8BD url('../images/sidebar_angle.png') 0 0 no-repeat; /* The