-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9822e7e
commit f9292b6
Showing
14 changed files
with
1,710 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 1,15 @@ | ||
Package: colorspace | ||
Version: 0.95 | ||
Date: 2006-11-16 | ||
Title: Colorspace Manipulation | ||
Author: Ross Ihaka <[email protected]> | ||
Version: 0.97 | ||
Date: 2008-10-25 | ||
Title: Color Space Manipulation | ||
Author: Ross Ihaka, Paul Murrell, Kurt Hornik, Achim Zeileis | ||
Maintainer: Ross Ihaka <[email protected]> | ||
Description: Carries out mapping between assorted color spaces including | ||
RGB, HSV, HLS, CIEXYZ, CIELUV, HCL (polar CIELUV), | ||
CIELAB and polar CIELAB. Qualitative, sequential, and | ||
diverging color palettes based on HCL colors are provided. | ||
Depends: R (>= 2.0.0), methods | ||
Description: Carries out mapping between assorted color spaces. | ||
Suggests: KernSmooth, MASS, kernlab, mvtnorm, vcd | ||
License: BSD | ||
URL: http://www.r-project.org | ||
LazyLoad: yes | ||
Packaged: Thu Nov 16 11:47:26 2006; ihaka | ||
Packaged: Fri Oct 24 23:50:24 2008; zeileis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 1,9 @@ | ||
useDynLib(colorspace) | ||
import(methods) | ||
importFrom(graphics, plot) | ||
exportClasses(color, RGB, HSV, XYZ, LAB, polarLAB, LUV, polarLUV) | ||
export(RGB, HSV, XYZ, LAB, polarLAB, LUV, polarLUV) | ||
export(mixcolor,coords) | ||
export(hex, hex2RGB, readRGB, readhex, writehex) | ||
exportMethods("[", coerce, coords, plot, show) | ||
useDynLib("colorspace") | ||
import("methods") | ||
importFrom("graphics", "plot") | ||
exportClasses("color", "RGB", "HSV", "HLS", "XYZ", "LAB", "polarLAB", "LUV", "polarLUV") | ||
export("RGB", "HSV", "HLS", "XYZ", "LAB", "polarLAB", "LUV", "polarLUV") | ||
export("mixcolor", "coords") | ||
export("hex", "hex2RGB", "readRGB", "readhex", "writehex") | ||
export("rainbow_hcl", "diverge_hcl", "diverge_hsv", "heat_hcl", "sequential_hcl", "terrain_hcl") | ||
exportMethods("[", "coerce", "coords", "plot", "show") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,8 @@ | ||
Changes in Version 0.96 | ||
|
||
o moved color palettes from vcd to colorspace, | ||
including vignette("hcl-colors") | ||
|
||
o added infrastructure for HLS color space | ||
|
||
o new CITATION file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,71 @@ | ||
rainbow_hcl <- function(n, c = 50, l = 70, start = 0, end = 360*(n-1)/n, | ||
gamma = 2.4, fixup = TRUE, ...) | ||
{ | ||
if(n > 0) hex(polarLUV(L = l, C = c, H = seq(start, end, length = n)), gamma = gamma, fixup = fixup, ...) | ||
else character(0) | ||
} | ||
|
||
diverge_hcl <- function(n, h = c(260, 0), c = 80, l = c(30, 90), power = 1.5, | ||
gamma = 2.4, fixup = TRUE, ...) | ||
{ | ||
if(n < 1) return(character(0)) | ||
h <- rep(h, length.out = 2) | ||
c <- c[1] | ||
l <- rep(l, length.out = 2) | ||
power <- rep(power, length.out = 2) | ||
rval <- seq(1, -1, length = n) | ||
rval <- hex(polarLUV(L = l[2] - diff(l) * abs(rval)^power[2], | ||
C = c * abs(rval)^power[1], | ||
H = ifelse(rval > 0, h[1], h[2])), | ||
gamma = gamma, fixup = fixup, ...) | ||
return(rval) | ||
} | ||
|
||
diverge_hsv <- function(n, h = c(240, 0), s = 1, v = 1, power = 1, | ||
gamma = 2.4, fixup = TRUE, ...) | ||
{ | ||
if(n < 1) return(character(0)) | ||
h <- rep(h, length.out = 2) | ||
s <- s[1] | ||
v <- v[1] | ||
power <- power[1] | ||
rval <- seq(-s, s, length = n) | ||
rval <- hex(HSV(H = ifelse(rval > 0, h[2], h[1]), S = abs(rval)^power, V = v, ...), | ||
gamma = gamma, fixup = fixup, ...) | ||
return(rval) | ||
} | ||
|
||
sequential_hcl <- function(n, h = 260, c. = c(80, 0), l = c(30, 90), power = 1.5, | ||
gamma = 2.4, fixup = TRUE, ...) | ||
{ | ||
if(n < 1) return(character(0)) | ||
c <- rep(c., length.out = 2) | ||
l <- rep(l, length.out = 2) | ||
power <- rep(power, length.out = 2) | ||
rval <- seq(1, 0, length = n) | ||
rval <- hex(polarLUV(L = l[2] - diff(l) * rval^power[2], | ||
C = c[2] - diff(c) * rval^power[1], | ||
H = h[1]), | ||
gamm = gamma, fixup = fixup, ...) | ||
return(rval) | ||
} | ||
|
||
heat_hcl <- function(n, h = c(0, 90), c. = c(100, 30), l = c(50, 90), | ||
power = c(1/5, 1), gamma = 2.4, fixup = TRUE, ...) | ||
{ | ||
if(n < 1) return(character(0)) | ||
h <- rep(h, length.out = 2) | ||
c <- rep(c., length.out = 2) | ||
l <- rep(l, length.out = 2) | ||
power <- rep(power, length.out = 2) | ||
rval <- seq(1, 0, length = n) | ||
rval <- hex(polarLUV(L = l[2] - diff(l) * rval^power[2], | ||
C = c[2] - diff(c) * rval^power[1], | ||
H = h[2] - diff(h) * rval), | ||
gamma = gamma, fixup = fixup, ...) | ||
return(rval) | ||
} | ||
|
||
terrain_hcl <- function(n, h = c(130, 0), c. = c(80, 0), l = c(60, 95), power = c(1/10, 1), | ||
gamma = 2.4, fixup = TRUE, ...) | ||
heat_hcl(n, h = h, c. = c., l = l, power = power, gamma = gamma, fixup = fixup, ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,45 @@ | ||
citHeader("To cite colorspace in publications use") | ||
|
||
## R >= 2.8.0 passes package metadata to citation(). | ||
if(!exists("meta") || is.null(meta)) meta <- packageDescription("colorspace") | ||
year <- sub("-.*", "", meta$Date) | ||
note <- sprintf("R package version %s", meta$Version) | ||
|
||
citEntry(entry = "Manual", | ||
title = "{colorspace}: Color Space Manipulation", | ||
author = personList(as.person("Ross Ihaka"), | ||
as.person("Paul Murrell"), | ||
as.person("Kurt Hornik"), | ||
as.person("Achim Zeileis")), | ||
year = year, | ||
note = note, | ||
url = "http://CRAN.R-project.org/package=colorspace", | ||
|
||
textVersion = | ||
paste("Ross Ihaka, Paul Murrell, Kurt Hornik, Achim Zeileis", | ||
sprintf("(%s).", year), | ||
"colorspace: Color Space Manipulation.", | ||
paste(note, ".", sep = ""), | ||
"URL http://CRAN.R-project.org/package=colorspace") | ||
) | ||
|
||
citEntry(entry = "TechReport", | ||
title = "Escaping {RGB}land: Selecting Colors for Statistical Graphics", | ||
author = personList(as.person("Achim Zeileis"), | ||
as.person("Kurt Hornik"), | ||
as.person("Paul Murrell")), | ||
institution = "Department of Statistics and Mathematics, Wirtschaftsuniversit\\\"at Wien, Research Report Series", | ||
year = "2007", | ||
type = "Report", | ||
number = "61", | ||
month = "November", | ||
url = "http://epub.wu-wien.ac.at/", | ||
|
||
textVersion = | ||
paste("Achim Zeileis, Kurt Hornik, Paul Murrell (2007).", | ||
"Escaping RGBland: Selecting Colors for Statistical Graphics.", | ||
"Report 61.", | ||
"Department of Statistics and Mathematics, Wirtschaftsuniversitaet Wien, Research Report Series.", | ||
"URL http://epub.wu-wien.ac.at/."), | ||
header = "If you use HCL-based color palettes, please cite:" | ||
) |
Oops, something went wrong.