def _xyz_to_uv(x: float, y: float, z: float) -> tuple[float, float]:
    """Convert the color from CIEXYZ coordinates to uv chromaticity coordinates."""
    if x == y == 0:
        return 0, 0
    d = x + 15 * y + 3 * z
    return 4 * x / d, 9 * y / d