Title: | Give Colors a Name |
---|---|
Description: | A tool for transforming coordinates in a color space to common color names using data from the Royal Horticultural Society and the International Union for the Protection of New Varieties of Plants. |
Authors: | Marco Sánchez Beeckman [aut, cre] |
Maintainer: | Marco Sánchez Beeckman <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-08 03:11:50 UTC |
Source: | https://github.com/msanchez-beeckman/colornamer |
Get the CIE76 color difference between two CIELab values.
cie76(lab_color1, lab_color2)
cie76(lab_color1, lab_color2)
lab_color1 |
A vector with three components corresponding to a Lab value. |
lab_color2 |
A vector with three components corresponding to another Lab value. |
The CIE76 color difference between the two given values.
Sharma, G., & Bala, R. (Eds.). (2017). Digital color imaging handbook. CRC press.
Get the CIE94 color difference between two CIELab values.
cie94( lab_color1, lab_color2, k_L = 1, k_C = 1, k_H = 1, K1 = 0.045, K2 = 0.015, symmetric = FALSE )
cie94( lab_color1, lab_color2, k_L = 1, k_C = 1, k_H = 1, K1 = 0.045, K2 = 0.015, symmetric = FALSE )
lab_color1 |
A vector with three components corresponding to a Lab value. |
lab_color2 |
A vector with three components corresponding to another Lab value. |
k_L |
Weighting factor for the L component. |
k_C |
Weighting factor for the C component. |
k_H |
Weighting factor for the H component. |
K1 |
Application dependent weighting factor. |
K2 |
Application dependent weighting factor. |
symmetric |
If TRUE, use the symmetric version of the formula. |
The CIE94 color difference between the two given values.
Sharma, G., & Bala, R. (Eds.). (2017). Digital color imaging handbook. CRC press.
Get the CIEDE2000 color difference between two CIELab values.
ciede2000(lab_color1, lab_color2, k_L = 1, k_C = 1, k_H = 1)
ciede2000(lab_color1, lab_color2, k_L = 1, k_C = 1, k_H = 1)
lab_color1 |
A vector with three components corresponding to a Lab value. |
lab_color2 |
A vector with three components corresponding to another Lab value. |
k_L |
Weighting factor for the L component. |
k_C |
Weighting factor for the C component. |
k_H |
Weighting factor for the H component. |
The CIEDE2000 color difference between the two given values.
Sharma, G., Wu, W., & Dalal, E. N. (2005). The CIEDE2000 color-difference formula: Implementation notes, supplementary test data, and mathematical observations. Color Research & Application: Endorsed by Inter-Society Color Council, The Colour Group (Great Britain), Canadian Society for Color, Color Science Association of Japan, Dutch Society for the Study of Color, The Swedish Colour Centre Foundation, Colour Society of Australia, Centre Français de la Couleur, 30(1), 21-30.
Get the color difference between values in the CIELab color space.
colordiff(color, reference, metric = "CIEDE2000", ...)
colordiff(color, reference, metric = "CIEDE2000", ...)
color |
A matrix whose rows specify color coordinates in the CIELab color space. |
reference |
A reference color. |
metric |
The color metric, between CIE76, CIE94, and CIEDE2000. |
... |
Weighting factors |
The color difference between the two given values.
Sharma, G., & Bala, R. (Eds.). (2017). Digital color imaging handbook. CRC press. Sharma, G., Wu, W., & Dalal, E. N. (2005). The CIEDE2000 color-difference formula: Implementation notes, supplementary test data, and mathematical observations. Color Research & Application: Endorsed by Inter-Society Color Council, The Colour Group (Great Britain), Canadian Society for Color, Color Science Association of Japan, Dutch Society for the Study of Color, The Swedish Colour Centre Foundation, Colour Society of Australia, Centre Français de la Couleur, 30(1), 21-30.
colordiff(rbind(c(50, 2.6772, -79.7751), c(50, 3.1571, -77.2803), c(50, 2.8361, -74.0200)), c(50, 0, -82.7485)) colordiff(rbind(c(50, 2.6772, -79.7751), c(50, 3.1571, -77.2803), c(50, 2.8361, -74.0200)), c(50, 0, -82.7485), metric="CIE94") colordiff(rbind(c(50, 2.6772, -79.7751), c(50, 3.1571, -77.2803), c(50, 2.8361, -74.0200)), c(50, 0, -82.7485), metric="CIE94", symmetric=TRUE)
colordiff(rbind(c(50, 2.6772, -79.7751), c(50, 3.1571, -77.2803), c(50, 2.8361, -74.0200)), c(50, 0, -82.7485)) colordiff(rbind(c(50, 2.6772, -79.7751), c(50, 3.1571, -77.2803), c(50, 2.8361, -74.0200)), c(50, 0, -82.7485), metric="CIE94") colordiff(rbind(c(50, 2.6772, -79.7751), c(50, 3.1571, -77.2803), c(50, 2.8361, -74.0200)), c(50, 0, -82.7485), metric="CIE94", symmetric=TRUE)
Get information about the closest RHS color to some CIELab coordinates.
get_closest_color(L, a, b, metric = "CIEDE2000")
get_closest_color(L, a, b, metric = "CIEDE2000")
L |
The lightness L* of the color. |
a |
The chromatic component a* (red-green). |
b |
The chromatic component b* (blue-yellow). |
metric |
The color distance to use. |
A one-row tibble.
get_closest_color(65, 20, -20)
get_closest_color(65, 20, -20)
Name a color given its coordinates in a specified color space.
name(color, colorspace = "Lab", illuminant = NULL, language = "english")
name(color, colorspace = "Lab", illuminant = NULL, language = "english")
color |
A matrix whose rows specify colors. |
colorspace |
The color space the coordinates of the colors are in. |
illuminant |
The reference white, or |
language |
The language of the color name, between English, French, German, and Spanish. |
The available color spaces are "XYZ"
, "sRGB"
, "Apple RGB"
, "CIE RGB"
, "Luv"
, and "Lab"
(default).
If the color space is an RGB variant, the coordinates must take values between 0 and 1.
The name of the color, according to the UPOV.
name(c(65, 20, -20)) name(c(65, 20, -20), language="Spanish") name(c(65, 20, -20), language="es") name(c(244/255, 234/255, 184/255), colorspace="sRGB") name(rbind(c(65, 20, -20), c(69, 4, -31)))
name(c(65, 20, -20)) name(c(65, 20, -20), language="Spanish") name(c(65, 20, -20), language="es") name(c(244/255, 234/255, 184/255), colorspace="sRGB") name(rbind(c(65, 20, -20), c(69, 4, -31)))
Data set containing English, French, German, and Spanish names for the colors defined by the RHS in its sixth edition (2015), alongside their UPOV group number.
rhs_color_names_2015
rhs_color_names_2015
A data frame with 920 rows and 10 variables:
the UPOV group of the color
the RHS code of the color
the English name for the color
the French name for the color
the German name for the color
the Spanish name for the color
UPOV https://www.upov.int/meetings/en/doc_details.jsp?meeting_id=50790&doc_id=426293
Data set containing the coordinates in RGB, CIELab, and CIELCh of the colors defined by the Royal Horticultural Society in its fifth edition (2007).
rhs_color_values_2007
rhs_color_values_2007
A data frame with 892 rows and 10 variables:
the RHS code of the color
the red component in sRGB
the green component in sRGB
the blue component in sRGB
the lightness component in CIELab (D65 / 10º)
the red-green component in CIELab (D65 / 10º)
the blue-yellow component in CIELab (D65 / 10º)
the lightness component in CIELCh (D65 / 10º)
the colorfulness component in CIELCh (D65 / 10º)
the hue in CIELCh (D65 / 10º)