I know it's possible to create a simple two-color gradient as described in the docs at http://www.imagemagick.org/Usage/canvas/#gradient. What I'm not sure about is how to make more than two colors where each color can be placed at a specific percentage (for weighting).
I know I can use ImageMagick to create a two-color gradient, with one color at the 0,0 and the other color at the [100% width],0. For example, this command:
Code: Select all
convert -size 100x500 gradient:'#f00-#00f' gradient-2.png
Code: Select all
#gradient {
width: 100px;
height: 500px;
background-image: -webkit-linear-gradient(top, #f00, #00f);
}
Code: Select all
#gradient {
width: 100px;
height: 500px;
background-image: -webkit-linear-gradient(top, #f00 10%, #ff0 20%, #00f 80%);
}
1. This gradient has three colors instead of two, and
2. The color stops in this gradient are not evenly spaced.
An example of the above can be seen here in Chrome/Safari or Firefox: http://jsfiddle.net/aMhL8/
Ideally, I'd be able to use an arbitrary number of colors (three was just a simple example). Does anyone know how to accomplish this with ImageMagick? Any help would be greatly appreciated.