gradient

Change JButton gradient color, but only for one button, not all

北慕城南 提交于 2019-11-26 12:47:16
问题 I want to change JButton gradient color, i found this, http://java2everyone.blogspot.com/2009/01/set-jbutton-gradient-color.html, but i want to change gradient for only one button, not all button 回答1: You can override the paintComponent method of the JButton instance and paint its Graphics object with one of the following classes that implement the Paint interface: GradientPaint. LinearGradientPaint MultipleGradientPaint RadialGradientPaint import java.awt.Color; import java.awt.Dimension;

Blocky gradient effect in CSS3

邮差的信 提交于 2019-11-26 12:32:32
问题 Is it possible to make the below gradient look more \"blocky\", so that instead of switching from green to red gradually, it\'s done in steps like the below picture? Desired effect: Currently: #gradients { background-image: -webkit-gradient(linear, left bottom, right bottom, color-stop(0, #00FF00), color-stop(0.5, #FFFF00), color-stop(1, #FF0000)); background-image: -o-linear-gradient(right, #00FF00 0%, #FFFF00 50%, #FF0000 100%); background-image: -moz-linear-gradient(right, #00FF00 0%,

Changing gradient background colors on Android at runtime

痴心易碎 提交于 2019-11-26 12:14:35
问题 I\'m experimenting with Drawable backgrounds and have had no problems so far. I\'m now trying to change the gradient background color at runtime. Unfortunately, there\'s no API to change it at runtime, it seems. Not even by trying to mutate() the drawable, as explained here: Drawable mutations The sample XML looks like this. It works, as expected. <shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\"rectangle\"> <gradient android:startColor=\"#330000FF\" android

Awful background image quality in Android

纵然是瞬间 提交于 2019-11-26 12:00:58
问题 I\'m trying to place a background in my activity, but the image quality is not the expected. The image has a simple gradient above blue stripes, and currently looks like this: My activity layout: <LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" android:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\" android:orientation=\"vertical\" android:background=\"@drawable/background_register\" android:drawingCacheQuality=\"high\" > </LinearLayout> The

How to make gradient color filled timeseries plot in R

与世无争的帅哥 提交于 2019-11-26 10:57:35
问题 How to fill area under and above (sp)line with gradient color ? This example has been drawn in Inkscape - BUT I NEED vertical gradient - NOT horizontal. Interval from zero to positive == from white to red . Interval from zero to negative == from white to red . Is there any package which could do this? I fabricated some source data.... set.seed(1) x<-seq(from = -10, to = 10, by = 0.25) data <- data.frame(value = sample(x, 25, replace = TRUE), time = 1:25) plot(data$time, data$value, type = \"n

Gradient Polyline with MapKit ios

与世无争的帅哥 提交于 2019-11-26 09:27:32
问题 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

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

我的梦境 提交于 2019-11-26 09:16:19
问题 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

Multi-gradient shapes

拥有回忆 提交于 2019-11-26 09:15:32
I'd like to create a shape that's like the following image: Notice the top half gradients from color 1 to color 2, but theres a bottom half that gradients from color 3 to color 4. I know how to make a shape with a single gradient, but I'm not sure how to split a shape into two halves and make 1 shape with 2 different gradients. Any ideas? kcoppock I don't think you can do this in XML (at least not in Android), but I've found a good solution posted here that looks like it'd be a great help! ShapeDrawable.ShaderFactory sf = new ShapeDrawable.ShaderFactory() { @Override public Shader resize(int

CSS3 animation with gradients [duplicate]

时光毁灭记忆、已成空白 提交于 2019-11-26 08:25:34
问题 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

Can you add noise to a CSS3 gradient?

孤街浪徒 提交于 2019-11-26 08:05:50
问题 Is it possible to add noise to a gradient in CSS? Here is my code for a radial gradient: body { color: #575757; font: 14px/21px Arial, Helvetica, sans-serif; background-color: #2f3b4b; background: -moz-radial-gradient(center 45deg, circle closest-corner, #2f3b4b 0%, #3e4f63 100%); background: -webkit-gradient(radial, center center, 10, center center, 900, from(#2f3b4b), to(#3e4f63)); } What would I add to that to have noise on top of it, to give it texture? 回答1: There's no current way in css