code: def _get_grid_colors(grid_proba, grid_pred, class_values, colors):
      """
      For the grid locations, return a list of colors, one per location
      indicating the class color.  To compute the probability color,
      we want to simulate overlaying regions from multiple trees onto
      the two-dimensional feature space using alpha to shade the colors.
      Instead, compute the color for each tile by combining the class colors
      according to their probabilities. If class 1 has probability .3 and class 2
      has probability .7, multiply the color ((R,G,B) color vector) associated
      with class 1 by .3 and the color vector associated with class 2 by .7 then
      add together. This gives a weighted color vector for each tile associated with
      the class probabilities. This gives the exact same effect as alpha channels,
      but transparent colors screwed up plotting the instance circles on top; they
      got washed out. This gives us more control and we can use alpha=1.
      """
      nclasses = len(class_values)
      class_colors = np.array(colors["classes"][nclasses])
  
      grid_pred_colors = class_colors[
          grid_pred
      ]  # color for each prediction in grid
  
      color_map = {
          v: class_colors[i] for i, v in enumerate(class_values)
      }
      # multiply each probability vector times rgb color for each class then add
      # together to get weighted color
      rgb = np.array(
          [ImageColor.getcolor(c, mode="RGB") for c in class_colors]
      )
      grid_proba_colors = grid_proba @ rgb
      grid_proba_colors /= 255  # get in [0..1]
      grid_proba_colors = [Color(rgb=c).hex for c in grid_proba_colors]
      return color_map, grid_pred_colors, grid_proba_colors
  
file_path: dtreeviz/dtreeviz/classifiers.py
imports: from typing import Tuple
  import matplotlib.pyplot
  import numpy
  import pandas
  from PIL import ImageColor
  from colour import Color
  from matplotlib import patches
  from matplotlib.collections import PatchCollection
  from dtreeviz import utils
  from dtreeviz.colors import adjust_colors
  from dtreeviz.utils import add_classifier_legend, _format_axes
label_desc: Use image node_id 4 for calling a global function with example usage: _get_grid_colors(grid_proba, grid_pred, class_values, colors) and returns: color_map,  grid_pred_colors,  grid_proba_colors