gradient

How to set gradient style to paint object?

荒凉一梦 提交于 2019-11-26 19:23:05
问题 The code for drawing an arrow with Style: Fill is given below: paint.setColor(Color.parseColor("#bdc0dc")); paint.setStyle(Style.FILL); canvas.drawPath(arrowPath, paint); paint.setColor(Color.BLACK); paint.setStyle(Style.STROKE); paint.setStrokeWidth(2); canvas.drawPath(arrowPath, paint); And the output I obtain is this : Now what I want do is set style to Gradient(Style.gradient not present in android...) to obtain the arrow similar to the image given below : How do i do it ? I tried adding

How to make gradient background in android

梦想与她 提交于 2019-11-26 19:15:59
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:startColor="#6586F0" android:centerColor="#D6D6D6" android:endColor="#4B6CD6" android:angle="90"/> <corners

Gradient colors in Internet Explorer

谁都会走 提交于 2019-11-26 18:56:09
问题 I know that Internet Explorer has some proprietary extensions so that you can do things like create divs with a gradient background. I can't remember the element name or it's usage. Does anyone have some examples or links? 回答1: Look at the custom CSS filters IE can handle http://msdn.microsoft.com/en-us/library/ms532847.aspx 回答2: The code I use for all browser gradients: background: #0A284B; background: -webkit-gradient(linear, left top, left bottom, from(#0A284B), to(#135887)); background:

Android: Using linear gradient as background looks banded

可紊 提交于 2019-11-26 18:12:08
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 real device too. Is there any way to reduce this "behaviour"? As Romain Guy suggests: listView.getBackground().setDither

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

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 17:42:40
问题 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

Javascript color gradient

社会主义新天地 提交于 2019-11-26 17:24:28
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 by a step value calculated based upon the number of items. so if the list had 8 items then the it needs to

Heatmap style gradients in .NET

给你一囗甜甜゛ 提交于 2019-11-26 16:59:26
问题 I am trying to create a heat map with gradients that look similar to this: This image shows three points and the gradients blend nicely together. Here is what I am currently doing in my drawing function: public void DrawGradient(int x, int y, Graphics g) { using (var ellipsePath = new GraphicsPath()) { var bounds = new Rectangle(x, y, 100, 100); ellipsePath.AddEllipse(bounds); var brush = new PathGradientBrush(ellipsePath); Color[] colors = { Color.FromArgb(64, 0, 0, 255), Color.FromArgb(140,

Why can't I reference an SVG linear gradient defined in an external file (paint server)?

吃可爱长大的小学妹 提交于 2019-11-26 16:55:13
问题 Please have a look at this Pen: http://codepen.io/troywarr/pen/VYmbaa What I'm doing here is: defining an SVG symbol ( <symbol> ) defining an SVG linear gradient ( <linearGradient> ) using the <use> element to reference the SVG symbol I've created in the CSS, defining two classes: external , which references the linear gradient defined in this external .svg file (right click and view source) internal , which references the linear gradient defined in the local HTML (which is, I believe,

Gradient Stroke Along Curve in Canvas

僤鯓⒐⒋嵵緔 提交于 2019-11-26 16:45:24
问题 I'm trying to draw a curve in canvas with a linear gradient stoke style along the curve, as in this image. On that page there is a linked svg file that gives instructions on how to accomplish the effect in svg. Maybe a similar method would be possible in canvas? 回答1: A Demo: http://jsfiddle.net/m1erickson/4fX5D/ It's fairly easy to create a gradient that changes along the path : It's more difficult to create a gradient that changes across the path : To create a gradient across the path you

How do I get a rainbow color gradient in C#?

末鹿安然 提交于 2019-11-26 16:24:37
问题 I'd like to have an enumeration of Colors based on the rainbow colors (red... yellow... green... blue...). I see basically two ways to do that: Create a lookup table containing some important reference colors and interpolate between these. I don't like this idea at all. Apply some more or less fancy math. Probably less, but I don't quite see how it works. Any ideas? (Oh, and while I did some SO research, I found no good results. If this question was already posted, please just point me to the