code: def convert_dict_colors_to_same_type(colors_dict, colortype="rgb"):
      """
      Converts a colors in a dictioanry of colors to the specified color type
  
      :param (dict) colors_dict: a dictioanry whose values are single colors
      """
      for key in colors_dict:
          if "#" in colors_dict[key]:
              colors_dict[key] = color_parser(
                  colors_dict[key], hex_to_rgb
              )
              colors_dict[key] = color_parser(
                  colors_dict[key], label_rgb
              )
  
          elif isinstance(colors_dict[key], tuple):
              colors_dict[key] = color_parser(
                  colors_dict[key], convert_to_RGB_255
              )
              colors_dict[key] = color_parser(
                  colors_dict[key], label_rgb
              )
  
      if colortype == "rgb":
          return colors_dict
      elif colortype == "tuple":
          for key in colors_dict:
              colors_dict[key] = color_parser(
                  colors_dict[key], unlabel_rgb
              )
              colors_dict[key] = color_parser(
                  colors_dict[key], unconvert_from_RGB_255
              )
          return colors_dict
      else:
          raise exceptions.PlotlyError(
              "You must select either rgb or tuple "
              "for your colortype variable."
          )
  
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 5 for calling a global function with example usage: convert_dict_colors_to_same_type(colors_dict, colortype) and returns: colors_dict, colors_dict