JuliaLang/Color.jl — pull request #8 by stevengj (2013-08-10 02:21:06+00:00)
Title: added weighted_color_mean and linspace functions (linear color ramp)

The following are useful in generating gradient ramps:

* `linspace(c1::ColorValue, c2::ColorValue, n=100)` — Generates `n` colors in a linearly interpolated ramp from `c1` to `c2`, inclusive, returning an `Array` of colors
* `weighted_color_mean(w1::Real, c1::ColorValue, c2::ColorValue)` — Returns a color that is the weighted mean of `c1` and `c2`, where `c1` has a weight 0 ≤ `w1` ≤ 1.

Note that `weighted_color_mean` was already exported but does not seem to have been defined; I'm not sure if this is what you had in mind?

Technically, the above functions currently only work if `typeof(c1) == typeof(c2)`, but could easily be generalized if promotion rules for pairs of `ColorValue` types could be devised.