gradient

Android create iphone-like Gradient

人盡茶涼 提交于 2019-12-22 07:46:32
问题 I need to create black iphone like gradient in my android application. Please view black gradient at the top in the image below. How to do it? Thanks 回答1: Something like this, perhaps? <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#FF000000" android:endColor="#FF8E8E8E" android:angle="270"/> </shape> 回答2: I've posted a blog about an Iphone look an Android: http://www.dibbus.com/2011/06/android-gradient-toolbar/ You

Gradients hidden using SVG symbols

只谈情不闲聊 提交于 2019-12-22 07:10:31
问题 I am using SVG symbols this way, but the display:none of the SVG is hidden the gradients of the graphic. Any idea? In the example below, there should be two circles, but the red one is hidden: <svg xmlns="http://www.w3.org/2000/svg" style='display:none' > <defs> <style>.red-gradient{fill:url(#gradient)}</style> <linearGradient id="gradient" x1="0" x2="0" y1="0" y2="1"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="darkred"/> </linearGradient> </defs> <symbol id=

scipy.optimize.fmin_bfgs single function computes both f and fprime

我与影子孤独终老i 提交于 2019-12-22 06:03:22
问题 I'm using scipy.optimize.fmin_bfgs(f, init_theta, fprime) to minimize f , which has gradient fprime . I compute f and fprime in a single function because most of the computation is the same so there's no need to do it twice. Is there any way to call fmin_bfgs() specifying a single function that returns both f and fprime ? 回答1: If you're trying to save on computation time rather than just combine the calculation of f and f' for code convenience, it seems like you need an extra wrapper around

scipy.optimize.fmin_bfgs single function computes both f and fprime

断了今生、忘了曾经 提交于 2019-12-22 06:03:06
问题 I'm using scipy.optimize.fmin_bfgs(f, init_theta, fprime) to minimize f , which has gradient fprime . I compute f and fprime in a single function because most of the computation is the same so there's no need to do it twice. Is there any way to call fmin_bfgs() specifying a single function that returns both f and fprime ? 回答1: If you're trying to save on computation time rather than just combine the calculation of f and f' for code convenience, it seems like you need an extra wrapper around

c# XAML ProgressBar set gradient filling properly

不问归期 提交于 2019-12-22 06:00:15
问题 How do I set the gradient of a ProgressBar in XAML to dynamic filling? At the moment its like: Code for both progress bars: <ProgressBar.Foreground> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <LinearGradientBrush.RelativeTransform> <CompositeTransform CenterY="0.5" CenterX="0.5" Rotation="270"/> </LinearGradientBrush.RelativeTransform> <GradientStop Color="Lime" Offset="0"/> <GradientStop Color="Red" Offset="1"/> </LinearGradientBrush> </ProgressBar.Foreground> but I want to

Changing text color on 2 sides of diagonal gradient line in html

試著忘記壹切 提交于 2019-12-22 04:35:28
问题 Any idea on how to change text color for 2 parts of gradient line? For example here if I want the blue part of the text ('s', 'o' and a part of 'm') to be black? .button{ background: linear-gradient(140deg, #00C9FF 35%, transparent 35%); } 回答1: You can do it wrapping the text in a <p> tag and setting a linear-gradient to this tag. button{ background: linear-gradient(140deg, #00C9FF 35%, transparent 35%); color: white; font-size: 30px; } p{ margin: 0; font-size: 50px; background: -webkit

Function to compute 3D gradient with unevenly spaced sample locations

本秂侑毒 提交于 2019-12-21 21:38:37
问题 I have experimental observations in a volume: import numpy as np # observations are not uniformly spaced x = np.random.normal(0, 1, 10) y = np.random.normal(5, 2, 10) z = np.random.normal(10, 3, 10) xx, yy, zz = np.meshgrid(x, y, z, indexing='ij') # fake temperatures at those coords tt = xx*2 + yy*2 + zz*2 # sample distances dx = np.diff(x) dy = np.diff(y) dz = np.diff(z) grad = np.gradient(tt, [dx, dy, dz]) # returns error This gives me the error: ValueError: operands could not be broadcast

One colour gradient according to value in column scatterplot in R

∥☆過路亽.° 提交于 2019-12-21 21:36:45
问题 I would like to make my scatterplot circles shaded according to the value in one column. "value"; "avg.sal"; "avg.temp" 2,5698; 34,27254; 4,44 5,4361; 34,30686; 4,64 2,27; 34,3538; 8,05 5,6015; 34,50136; 5,01 2,27; 34,37596; 7,4 I have my plot ready with salinity on the y-axis and temperature on the x-axis. plot(df$avg.sal, df$avg.temp) How do I shade the circles (e.g. from light blue to dark blue) according to the column "value"? The values have a big range but smaller values (e.g. 2) should

Can you animate gradients using Quartz in an iPhone?

人走茶凉 提交于 2019-12-21 20:27:53
问题 I am new to iPhone development and am currently toying with recreating a charting tool I developed for Silverlight. Currently I'm using a gradient to 'fill' a rectangle representing a bar within a chart. Is it possible to animate this gradient so it changes colour when a user touches the bar within the chart. I have looked through the Core Animation guides provided by Apple but cannot see a property which targets gradients. I suppose I could use a transition to fade between two rects, one of

Backpropagating gradients through nested tf.map_fn

好久不见. 提交于 2019-12-21 19:49:22
问题 I would like to map a TensorFlow function on each vector corresponding to the depth channel of every pixel in a matrix with dimension [batch_size, H, W, n_channels] . In other words, for every image of size H x W that I have in the batch: I extract some features maps F_k (whose number is n_channels) with the same size H x W (hence, the features maps all together are a tensor of shape [H, W, n_channels] ; then, I wish to apply a custom function to the vector v_ij that is associated with the i