code: def to_color_strings(colors):
      """Return a list of colors as hex strings."""
      cmap = mpl.colors.ListedColormap(colors)
      colors = cmap(np.arange(cmap.N))[:, :3]
      colors = np.asarray(colors * 255, dtype="uint8")
      colors = [
          f"#{int(row[0]):02x}{int(row[1]):02x}{int(row[2]):02x}"
          for row in colors
      ]
      return colors
  
file_path: nilearn/nilearn/plotting/js_plotting_utils.py
imports: import base64
  import os
  import warnings
  from string import Template
  import matplotlib
  import matplotlib.pyplot
  import numpy
  from nilearn.plotting.html_document import HTMLDocument, set_max_img_views_before_warning
  from ..None import surface
  from .._utils.extmath import fast_abs_percentile
  from .._utils.param_validation import check_threshold
label_desc: Use image node_id 7 for calling a global function with example usage: to_color_strings(colors) and returns: colors