gradient

Android radial gradient

我们两清 提交于 2019-12-05 23:34:02
问题 I've got following drawable set as LinearLayout background: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <bitmap android:tileMode="repeat" android:dither="true" android:src="@drawable/bg"/> </item> <item> <shape android:shape="rectangle"> <gradient android:startColor="#ffff0000" android:endColor="#ff00ff00" android:centerX="50%" android:centerY="50%" android:gradientRadius="50%" android:type="radial"/> </shape> </item> <

OpenGL gradient fill on iPhone looks striped

僤鯓⒐⒋嵵緔 提交于 2019-12-05 22:40:03
When I draw a gradient fill with OpenGL, the output looks striped, i.e. it's rendered with only about the a fourth of the possible colors. In the render buffer all the colors appear but not in the actual output. I'm developing on iPhone 3G running iOS4. Any ideas? Peter ========== ========== GLint redBits, greenBits, blueBits; glGetIntegerv (GL_RED_BITS, &redBits); // ==> 8 glGetIntegerv (GL_GREEN_BITS, &greenBits); // ==> 8 glGetIntegerv (GL_BLUE_BITS, &blueBits); // ==> 8 glDisable(GL_BLEND); glDisable(GL_DITHER); glDisable(GL_FOG); glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D);

How to add 'shine' overlay to a div?

ⅰ亾dé卋堺 提交于 2019-12-05 21:48:55
How can I add a nice overlay like the one in the following image? Consider the following HTML, how would I add an overlay like that? I know I can use a gradient on top of it, and apply it diagonally, but can I curve it as well? <div class="photostrip"> <div class="overlay" /> <img src="http://i.imgur.com/a21tM.jpg" /> <img src="http://i.imgur.com/a21tM.jpg" /> <img src="http://i.imgur.com/a21tM.jpg" /> </div> Here's something I've tried (I've oversaturated the overlay so it's easily seen), but it's not quite the shape I'm looking for. body { background-color: #4b74db; } .photostrip { margin: 0

Color code a scatter plot by group with a gradient

痞子三分冷 提交于 2019-12-05 21:44:10
I have XY data which I'd like to graph using a scatter plot , with R 's plotly package. set.seed(1) df <- data.frame(x=c(rnorm(30,1,1),rnorm(30,5,1),rnorm(30,9,1)), y=c(rnorm(30,1,1),rnorm(30,5,1),rnorm(30,9,1)), group=c(rep("A",30),rep("B",30),rep("C",30)),score=runif(90,0,1)) Each point is assigned to one of three groups ( df$group ) and has a score in the [0,1] range. I'm looking for a way to graph the data such that each group is colored with a different color but the shade of that color (or intensity) reflects the score. So I thought this would work: library(dplyr) library(plotly) plot_ly

CSS3 spotlight effect using a rounded rectangle with gradients

匆匆过客 提交于 2019-12-05 15:45:45
I'm writing an interactive tutorial for a web app that is meant to highlight the various parts of the user interface. The tutorial is meant to spotlight one part at a time and tell the user how to interact with it. You've probably seen something similar on smartphone apps. For the specific CSS that could be used to spotlight an existing interface, the best solution I've found is using something like this, which is just a div on top of the existing interface that allows portions to be highlighted: https://web.archive.org/web/20120414095101/http://svay.com/experiences/css3-spotlight However, the

gradient on Gingerbread

喜你入骨 提交于 2019-12-05 15:34:10
Updated I have a problem with gradient bitmaps on android 2.3. I read this great article and decode my bitmaps using next options: BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; options.inDither = true; And on android 2.2 everything is great, but on android 2.3 gradient artifacts remain even after that decoding. I run application from article on 2.3 with my bitmaps and all variants are bad: 16/32 bit, (not) dither and RBG_565, ARGB_8888 and ARGB_4444 - gradient has artifacts. Also I tried to decode without options. Everything

How to make the background gradient of a JPanel

不羁岁月 提交于 2019-12-05 14:42:21
I want to know how to make background gradient which is in another JPanel. Many articles found in internet,but all of them had demostrated how to overide the paintComponent() of the JPanel not how to do for a jPanel which is inside it. I use Netbeans IDE. I created a new JPanel class and could overide its paintComponent(). I have another jpanel on it (dragged & dropped on to the parent JPanel). I want to make its background gradient. Here is how I tried for parent. It worked. How can I overide this for child jpanel ? public void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g;

define color gradient for negative and positive values scale_fill_gradientn()

和自甴很熟 提交于 2019-12-05 13:12:38
R version 3.1.1 (2014-07-10) Platform: i386-w64-mingw32/i386 (32-bit) I am working on a heatmap with ggplot2() values from -1 to +1. I want to achieve that negative values have a bluish gradiend from darkblue(-1) to lightblue(-0.00000001) and the positive values a redish one from lightred(0.00000001) to darkred(1). Small values should not fade into white, as zeros should have white color and there shall be a visible contrast between 0 and a small value. NA values should be grey. I tried scale_fill_gradient2() and scale_fill_gradientn() also with rescale() . A similar topic has been discussed,

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

二次信任 提交于 2019-12-05 10:15:36
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 ? 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 your function to cache values, since fmin_bfgs doesn't seem to allow you to pass such a function (unlike some

c# XAML ProgressBar set gradient filling properly

寵の児 提交于 2019-12-05 08:44:42
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 have the "end"color of the upper ProgressBar in the green-yellowish color like directly below. Means I