fadeColor: Fade colors

Description Usage Arguments Author(s) See Also Examples

Description

Fade colors so they are transparent.

Usage

1
fadeColor(col, fade = "FF")

Arguments

col

An integer, color name, or RGB hexadecimal.

fade

The amount to fade col. This value should be a character in hexadecimal from '00' to 'FF'. The smaller the value, the greater the fading.

Author(s)

David Diez

See Also

dotPlot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
data(marioKart)
new  <- marioKart$cond == 'new'
used <- marioKart$cond == 'used'

par(mfrow=1:2)

#===> color numbers <===#
dotPlot(marioKart$totalPr[new], ylim=c(0,3), xlim=c(25, 80), pch=20,
	col=2, cex=2, main='using regular colors')
dotPlot(marioKart$totalPr[used], at=2, add=TRUE, col=4, pch=20, cex=2)
dotPlot(marioKart$totalPr[new], ylim=c(0,3), xlim=c(25, 80),
	col=fadeColor(2, '22'), pch=20, cex=2,
	main='fading the colors first')
dotPlot(marioKart$totalPr[used], at=2, add=TRUE,
	col=fadeColor(4, '22'), pch=20, cex=2)

#===> color names <===#
dotPlot(marioKart$totalPr[new], ylim=c(0,3), xlim=c(25, 80), pch=20,
	col='red', cex=2, main='using regular colors')
dotPlot(marioKart$totalPr[used], at=2, add=TRUE, col='blue', pch=20, cex=2)
dotPlot(marioKart$totalPr[new], ylim=c(0,3), xlim=c(25, 80),
	col=fadeColor('red', '22'), pch=20, cex=2,
	main='fading the colors first')
dotPlot(marioKart$totalPr[used], at=2, add=TRUE,
	col=fadeColor('blue', '22'), pch=20, cex=2)

#===> hexadecimal <===#
dotPlot(marioKart$totalPr[new], ylim=c(0,3), xlim=c(25, 80), pch=20,
	col='#FF0000', cex=2, main='using regular colors')
dotPlot(marioKart$totalPr[used], at=2, add=TRUE, col='#0000FF', pch=20,
	cex=2)
dotPlot(marioKart$totalPr[new], ylim=c(0,3), xlim=c(25, 80),
	col=fadeColor('#FF0000', '22'), pch=20, cex=2,
	main='fading the colors first')
dotPlot(marioKart$totalPr[used], at=2, add=TRUE,
	col=fadeColor('#0000FF', '22'), pch=20, cex=2)

#===> alternative: rgb function <===#
dotPlot(marioKart$totalPr[new], ylim=c(0,3), xlim=c(25, 80), pch=20,
	col=rgb(1,0,0), cex=2, main='using regular colors')
dotPlot(marioKart$totalPr[used], at=2, add=TRUE, col=rgb(0,0,1),
	pch=20, cex=2)
dotPlot(marioKart$totalPr[new], ylim=c(0,3), xlim=c(25, 80),
	col=rgb(1,0,0,1/8), pch=20, cex=2,
	main='fading the colors first')
dotPlot(marioKart$totalPr[used], at=2, add=TRUE,
	col=rgb(0,0,1,1/8), pch=20, cex=2)

JECheadle/RSOC317L documentation built on May 15, 2019, 4:02 a.m.