SetOpacity: Modify the opacity, hue, saturation or value of color(s)

Description Usage Arguments Details Value Author(s) Examples

Description

Change the charactistics of a color or vector of colors

Usage

1
2
3
4
SetOpacity(color,opacity)
SetHue(color,hue)
SetSaturation(color,saturation)
SetValue(color,value)

Arguments

color

a vector of colors

opacity

a vector of new opacity values

hue

a vector of new hues

saturation

a vector of new saturations

value

a vector of new values

Details

These functions accept colors specified by name (e.g. "red") or hex codes (e.g. "FF0000"). If the color argument and the other argument both have length n, then each color will be assigned the corresponding new opacity, hue, saturation or value. Otherwise, at least one of the arguments should have length 1, in which case each it will be recycled to length n.

Value

A vector of colors of length n.

Author(s)

Brody Sandel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
TestPalette(SetOpacity("red",seq(0,1,0.02)))
TestPalette(SetHue("red",seq(0,1,0.02)))
TestPalette(SetSaturation("red",seq(0,1,0.02)))
TestPalette(SetValue("red",seq(0,1,0.02)))

x = runif(200)
y = runif(200)
color = SetHue("red",x)
color = SetValue(color,y)
plot(x,y,col = color,pch = 16,cex = 2)

painter documentation built on May 2, 2019, 10:46 a.m.

Related to SetOpacity in painter...