gradient

Gradient Polyline with MapKit ios

a 夏天 提交于 2019-11-27 00:47:06
I'm trying to trace a route on a MKMapView using overlays (MKOverlay). However, depending on the current speed, I want to do something like the Nike app with a gradient while tracing the route, if the color is changing (for example, from green to orange if a user is driving from 65mph to 30mph). Here's a screenshot of what I want: So every 20 meters, I adding an overlay from the old to the new coordinates using: // Create a c array of points. MKMapPoint *pointsArray = malloc(sizeof(CLLocationCoordinate2D) * 2); // Create 2 points. MKMapPoint startPoint = MKMapPointForCoordinate

Use css gradient over background image

喜夏-厌秋 提交于 2019-11-27 00:39:34
I've been trying to use a linear gradient on top of my background image in order to get a fading effect on the bottom of my background from black to transparent but can't seem to be able to make it show. I've read other cases here and examples but none of them are working for me. I can only see the gradient or the image but not both of them. Here's the link Just click on the first logo, ignore that effect, what I'm trying is in the body in the whole site after that. This is my css code: body { background: url('http://www.skrenta.com/images/stackoverflow.jpg') no-repeat, -webkit-gradient(linear

2D grid data visualization in Python

余生长醉 提交于 2019-11-27 00:31:53
I need to visualize some data. It's basic 2D grid, where each cell have float value. I know how to e.g. assign color to value and paint grid in OpenCV. But the point here is that there are so many values so it's nearly impossible to do that. I am looking for some method, where I could use gradient. For example value -5.0 will be represented by blue, 0 - black, and +5.0 as red. Is there any way to do that in Python? Here is sample data I am talking about A B C D A -1.045 2.0 3.5 -4.890 B -5.678 3.2 2.89 5.78 Yann Matplotlib has the imshow method for plotting arrays: import matplotlib as mpl

SVG gradient using CSS

浪子不回头ぞ 提交于 2019-11-27 00:12:35
问题 I'm trying to get a gradient applied to an SVG rect element. Currently, I'm using the fill attribute. In my CSS file: rect { cursor: pointer; shape-rendering: crispEdges; fill: #a71a2e; } And the rect element has the correct fill color when viewed in the browser. However, I'd like to know if I can apply a linear gradient to this element? 回答1: Just use in the CSS whatever you would use in a fill attribute. Of course, this requires that you have defined the linear gradient somewhere in your SVG

Colour points in a plot differently depending on a vector of values

て烟熏妆下的殇ゞ 提交于 2019-11-26 23:56:17
I'm plotting the plot below using R's plot function. It is a plot of a vector 'shiftTime' of shift in time. I have another vector 'intensity' of the intensity values ranging from ~3 to ~9. I want to color my points in the plot based on those values with a color gradient. The examples I can find color on the value of the actual plotted points, so in this case the values of the vector 'shiftTime'. Is it also possible to use a different vector, as long as the corresponding values are on the same index? Here's a solution using base R graphics: #Some sample data x <- runif(100) dat <- data.frame(x

jQuery animate div background color gradient?

百般思念 提交于 2019-11-26 22:59:39
问题 I'm trying to build a background animation with jQuery which changes from one gradient to another. I know you can use the .animate() function to change solid background colors, but can this also be done for gradients? Here's a good example from some old Digg-style comments. I'm looking to do something like this animating from green to yellow 回答1: UPDATE: These days, all major browsers support CSS animations, which are way more reliable than jQuery. For reference, see Rohit's answer. OLD

CSS3 animation with gradients [duplicate]

我的梦境 提交于 2019-11-26 22:44:44
This question already has an answer here: Use CSS3 transitions with gradient backgrounds 15 answers Is there really no way to animate a gradient-background with CSS? something like: @-webkit-keyframes pulse { 0% { background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgb(196,222,242)), color-stop(0.5, rgb(242,242,242)), color-stop(1, rgb(240,240,240))); } 50% { background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgb(222,252,255)), color-stop(0.5, rgb(242,242,242)), color-stop(1, rgb(240,240,240))); } 100% { background: -webkit-gradient(linear, left top

Pyplot: vertical gradient fill under curve?

丶灬走出姿态 提交于 2019-11-26 22:18:28
问题 I'm wondering if there's a way to fill under a pyplot curve with a vertical gradient, like in this quick mockup: I found this hack on StackOverflow, and I don't mind the polygons if I could figure out how to make the color map vertical: How to fill rainbow color under a curve in Python matplotlib 回答1: There may be a better way, but here goes: from matplotlib import pyplot as plt x = range(10) y = range(10) z = [[z] * 10 for z in range(10)] num_bars = 100 # more bars = smoother gradient plt

Gradient text color

让人想犯罪 __ 提交于 2019-11-26 22:06:49
Is there a generator , or an easy way to generate text like this but without having to define every letter So something like this: .rainbow { background-image: -webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) ); background-image: gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9

Gradient over Instagram SVG of FontAwesome 5

旧巷老猫 提交于 2019-11-26 22:05:11
问题 After upgrading to FontAwesome 5, I'm not able to color the svgs of FontAwesome. This is my example: ⠀⠀⠀⠀⠀ https://codepen.io/shadrix/pen/GygdZr Should be awesome if it worked like here: ⠀⠀⠀⠀⠀ https://codepen.io/immad-hamid/pen/jVNvQO (Note: he used FontAwesome 4). 回答1: Icons are no longer referenced as glyphs from a font, but injected as inline SVG. The content color of the icon is defined as fill="currentColor" . The technique with setting the background and using -webkit-background-clip no