code: def create_color_stops(
      breaks, colors="RdYlGn", color_ramps=color_ramps
  ):
      """Convert a list of breaks into color stops using colors from colorBrewer
      or a custom list of color values in RGB, RGBA, HSL, CSS text, or HEX format.
      See www.colorbrewer2.org for a list of color options to pass
      """
  
      num_breaks = len(breaks)
      stops = []
  
      if isinstance(colors, list):
          # Check if colors contain a list of color values
          if len(colors) == 0 or len(colors) != num_breaks:
              raise ValueError(
                  "custom color list must be of same length as breaks list"
              )
  
          for color in colors:
              # Check if color is valid string
              try:
                  Colour(color)
              except:
                  raise ValueError(
                      "The color code {color} is in the wrong format".format(
                          color=color
                      )
                  )
  
          for i, b in enumerate(breaks):
              stops.append([b, colors[i]])
  
      else:
          if colors not in color_ramps.keys():
              raise ValueError("color does not exist in colorBrewer!")
          else:
              try:
                  ramp = color_ramps[colors][num_breaks]
              except KeyError:
                  raise ValueError(
                      "Color ramp {} does not have a {} breaks".format(
                          colors, num_breaks
                      )
                  )
  
              for i, b in enumerate(breaks):
                  stops.append([b, ramp[i]])
  
      return stops
  
imports: import base64
  import codecs
  import datetime
  from io import BytesIO
  import json
  import re
  from chroma import Color, Scale
  from colour import Color
  import geojson
  from matplotlib.image import imsave
  import requests
  from .colors import color_ramps, common_html_colors
  from .errors import SourceDataError, DateConversionError
label_desc: Use image node_id 10 for calling a global function with example usage: create_color_stops(breaks, colors, color_ramps) and returns: stops