code: function findBackgroundColor(element) {
    if (element == null || element instanceof Document) {
      // This element has no background, assume white.
      return 'rgb(255,255,255)';
    }
    // @ts-ignore
    if (element instanceof ShadowRoot) {
      return findBackgroundColor(element.host);
    }
    const backgroundColor = getComputedStyle(element).backgroundColor;
    if (backgroundColor === 'transparent' || backgroundColor === 'rgba(0, 0, 0, 0)') {
      const parent = element.assignedSlot || element.parentNode || element.host;
      return findBackgroundColor(parent);
    } else {
      return backgroundColor;
    }
  }
docs: Return the background color of the given element. If the color is "transparent" (the default in Mozilla) or "rgba(0, 0, 0, 0)" (the default transparent value in Blink and Webkit), walk up the parent chain until a non-transparent color is found.