FadeToColor
Returns a colour or pixmap partially faded into a specific colour.
Syntax
-
FadeToColor(c, ξ[, t])-
cis a colour -
ξis a colour -
tis a number in [0, 1]
-
-
FadeToColor(pm, ξ[, t])-
pmis a pixmap -
ξis a colour -
tis a number in [0, 1]
-
Description
If c is a colour, then FadeToColor(c, ξ, t) returns the colour a fraction t on the way from c to ξ in terms of RGB coordinates. Specifically, if c = rgb(r, g, b) and ξ = rgb(ρ, γ, β), then
FadeToColor(c, ξ, t) =
rgb(
(1 − t)⋅r + t⋅ρ,
(1 − t)⋅g + t⋅γ,
(1 − t)⋅b + t⋅β
).
If pm is a pixmap, then FadeToColor(pm, ξ, t) returns the pixmap obtained from pm by transforming each of its pixels in this way.
If omitted, t defaults to .5.
Examples
FadeToColor(ExampleData("harvestman"), "gold")
