I have an issue converting an XYZ value to RGB and back, it seems that for some values this works, but for others not. I checked the xyz.max value and all my X/Y/Z values are within range, so that should not be the issue.
This conversion matches (after rounding):
const startXYZ = [47.854955042890886, 29.320696241557958, 21.87902240817543]
const _rgb = colorSpace.xyz.rgb(startXYZ);
const endXYZ = colorSpace.rgb.xyz(_rgb) // => [ 47.854955042890005, 29.320696241558192, 21.879022408175473 ]
However, the following conversion is a mismatch (and quite some other value):
const startXYZ = [ 20, 87, 79 ]
const _rgb = colorSpace.xyz.rgb(startXYZ);
const endXYZ = colorSpace.rgb.xyz(_rgb) // => [ 47.82670703075629, 76.3441771137228, 75.47904959927504 ]
I have been fiddling with the color-convert library as well, but that seems to have the same result (https://github.com/Qix-/color-convert/issues/81). Is this a bug in the conversion algorithm?
I have an issue converting an XYZ value to RGB and back, it seems that for some values this works, but for others not. I checked the
xyz.maxvalue and all my X/Y/Z values are within range, so that should not be the issue.This conversion matches (after rounding):
However, the following conversion is a mismatch (and quite some other value):
I have been fiddling with the
color-convertlibrary as well, but that seems to have the same result (https://github.com/Qix-/color-convert/issues/81). Is this a bug in the conversion algorithm?