code: def rgb_from_hexstr(hexstr: str):
      """Create a Color instance from a hex string like #ffaa22 or #11aa88ff.
  
      Supports both long and short form (i.e. #ffffff is the same as #fff), and also an optional
      alpha value (e.g. #112233ff or #123f).
      """
      if hexstr[0] == "#":  # get rid of leading #
          hexstr = hexstr[1:]
      if len(hexstr) == 3:
          r = int(hexstr[0], 16) / 15.0
          g = int(hexstr[1], 16) / 15.0
          b = int(hexstr[2], 16) / 15.0
          return r, g, b
      elif len(hexstr) == 4:
          r = int(hexstr[0], 16) / 15.0
          g = int(hexstr[1], 16) / 15.0
          b = int(hexstr[2], 16) / 15.0
          a = int(hexstr[3], 16) / 15.0
          return r, g, b
      elif len(hexstr) == 6:
          r = int(hexstr[0:2], 16) / 255.0
          g = int(hexstr[2:4], 16) / 255.0
          b = int(hexstr[4:6], 16) / 255.0
          return r, g, b
      elif len(hexstr) == 8:
          r = int(hexstr[0:2], 16) / 255.0
          g = int(hexstr[2:4], 16) / 255.0
          b = int(hexstr[4:6], 16) / 255.0
          a = int(hexstr[6:8], 16) / 255.0
          return r, g, b
      else:
          raise ValueError("invalid color hex string")
  
imports: import dataclasses
  import json
  import logging
  import imageio
  import numpy
  import png
  import tensorflow
  import tensorflow_datasets.public_api
  from typing import List, Dict, Union
label_desc: Use image node_id 16 for calling a global function with example usage: rgb_from_hexstr(hexstr) and returns: r,  g,  b, r,  g,  b, r,  g,  b, r,  g,  b