code: def n_colors(lowcolor, highcolor, n_colors, colortype="tuple"):
      """
      Splits a low and high color into a list of n_colors colors in it
  
      Accepts two color tuples and returns a list of n_colors colors
      which form the intermediate colors between lowcolor and highcolor
      from linearly interpolating through RGB space. If colortype is 'rgb'
      the function will return a list of colors in the same form.
      """
      if colortype == "rgb":
          # convert to tuple
          lowcolor = unlabel_rgb(lowcolor)
          highcolor = unlabel_rgb(highcolor)
  
      diff_0 = float(highcolor[0] - lowcolor[0])
      incr_0 = diff_0 / (n_colors - 1)
      diff_1 = float(highcolor[1] - lowcolor[1])
      incr_1 = diff_1 / (n_colors - 1)
      diff_2 = float(highcolor[2] - lowcolor[2])
      incr_2 = diff_2 / (n_colors - 1)
      list_of_colors = []
  
      for index in range(n_colors):
          new_tuple = (
              lowcolor[0] + (index * incr_0),
              lowcolor[1] + (index * incr_1),
              lowcolor[2] + (index * incr_2),
          )
          list_of_colors.append(new_tuple)
  
      if colortype == "rgb":
          # back to an rgb string
          list_of_colors = color_parser(list_of_colors, label_rgb)
  
      return list_of_colors
  
imports: from __future__ import absolute_import
  import decimal
  from numbers import Number
  import six
  from _plotly_utils import exceptions
  from .None import qualitative, sequential, diverging, cyclical, cmocean, colorbrewer, carto, plotlyjs
label_desc: Use image node_id 12 for calling a global function with example usage: n_colors(lowcolor, highcolor, n_colors, colortype) and returns: list_of_colors