code: def parse_gradient_rgb_args(args):
      
      arglen = len(args)
      if arglen < 1 or arglen > 2:
          raise InvalidArg(arglen, label='Expecting 1 or 2 \'-G\' flags, got')
      start_rgb = try_rgb(args[0]) if args else None
      stop_rgb = try_rgb(args[1]) if arglen > 1 else None
      return start_rgb, stop_rgb
docs: Parse one or two rgb args given with --gradientrgb.
          Raises InvalidArg for invalid rgb values.
          Returns a tuple of (start_rgb, stop_rgb), where the stop_rgb may be
          None if only one arg value was given and start_rgb may be None if
          no values were given.