def sRGBToLinearRGB(color):
  """ Convert a grayscale value (single channel) value from sRGB to Linear """
  # Note that range of input should be 0 to 1
  if color < 0:
    return 0
  elif color < 0.04045:
    return color/12.92
  else:
    return (((color + 0.055) / 1.055) ** 2.4)