addFade: Color fade out

View source: R/addFade.R

addFadeR Documentation

Color fade out

Description

Make existing colors fade away to white

Usage

addFade(col, fade = 0.3, target = "white", ...)

Arguments

col

Vector of color names (colors), hexadecimal or integer that can be interpreted by col2rgb

fade

Level of fading towards target. between 0 (target) and 1 (col). Can also be a vector. DEFAULT: 0.3

target

Target color that should be faded into. DEFAULT: "white"

...

Further arguments passed to colorRamp

Value

character matrix with hexadecimal color codes.

Author(s)

Berry Boessenkool, berry-b@gmx.de, Feb 2016

See Also

addAlpha, colorRamp, colors

Examples


plot(1:11, pch=16, cex=3, col=addFade(2, 10:0/10))
plot(1:11, pch=16, cex=3, col=addFade(2, 10:0/10, target="blue"))
plot(1:11, pch=16, cex=3, col=addFade(2, 10:0/10, target=3:4))
plot(1:21, pch=16, cex=3, col=addFade(2:3, 10:0/10))
plot(1:21, pch=16, cex=3, col=addFade(2:3, 10:0/10, target=4:5))
NewColors <- addFade(c("red","blue","yellow","green", "purple"), 0:200/200)
plot(runif(1000), col=NewColors, pch=16, cex=2)


brry/berryFunctions documentation built on Feb. 21, 2024, 2:20 p.m.