Skip to content

Commit

Permalink
removing / fixing references to rgb2Munsell() #297
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbeaudette committed Oct 11, 2023
1 parent 7238e31 commit 2b2ab7f
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions R/colorQuantiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ colorQuantiles <- function(soilColors, p = c(0.05, 0.5, 0.95)) {
#' @param pt.cex scaling factor for color chips
#' @param lab.cex chip label scaling factor
#'
#' @return a \code{lattice} graphics object
#' @return a `lattice` graphics object
#'
#' @details Marginal percentiles and L1 median CIELAB values from \code{colorQuantiles} are combined into a single plot, arranged in panels according to L, A, and B coordinates. Munsell "chips" (colors and labels) are based on the closest Munsell color found via \code{rgb2Munsell}.
#' @details Marginal percentiles and L1 median CIELAB values from `colorQuantiles()` are combined into a single plot, arranged in panels according to L, A, and B coordinates. Munsell "chips" (colors and labels) are based on the closest Munsell color found via [col2Munsell()].
#'
#' @author D.E. Beaudette
#'
Expand Down
5 changes: 5 additions & 0 deletions R/estimateSoilColor.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ estimateSoilColor <- function(hue, value, chroma, sourceMoistureState = c('dry',
## CIELAB -> closest Munsel
res <- col2Munsell(Y, space = 'CIELAB', nClosest = 1)

## no longer required since col2Munsell() ##

# ## CIELAB -> sRGB
# ## TODO: why does farver give slightly different results?
#
Expand All @@ -103,6 +105,9 @@ estimateSoilColor <- function(hue, value, chroma, sourceMoistureState = c('dry',
# ## sRGB -> Munsell
# res <- rgb2munsell(color = .srgb, colorSpace = 'CIE2000', nClosest = 1)

###


## additional diagnostics... ?

return(res)
Expand Down
4 changes: 2 additions & 2 deletions R/mixMunsell.R
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ mixMunsell <- function(x, w = rep(1, times = length(x)) / length(x), mixingMetho
# XYZ -> sRGB -> Munsell
mx <- spec2Munsell(mixed, ...)

# NOTE: ... are passed to rgb2munsell()
# NOTE: ... are passed to col2munsell()
# convert = TRUE: mx is a data.frame
# convert = FALSE: mx is a matrix

Expand Down Expand Up @@ -406,7 +406,7 @@ mixMunsell <- function(x, w = rep(1, times = length(x)) / length(x), mixingMetho
# https://cran.r-project.org/web/packages/gower/vignettes/intro.pdf
# would make sense to reshape reference data

# NOTE: arguments to rgb2munsell() are silently ignored
# NOTE: arguments to col2munsell() are silently ignored

## TODO: time wasted here
# reshape reference spectra: wavelength to columns
Expand Down
4 changes: 2 additions & 2 deletions R/spec2Munsell.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#' * D65 represents average daylight
#' * F2 represents typical fluorescent lighting
#'
#' @param ... further arguments to [col2munsell()]
#' @param ... further arguments to [col2Munsell()]
#'
#' @return output from [col2munsell()]
#' @return output from [col2Munsell()]
#' @export
#'
#' @references
Expand Down
2 changes: 1 addition & 1 deletion man/estimateSoilColor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/plotColorQuantiles.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/singlebracket.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/spec2Munsell.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b2ab7f

Please sign in to comment.