Skip to content
Prev 325272 / 398503 Next

grDevices::convertColor XYZ space is it really xyY?

You seem to treating the input values as xyY when they should be XYZ
(case matters).
So, I would do something like this

D65 <- c(0.3127, 0.329, 0.3583)

X <- 100 * D65[1]
Y <- 100 * D65[2]
Z <- 100 * D65[3]
XYZ <- data.frame(X = X, Y = Y, Z = Z)

convertColor(XYZ, from = "XYZ", to = "sRGB")
      [,1] [,2] [,3]
[1,]    1    1    1


Quoting Bryan Hanson <hanson at depauw.edu>: