code: def _get_color_rgb(
      color_string: Any, alpha: float
  ) -> Tuple[int, int, int, int]:
      if color_string[0] == "#" and len(color_string) == 7:
          # When color string is a hex string
          color_hex = color_string.lstrip("#")
          return (
              *tuple(int(color_hex[i : i + 2], 16) for i in (0, 2, 4)),
              int(255 * alpha),
          )
      else:
          try:
              rgb = ImageColor.getrgb(color_string)
              return rgb + (int(255 * alpha),)
          except:
              # ImageColor.getrgb will throw an ValueError when the color is not
              # a valid color string, even if it is in other formats supported by
              # PIL. As such, we return the color as it is if the first two cases
              # are not valid.
              return color_string
  
imports: from typing import List, Optional, Union, Dict, Any, Tuple, Dict
  import functools
  import os
  import sys
  from itertools import cycle
  import numpy
  from PIL import Image, ImageFont, ImageDraw, ImageColor
  import layoutparser
  from .elements import Layout, Interval, Rectangle, TextBlock, Quadrilateral
  from .elements.utils import cvt_coordinates_to_points
label_desc: Use image node_id 6 for calling a global function with example usage: _get_color_rgb(color_string, alpha) and returns: unknown,  int, unknown, color_string