code: def _rainbow_line(
              self, text, freq=0.1, spread=3.0, offset=0,
              rgb_mode=False, **colorargs):
          
          fore = colorargs.get('fore', None)
          back = colorargs.get('back', None)
          style = colorargs.get('style', None)
          if fore:
              color_args = (lambda value: {
                  'back': value if rgb_mode else hex2term(value),
                  'style': style,
                  'fore': fore
              })
          else:
              color_args = (lambda value: {
                  'fore': value if rgb_mode else hex2term(value),
                  'style': style,
                  'back': back
              })
  
          if rgb_mode:
              method = self._rainbow_rgb_chars
          else:
              method = self._rainbow_hex_chars
          return ''.join(
              self.color(c, **color_args(hval))
              for c, hval in method(
                  text,
                  freq=freq,
                  spread=spread,
                  offset=offset)
          )
docs: Create rainbow using the same offset for all text.
              Arguments:
                  text       : String to colorize.
                  freq       : Frequency/"tightness" of colors in the rainbow.
                               Best results when in the range 0.0-1.0.
                               Default: 0.1
                  spread     : Spread/width of colors.
                               Default: 3.0
                  offset     : Offset for start of rainbow.
                               Default: 0
                  rgb_mode   : If truthy, use RGB escape codes instead of
                               extended 256 and approximate hex match.
              Keyword Arguments:
                  colorargs  : Any extra arguments for the color function,
                               such as fore, back, style.
                               These need to be treated carefully to not
                              'overwrite' the rainbow codes.