RGB - HEX Color Code Converter. This interactive online color conversion tool allows you to calculate the transition between RGB and HEX values. Input one of the codes to convert it to the other one instantly. A successful conversion changes the background color of the page and generates CSS code snippets for quick use. For Munsell to RGB conversion, a vector of R colors is returned that is the same length as the input data. For RGB to Munsell conversion, a dataframe (NA-padded) of hue, value, chroma, and Euclidean distance to nearest matching color is returned. The is a simple online tool that lets you browse the Munsell color notation in your web browser.
The Munsell color system was designed as a series of discrete color chips which closely approximation to the color sensitivity of the human eye. The description of color via three variables tied to perceptible properties (hue, value, and chroma) under a standardized illuminant (sunlight on a clear day) makes the Munsell system a good choice for recording and interpreting soil color data. However, numerical analysis of colors encoded in the Munsell system is difficult because they are from a discrete set of color chips and referenced by values that include both letters and numbers. Rossel et. al. (2006) give a good background on various color space models and their relative usefulness in the realm of soil science. The conversion of Munsell soil colors to RGB triplets, suitable for displaying on a computer screen or printing, is made complicated by the numerous operations involved in converting between color spaces. Figure 1 shows all possible (both real and unreal) Munsell color chips in the L*U*V color space. Figure 2 shows some of the common soil color chips in the same color space. Figures 2 through 5 depict common soil colors in the RGB color space, visualized both in R and POVRAY. Example R code on the conversion is given below.
Munsell color data can be downloaded here.
Color conversion equations here.
Figure 1: Munsell color chips. | Figure 2: Common soil colors. | Figure 3: Commom soil colors in RGB | Figure 4: Soil colors in multiple color spaces |
Figure 5: Soil profile colors. |
References:
- Rossel, R.A.V.; Minasny, B.; Roudier, P. & McBratney, A.B. Colour space models for soil science Geoderma, 2006, 133, 320-337.
Manual Conversion in R
Setup environment and load lookup table data
Convert xyY to XYZ [Equation Reference]
Perform Chromatic Adaption Functions in the colorspace package, and sRGB profiles assume a D65 illuminant [Reference]
Convert XYZ (D65) to sRGB (D65), step 1 this assumes that XYZ is scaled to (0,1) [Reference Primaries for sRGB]
Convert XYZ (D65) to sRGB (D65), step 2 (sRGB, gamma = 2.4) [Conversion Function to sRGB]