backgroundColor property

Color? backgroundColor

Implementation

Color? get backgroundColor {
  NodeV2? k = this;

  while (k != null) {
    if (k.styleProperty != null) {
      StyleProperty prop = k.styleProperty!;

      dynamic color = prop.getProperty("background-color");

      if (color != null) {
        try {
          return ColorUtils.colorForHex(color);
        } catch (e) {
          return TextConstants.defaultColor;
        }
      }
    }

    k = k.parent;
  }

  return null;
}