code: def hex_to_rgb(x):
      """Convert a color hexcode to an rgb tuple.
  
      Example
      -------
      >>> rgb('#FFFFFF')
      (255, 255, 255)
      """
      if not (x.startswith("#") and len(x) == 7):
          raise ValueError("Invalid hex color")
      x = x.strip("#")
      try:
          return (int(x[:2], 16), int(x[2:4], 16), int(x[4:], 16))
      except ValueError:
          raise ValueError("Invalid hex color")
  
imports: from __future__ import annotations
label_desc: Use image node_id 1 for calling a global function with example usage: hex_to_rgb(x) and returns: int,  int,  int