Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Color/getBackgroundColor

Index

Functions

Functions

getBackgroundColor

  • getBackgroundColor(el: HTMLElement): RgbColor | null
  • Traverses the dom upwards, beginning by the given element and extracts their background color. If the background color is transparent it will be ignored and the search continues. The traversing stops as soon as either the HTML node is reached or a background color was found.

    If a color was found, the rgb value will be returned, if no color was found or it was completely transparent NULL is returned

    Parameters

    • el: HTMLElement

    Returns RgbColor | null

Generated using TypeDoc