code: def __init__(self, *args):
      if len(args) == 2:
          self.colors = list(args)
          self.intervals = [0.0, 1.0]
      elif len(args) > 0:
          if len(args) % 2 != 0:
              raise ValueError("len(args) should be even")
          self.colors = [args[i] for i in range(1, len(args), 2)]
          self.intervals = [args[i] for i in range(0, len(args), 2)]
      assert len(self.colors) == len(self.intervals)
  
imports: from sympy.core.basic import Basic
  from sympy.core.symbol import Symbol, symbols
  from sympy.utilities.lambdify import lambdify
  from .util import interpolate, rinterpolate, create_bounds, update_bounds
  from sympy.utilities.iterables import sift
label_desc: Use image node_id 1 to create a new ColorGradient object  with example: obj = ColorGradient()