class_docstr: Visualizer that draws data about detection on images.
  
  It contains methods like `draw_{text,box}`
  that draw primitive objects to images, as well as high-level wrappers like
  `draw_{instance_predictions}` that draw composite data in some pre-defined style.
  
  Note that the exact visualization style for the high-level wrappers are subject to change.
  Style such as color, opacity, label contents, visibility of labels, or even the visibility
  of objects themselves (e.g. when the object is too small) may change according
  to different heuristics, as long as the results still look visually reasonable.
  
  To obtain a consistent style, you can implement custom drawing functions with the
  abovementioned primitive methods instead.  This class does not intend to satisfy
  everyone's preference on drawing styles.
  
  This visualizer focuses on high rendering quality rather than performance. It is not
  designed to be used for real-time applications.
class_docstr_tok: ["Visualizer","that","draws","data","about","detection","on","images",".","It","contains","methods","like","`","draw_","{","text",",","box","}","`","that","draw","primitive","objects","to","images",",","as","well","as","high-level","wrappers","like","`","draw_","{","instance_predictions","}","`","that","draw","composite","data","in","some","pre-defined","style",".","Note","that","the","exact","visualization","style","for","the","high-level","wrappers","are","subject","to","change",".","Style","such","as","color",",","opacity",",","label","contents",",","visibility","of","labels",",","or","even","the","visibility","of","objects","themselves","(","e.g",".","when","the","object","is","too","small",")","may","change","according","to","different","heuristics",",","as","long","as","the","results","still","look","visually","reasonable",".","To","obtain","a","consistent","style",",","you","can","implement","custom","drawing","functions","with","the","abovementioned","primitive","methods","instead",".","This","class","does","not","intend","to","satisfy","everyone","'s","preference","on","drawing","styles",".","This","visualizer","focuses","on","high","rendering","quality","rather","than","performance",".","It","is","not","designed","to","be","used","for","real-time","applications","."]
docstr: Depending on the brightness_factor, gives a lighter or darker color i.e. a color with
  less or more saturation than the original color.
  
  Parameters
  ----------
  color: color of the polygon. Refer to `matplotlib.colors` for a full list of
      formats that are accepted.
  brightness_factor (float): a value in [-1.0, 1.0] range. A lightness factor of
      0 will correspond to no change, a factor in [-1.0, 0) range will result in
      a darker color and a factor in (0, 1.0] range will result in a lighter color.
  
  Returns
  -------
  modified_color (tuple[double]): a tuple containing the RGB values of the
      modified color. Each value in the tuple is in the [0.0, 1.0] range.
code: def _change_color_brightness(self, color, brightness_factor):
      """
      Depending on the brightness_factor, gives a lighter or darker color i.e. a color with
      less or more saturation than the original color.
  
      Parameters
      ----------
      color: color of the polygon. Refer to `matplotlib.colors` for a full list of
          formats that are accepted.
      brightness_factor (float): a value in [-1.0, 1.0] range. A lightness factor of
          0 will correspond to no change, a factor in [-1.0, 0) range will result in
          a darker color and a factor in (0, 1.0] range will result in a lighter color.
  
      Returns
      -------
      modified_color (tuple[double]): a tuple containing the RGB values of the
          modified color. Each value in the tuple is in the [0.0, 1.0] range.
      """
      assert brightness_factor >= -1.0 and brightness_factor <= 1.0
      color = mplc.to_rgb(color)
      polygon_color = colorsys.rgb_to_hls(*mplc.to_rgb(color))
      modified_lightness = polygon_color[1] + (
          brightness_factor * polygon_color[1]
      )
      modified_lightness = (
          0.0 if modified_lightness < 0.0 else modified_lightness
      )
      modified_lightness = (
          1.0 if modified_lightness > 1.0 else modified_lightness
      )
      modified_color = colorsys.hls_to_rgb(
          polygon_color[0], modified_lightness, polygon_color[2]
      )
      return modified_color
  
imports: import collections
  import colorsys
  import logging
  import re
  from enum import Enum, unique
  from typing import List
  import matplotlib
  import matplotlib.colors
  import matplotlib.figure
  import matplotlib.pyplot
  import numpy
  import pandas
  from matplotlib.backends.backend_agg import FigureCanvasAgg
  from PIL import Image
  from .colormap import random_color
  from .misc import merge_spans
label_desc: Use image node_id 8 for calling the ObjectDetectionVisualizer obj's underlying member method code with example usage: obj._change_color_brightness(color, brightness_factor) and returns: modified_color