gradient

Get element CSS3 background-color gradient with JS

旧时模样 提交于 2019-12-19 08:29:18
问题 At the moment I use the following JS (jQuery) to find the background color (as rgb) of several other divs: $theColor = $(this).css("background-color"); It works perfectly, except with CSS3 gradients. As an example, I have the following css to make the background of a div look similar to a post-it note: background: #FFFAAD; /* old browsers */ background: -moz-linear-gradient(top, #FFFAAD 0%, #FFF47D 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,

Is it possible to set horizontal gradient to text via CSS? (left letter one colour, right - another colour) [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-12-19 04:04:28
问题 This question already has answers here : css text gradient (4 answers) Closed 3 years ago . Is it possible to set horizontal gradient to text via CSS? (left letter one colour, right - another colour). 回答1: Yes, it is. h1 { font-size: 72px; background: -webkit-linear-gradient(left, red , yellow); background: -o-linear-gradient(right, red, yellow); background: -moz-linear-gradient(right, red, yellow); background: linear-gradient(to right, red , yellow); -webkit-background-clip: text; -webkit

Android drawable with background and gradient on the left

雨燕双飞 提交于 2019-12-19 03:18:10
问题 W would like to have a drawable which has background and gradient on the left that is about 10dp wide. Image of what I would like to achieve: Red gradient on the left Background on the rest How I can achieve that? I've tried layer-list with two shapes but with no luck. Item background: <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/background" /> <item android:drawable="@drawable/gradient" /> </layer-list> Background drawable: <shape

Gradient problems in Java

南笙酒味 提交于 2019-12-18 19:13:11
问题 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

How to apply multiple css radial gradients to a single element

一个人想着一个人 提交于 2019-12-18 17:31:14
问题 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

SVG Adding radial gradient to donut chart

北城余情 提交于 2019-12-18 16:57:37
问题 I'm drawing charts with d3.js. Is it possible to add radial gradients to donut chart, how on this picture? 回答1: 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

Fastest way to calculate colors for a gradient?

ぃ、小莉子 提交于 2019-12-18 15:49:43
问题 I'm making a small collection of types/functions related to gradients for future use. I would like to make sure there's at least two procedures: ColorBetween and ColorsBetween. I may want to just get an array of TColor between any 2 colors (ColorsBetween), and I may also just need to know one color value at a percentage between two colors (ColorBetween). I already have it mostly done below. Except, I have two core questions: How do I calculate the in-between color of each RGB channel by a

2 color heatmap in R with middle color anchored to a specific value

让人想犯罪 __ 提交于 2019-12-18 15:22:29
问题 This heatmap image was generated in Excel but as I'm trying to learn R I would like to know how to make a heatmap like that with R. Right now, this code is working but not as it was supposed to... (p <- ggplot(melt(heat), aes(Var2, Var1)) + geom_tile(aes(fill = value), colour = "white") + scale_fill_gradient(low = "red", high = "green")) I would like to have 2 gradients, green(highest value) to white (the number 1000) to red(lowest value). Is it possible in R? heat dataset: > heat[0:10,0:10]

2 color heatmap in R with middle color anchored to a specific value

[亡魂溺海] 提交于 2019-12-18 15:19:36
问题 This heatmap image was generated in Excel but as I'm trying to learn R I would like to know how to make a heatmap like that with R. Right now, this code is working but not as it was supposed to... (p <- ggplot(melt(heat), aes(Var2, Var1)) + geom_tile(aes(fill = value), colour = "white") + scale_fill_gradient(low = "red", high = "green")) I would like to have 2 gradients, green(highest value) to white (the number 1000) to red(lowest value). Is it possible in R? heat dataset: > heat[0:10,0:10]

How can I draw a “soft” line in WPF (presumably using a LinearGradientBrush)?

六月ゝ 毕业季﹏ 提交于 2019-12-18 14:47:09
问题 I'm trying to draw a line with soft edges, regardless of the slope. Here's the code I have so far: <Line HorizontalAlignment="Stretch" VerticalAlignment="Center" Stretch="Uniform" StrokeThickness="5" X1="0" Y1="0" X2="1" Y2="0"> <Shape.Stroke> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientStop Color="Transparent" Offset="0" /> <GradientStop Color="Green" Offset="0.5" /> <GradientStop Color="Transparent" Offset="1" /> </LinearGradientBrush> </Shape.Stroke> </Line> This makes