Skip to content

Commit

Permalink
tiny adjustments, CRAN release
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbeaudette committed Oct 17, 2024
1 parent 6f33dd0 commit b05a2eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# aqp 2.1.0 (2024-10-16)
* CRAN release
* added Munsell values of 8.5 and 9.5 to Munsell look up table and (interpolated) reference spectra (#318)
* `munsell2rgb()` now safely selects the closest Munsell value and chroma to those available in the package LUT
* new function `soilTextureColorPal()` for suggesting a color palette suitable for soil texture class
Expand Down
6 changes: 4 additions & 2 deletions vignettes/Munsell-color-conversion.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Soil color is most often described using the [Munsell color system](https://en.w

## Color Conversion Functions

Conversion of Munsell notation to "something" that can be displayed on-screen (sRGB color representation) is probably the most common color transformation applied to soil morphology data. The `munsell2rgb()` function is convenient for this operation when Munsell notation has been split into vectors of hue, value, and chroma. These could be columns in a `data.frame` or separate vectors. The `parseMunsell()` function is convenient when a full Munsell notation is given as a character vector. Note that `parseMunsell()` is a simplified wrapper to `munsell2rgb()`. For example, converting `10YR 4/6` with either function can return:
Conversion of Munsell notation to "something" that can be displayed on-screen (sRGB color representation) is probably the most common color transformation applied to soil morphology data. The `munsell2rgb()` function is convenient for this operation when Munsell notation has been split into vectors of hue, value, and chroma. These could be columns in a `data.frame` or separate vectors. The `parseMunsell()` function is convenient when a full Munsell notation is given as a character vector. Note that `parseMunsell()` is a wrapper to `munsell2rgb()`. For example, converting `10YR 4/6` with either function can return:

* hex-notation of a color: `#805921FF`, or
* sRGB color coordinates: `0.5002233 0.3489249 0.1287694`, or
* CIELAB color coordinates: `40.95021 10.31088 37.49513`
* CIELAB color coordinates: `40.95021 10.31088 37.49513`.


Selection of the closest `n` Munsell color "chips", given sRGB or CIELAB colorspace coordinates is performed with the `col2Munsell()` function. Input to this function can be colorspace coordinates, named colors (e.g. `red`), or hex-notation of a color. For example, the selection of the closest Munsell chip for CIELAB coordinates `(51.4337, 9.917916, 38.6889)` results in `10YR 5/6` with a reported sigma (error) of `1.5e-6`. This error is estimated as the [CIE2000 distance](https://en.wikipedia.org/wiki/Color_difference#CIEDE2000) between the source CIELAB coordinates and the CIELAB coordinates of the closest Munsell chip.
Expand Down Expand Up @@ -87,3 +87,5 @@ getClosestMunsellChip('3.3YR 4.4/6.1', convertColors = FALSE)
```




0 comments on commit b05a2eb

Please sign in to comment.