def xyz_to_rgb(x, y=None, z=None):
if type(x) in [list,tuple]:<EOL><INDENT>x, y, z = x<EOL><DEDENT>r =  (x * <NUM_LIT>) - (y * <NUM_LIT>) - (z * <NUM_LIT>)<EOL>g = -(x * <NUM_LIT>) + (y * <NUM_LIT>) + (z * <NUM_LIT>)<EOL>b =  (x * <NUM_LIT>) - (y * <NUM_LIT>) + (z * <NUM_LIT>)<EOL>return tuple((((v <= _srgbGammaCorrInv) and [v * <NUM_LIT>] or [(<NUM_LIT> * (v ** (<NUM_LIT:1>/<NUM_LIT>))) - <NUM_LIT>])[<NUM_LIT:0>] for v in (r, g, b)))<EOL>
Convert the color from CIE XYZ coordinates to sRGB.

    .. note::

       Compensation for sRGB gamma correction is applied before converting.

    Parameters:
      :x:
        The X component value [0...1]
      :y:
        The Y component value [0...1]
      :z:
        The Z component value [0...1]

    Returns:
      The color as an (r, g, b) tuple in the range:
      r[0...1],
      g[0...1],
      b[0...1]

    >>> '(%g, %g, %g)' % xyz_to_rgb(0.488941, 0.365682, 0.0448137)
    '(1, 0.5, 6.81883e-08)'