gradient

How do I programmatically set the background color gradient on a Custom Title Bar?

隐身守侯 提交于 2019-11-26 07:58:51
问题 There are many tutorials out there and questions on SO that implement custom title bars. However, in my custom title bar I have a custom gradient for the background and I would like to know how to set it dynamically in my code. Here is where my custom title bar gets called: requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.foo_layout); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title_bar); And this is my custom_title_bar : <LinearLayout

SVG Line with Gradient Stroke Won&#39;t Display Straight

筅森魡賤 提交于 2019-11-26 07:45:54
问题 I\'m attempting to replicate an <hr> with SVG. Now, making a straight line with SVG works perfectly, but the second I stroke it with a gradient it will no longer display in a straight line. The following code works, but take note, y1 and y2 must be 1 unit apart. If I set y1 and y2 to 210 for instance, the line will disappear. <defs> <linearGradient id=\"grad1\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"> <stop offset=\"0%\" style=\"stop-color:rgba(0,0,0,0);stop-opacity:0\" /> <stop offset=\"50

How to make gradient background in android

若如初见. 提交于 2019-11-26 06:53:05
问题 I want to create gradient background where the gradient is in the top half and there\'s a solid color in the bottom half, like in this image below: I can\'t because the centerColor spreads out to cover the bottom and top. How can I make a background like the first image? How can I make small centerColor that\'s not spread out? This is code in XML of background button above. <shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\"rectangle\" > <gradient android

Android: Using linear gradient as background looks banded

喜夏-厌秋 提交于 2019-11-26 06:14:43
问题 I\'m trying to apply a linear gradient to my ListView. This is the content of my drawable xml: <?xml version=\"1.0\" encoding=\"utf-8\"?> <shape xmlns:android=\"http://schemas.android.com/apk/res/android\"> <gradient android:startColor=\"#3A3C39\" android:endColor=\"#181818\" android:angle=\"270\" /> <corners android:radius=\"0dp\" /> </shape> So I apply it to my ListView with: android:background=\"@drawable/shape_background_grey\" It works but it looks very \"banded\" on emulator and on a

Javascript color gradient

試著忘記壹切 提交于 2019-11-26 06:05:42
问题 Using javascript with or without Jquery, I need to a create a gradient of colours based on a start and finish color. Is this possible to do programmatically? The end colour is only ever going to be darker shade of the start colour and it\'s for an unordered list which I have no control over the number of li items. I\'m looking for a solution that allows me to pick a start and end color, convert the hex value into RGB so it can be manipulated in code. The starting RGB values gets incremented

Range values to pseudocolor

最后都变了- 提交于 2019-11-26 05:56:39
问题 I have a certain array of floats (in Python) that might range from 0 to 100. I want to create a pseudo-color image so that the colors vary from green (corresponding to 0) to red (100). This is similar to pcolor from matplotlib. However, I do not want to use pcolor. Is there a function like pseudocolorForValue(val,(minval,maxval)) which returns an RGB triple corresponding to the pseudo-color value for val ? Also, is there a flexibility in this function to choose whether to display colors from

CSS3 gradient background set on body doesn&#39;t stretch but instead repeats?

倾然丶 夕夏残阳落幕 提交于 2019-11-26 05:49:51
问题 ok say the content inside the <body> totals 300px high. If I set the background of my <body> using -webkit-gradient or -moz-linear-gradient Then I maximize my window (or just make it taller than 300px) the gradient will be exactly 300px tall (the height of the content) and just repeat to fill the rest of the window. I am assuming this is not a bug since it is the same in both webkit and gecko. But is there a way to make the gradient stretch to fill the window instead of repeat? 回答1: Apply the

How do I add a gradient to the text of a UILabel, but not the background?

强颜欢笑 提交于 2019-11-26 04:12:15
问题 hey, I want to be able to have a gradient fill on the text in a UILabel I know about CGGradient but i dont know how i would use it on a UILabel\'s text i found this on google but i cant manage to get it to work http://silverity.livejournal.com/26436.html 回答1: (Skip to bottom for full class source code) Really useful answers by both Brad Larson and Bach. The second worked for me but it requires an image to be present in advance. I wanted something more dynamic so I combined both solutions into

Gradient of n colors ranging from color 1 and color 2

混江龙づ霸主 提交于 2019-11-26 04:06:57
问题 I often work with ggplot2 that makes gradients nice (click here for an example). I have a need to work in base and I think scales can be used there to create color gradients as well but I\'m severely off the mark on how. The basic goal is generate a palette of n colors that ranges from x color to y color. The solution needs to work in base though. This was a starting point but there\'s no place to input an n. scale_colour_gradientn(colours=c(\"red\", \"blue\")) I am well aware of: brewer.pal

Gradients in Internet Explorer 9

老子叫甜甜 提交于 2019-11-26 03:51:27
问题 Does anyone know the vendor prefix for gradients within IE9 or are we still supposed to still be using their proprietry filters? What I\'ve got for the other browsers is: background-image: -moz-linear-gradient(top, #444444, #999999); /* FF3.6 */ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #444444),color-stop(1, #999999)); /* Saf4+, Chrome */ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=\'#444444\', EndColorStr=\'#999999\'); /* IE6,IE7 */