docs: def gradient(
              self, text=None, name=None, fore=None, back=None, style=None,
              freq=0.1, spread=None, linemode=True,
              movefactor=2, rgb_mode=False):
          """ Return a gradient by color name. Uses rainbow() underneath to
              build the gradients, starting at a known offset.
              Arguments:
                  text       : Text to make gradient (self.data when not given).
                               The gradient text is joined to self.data when
                               this is used.
                  name       : Color name for the gradient (same as fore names).
                               Default: black
                  fore       : Fore color. Back will be gradient when used.
                               Default: None (fore is gradient)
                  back       : Back color. Fore will be gradient when used.
                               Default: None (back=reset/normal)
                  style      : Style for the gradient.
                               Default: None (reset/normal)
                  freq       : Frequency of color change.
                               Higher means more colors.
                               Best when in the 0.0-1.0 range.
                               Default: 0.1
                  spread     : Spread/width of each color (in characters).
                               Default: 3.0 for colors, 1 for black/white
                  linemode   : Colorize each line in the input.
                               Default: True
                  movefactor : Factor for offset increase on each line when
                               using linemode.
                               Minimum value: 0
                               Default: 2
                  rgb_mode   : Use true color (rgb) codes.
          """
          try:
              # Try explicit offset (passed in with `name`).
              offset = int(name)
          except (TypeError, ValueError):
              name = name.lower().strip() if name else 'black'
              # Black and white are separate methods.
              if name == 'black':
                  return self.gradient_black(
                      text=text,
                      fore=fore,
                      back=back,
                      style=style,
                      step=int(spread) if spread else 1,
                      linemode=linemode,
                      movefactor=movefactor,
                      rgb_mode=rgb_mode
                  )
              elif name == 'white':
                  return self.gradient_black(
                      text=text,
                      fore=fore,
                      back=back,
                      style=style,
                      step=int(spread) if spread else 1,
                      linemode=linemode,
                      movefactor=movefactor,
                      reverse=True,
                      rgb_mode=rgb_mode
                  )
              try:
                  # Get rainbow offset from known name.
                  offset = self.gradient_names[name]
              except KeyError:
                  raise ValueError('Unknown gradient name: {}'.format(name))
  
          return self.rainbow(
              text=text,
              fore=fore,
              back=back,
              style=style,
              offset=offset,
              freq=freq,
              spread=spread or 3.0,
              linemode=linemode,
              movefactor=movefactor,
              rgb_mode=rgb_mode,
          )