gradient

Generating gradients programatically?

Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is this blog entry, but the example code seems to be missing, or at least it was as of this posting. Anything helps, algorithms, code examples, whatever. This will ...

Is there a way to use GflAx to incorporate gradient colours?

Ok, narrow question of the day. I'm using GflAx (from xnview) to create some graphic tiles. I would like to put some gradients in as well though. Is there a way I can do this within this product? Thanks. Edit:There is also an SDK which is part of this product but I can't find that info there. ...

Algorithm to blend gradient filled corners in image

I need to put an alpha blended gradient border around an image. My problem is in blending the corners so they are smooth where the horizontal and vertical gradients meet. I believe there is a standard algorithm that solves this problem. I think I even encountered it in school many years ago. But I have been unsuccessful in finding any...

gradients using only html and css and javascript?

Hi, Is there a way to do gradients in css/html/javscript only that will work across all the major browsers? (ie 5+, firefox, opera, safari)? Edit: I would like to do this for backgrounds (header, main panel, side panels). Also, would like to have vertical line gradients as well. Edit: after reading the responses, let's open this up to...

Can a two-dimensional gradient be created (or faked) in SVG?

I'm trying to create a color-picker which must dynamically generate its images and figured it would be a whole lot easier to generate SVG than a raster image. Unfortunately, I can't figure out how to represent the big, two-dimensional gradient which will form the centerpiece of the picker. For example, if the currently selected axes ar...

Creating a gradient fill in a PDF file using reportlab

Is it possible to create a gradient fill in a PDF using ReportLab (python)? ...

Silverlight - Default Gradient or Effect - How do you turn it off?

If you use this code in Silverlight and WPF you get slightly different results? <Button Name="SomeButton" Margin="10,15,180,12" Width="200" Height="50" VerticalAlignment="Top" Background="Black" Foreground="White"> </Button> In Silverlight you do not get a solid black Button. You get a vertical white-to-black grad...

How to create gradient object with Raphael

Hi, I was trying to use Raphale JS graphics library. I would like to use the attribute gradient which should accept an object. Documentation says to refer to SVG specs. I found the gradient object in SVG, for instance <linearGradient id="myFillGrad" x1="0%" y1="100%" x2="100%" y2="0%"> <stop offset="5%" stop-color="red" /> <stop offset...

c# Drawing a Line with a gradient colour?

Is it possible to draw a line using a graduated colour? I want to be able to draw a stright or a curved line (if possible) where one end of the line is Blue and the other Red. Further There might be a beed to have more than one gradient per-line e.g the colour going from blue -> green -> red. Im thinking that this might just consist ...

Strange off-by-one issue with snippet to generate gradients...

I use my own library for a lot of stuff, and recently I decided to add gradient functionality, but I've encountered a problem that I seem to remember having a while ago also, and this is the matter of my gradient being slightly off near the end. First, the code in question: gradient = function(l, g) { var r = [], s = [], f = g.length -...

CALayer and CGGradientRef anti-aliasing?

Hello all. I'm having an odd issue with CALayer drawing for the iPhone. I have a root layer which adds a bunch of sublayers representing "bubbles". The end result is supposed to look something like this: The problem is that I can't seem to get the layer to anti-alias (notice the jaggies on the bubbles). My code overwriting drawInC...

How to draw color wheel in WPF application?

I started to play with WPF and wanted to draw color wheel on a form. At first I tryed to use LinearGradientBrush on ArcSegment like this: <Path StrokeThickness="35" Height="150" Width="150"> <Path.Stroke> <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> <GradientStop Color="Red" Offset="0.15" /> ...

iPhone SDK: How to Draw a Rounded Rectangle With a Semi-Transparent Gradient and a Drop Shadow

I'm experimenting with drawing on the iPhone by manually creating parts of the UI for my application (In this case a graph). Essentially, I want to draw a rectangle with rounded corners, a drop-shadow, and a semi-transparent gradient as the fill of the rectangle. Here is a screen shot of my photoshop mockup: I've gotten has far as crea...

Get Value of Row in Datatable c#

Hi, i have a problem with my code. foreach (DataRow dr in dt_pattern.Rows) { part = dr["patternString"].ToString(); if (part != vpart) { System.Console.WriteLine(part); System.Console.WriteLine("Geben Sie bitte für den Abschnitt die AT ein: "); temp = System.Console.ReadLine(); AT = ...

Gradient servers as external files in SVG

Hi, the fill property in SVG accepts an url to point to a gradient/pattern element, an instance of a so-called 'paint server'. The Question: Is it possible in any browser (that is, not IE, of course), to use a gradient defined in an external SVG file? Like, in rect.svg, <rect fill="url(grad.svg#my_grad)" /> and the corresponding <li...

How do I calculate a four colour gradient?

If I have four colours (A, B, C & D) on four corners of a square and I want to fill that square with a gradient that blends nicely between the four colours how would I calculate the colour of the point E? The closer E is to any of the other points, the strong that colour should affect the result. Any idea how to do that? Speed and sim...

Line with different solid colors, solidcolorbrush with gradient stops but without the gradients

In Silverlight (version 3 preview), I want to create a Line with different solid colors, so no gradients between colors. Basically I want to do the following: <Line X1="0" X2="500" StrokeThickness="10"> <Line.Stroke> <LinearGradientBrush> <GradientStop Color="Blue" Offset="0.5" /> <GradientStop Color="Red" Offset="1"/> </LinearGr...

Does anyone have a script to create a horizontal gradient (left to right) using PHP?

Here's the current code I am using. <? header("Content-type: image/png"); // example: <img src="gradient.php?height=600&width=100&start=00FF00&end=ff0000" /> $height=100; $width=1; $start='000000'; $end='FFFFFF'; extract($_REQUEST); // overwrite using vars from url $start_r = hexdec(substr($start,0,2)); $start_g = hexdec(substr($start,2...

Arc based gradient

I am trying to create an arc (variable width, variable number of degrees - potentially an entire circle) that gradually goes from, say, red on one end to green on the other. I haven't figured out how to specify a gradient on an arc to accomplish this. For example, if you could imagine creating a round temperature gauge where the guage ...

Circular Gradient and WPF

I need to replicate a circular (or angle) gradient from a Photoshop comp in WPF; so far I can only find linear and radial. Does anyone know if such a thing exists, or and easy way to get get a circular gradient in WPF? Note: I'm not asking about a radial gradient. A circular gradient is like taking a rectangle, applying a gradient and t...