gradient

Android LinearLayout Gradient Background

本小妞迷上赌 提交于 2019-11-27 10:01:11
I am having trouble applying a gradient background to a LinearLayout. This should be relatively simple from what I have read but it just doesn't seem to work. For reference sakes I am developing on 2.1-update1. header_bg.xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:angle="90" android:startColor="#FFFF0000" android:endColor="#FF00FF00" android:type="linear"/> </shape> main_header.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res

How to make transparent gradient?

半城伤御伤魂 提交于 2019-11-27 09:45:41
问题 I have the following gradient: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#ECECEC" android:centerColor="#F6F6F4" android:endColor="#F8F8F6" android:angle="90" android:dither="true" /> </shape> I want this to be transparent because in my ListView I am setting this as my ListSelector: <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android

Pyplot: vertical gradient fill under curve?

末鹿安然 提交于 2019-11-27 09:41:51
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 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.contourf(x, y, z, num_bars) background_color = 'w' plt.fill_between(x, y, y2=max(y), color=background_color)

using two scale colour gradients on one ggplot

廉价感情. 提交于 2019-11-27 09:17:08
I would like to combine a colour scale gradient for the points on a scatter plot together with a colour scale gradient for some text that goes on the plot. I can do them separately as shown in my example below, but i can't seem to put them together...is there a way of doing this? Here is my example code of the two types of plots (p and p1) that I want to combine l <- data.frame(prev=rnorm(1266), aft=rnorm(1266), day=as.factor(wday(sample(c(2:6),1266,replace=TRUE),abbr=TRUE, label=TRUE)), month=as.factor(month(Sys.Date()+months(sample(0:11,1266,replace=TRUE)),abbr=TRUE, label=TRUE)), ind=c(1

Angle gradient in canvas

谁都会走 提交于 2019-11-27 08:57:09
I'm looking for a code that permits to have this effect on a canvas' stroke . I've already got an animated circular stroke, I only need to get the ANGLE gradient, not linear and not radial. I've got only 3 colours. The existing one is available here (the review rating) A context strokeStyle can be a gradient: // create a gradient gradient = ctx.createLinearGradient(xStart, yStart, xEnd, yEnd); gradient.addColorStop(0.0,"blue"); gradient.addColorStop(1.0,"purple"); // stroke using that gradient ctx.strokeStyle = gradient; Example code and a Demo using a gradient strokeStyle: http://jsfiddle.net

Swift: Gradient along a bezier path (using CALayers)

旧时模样 提交于 2019-11-27 08:46:56
I have a relatively straight forward implementation of a progress view set up with CALayer objects. The progress view itself is a subview of UIView. Here is the code that sets up the progress ring: self.progressRingLayer = CAShapeLayer() let innerRect = CGRectInset(bounds, CGFloat(self.lineWidth) / 2, CGFloat(self.lineWidth) / 2) let innerPath = UIBezierPath(ovalInRect: innerRect) self.progressRingLayer.path = innerPath.CGPath self.progressRingLayer.fillColor = UIColor.clearColor().CGColor self.progressRingLayer.strokeColor = kProgressColor.CGColor self.progressRingLayer.anchorPoint =

Matplotlib: How to colorize a large number of line segments as independent gradients, efficiently

会有一股神秘感。 提交于 2019-11-27 08:30:55
Python. matplotlib : How to colorize a large number of line segments as independent gradients, efficiently? Already, read this and this and other stuff; none of them is our answer! We have a number of separate lines wish to plot each in gradient color. The solution mentioned in first link above, does not work if you have more than one string of line. In other words, changing the color cycle affects everything in the plot not the only line of interest. This is not of our interest at all. The second link which is to the matplotlib site uses segmentation of each lines into many. This is not good

How to fill matplotlib bars with a gradient?

旧城冷巷雨未停 提交于 2019-11-27 08:30:00
问题 I would be very interested in filling matplotlib/seaborn bars of a barplot with different gradients exactly like done here (not with matplotlib as far as I understood): I have also checked this related topic Pyplot: vertical gradient fill under curve?. Is this only possible via gr-framework: or are there alternative strategies? 回答1: Just as depicted in Pyplot: vertical gradient fill under curve? one may use an image to create a gradient plot. Since bars are rectangular the extent of the image

CSS3 fallback for older browsers

本秂侑毒 提交于 2019-11-27 08:04:58
问题 I have made a circle using CSS3, trouble is in older browsers (ie7 etc) the circle appears as a square. I know I could use a background image as a backup, but doesnt this defeat the point of using code? If i was to put background-image in, where would it go in the CSS? .ButtonB:hover, .ButtonB.hover { background: -moz-linear-gradient( center top, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, .1) 100% );/* FF3.6 */ background: -webkit-gradient( linear, center bottom, center top, from(rgba

how to set status bar background as gradient color or a drawable in android

杀马特。学长 韩版系。学妹 提交于 2019-11-27 07:54:10
I want to set status bar background as gradient theme also status bar and action bar color should same gradient drawable, as per documentation we can set color to status bar in API level 21 and above by using <item name="android:statusBarColor">@color/colorPrimary</item> But i am searching something like <item name="android:statusBarDrawable">@drawable/myDrawable</item> I have seen example that use <item name="android:windowTranslucentStatus">false</item> <item name="android:windowTranslucentNavigation">false</item> but in that case status bar and action bar overlap (use fitSystemWindow =true