From 7d3456b78c37e7333db087601805b32ec7ca0253 Mon Sep 17 00:00:00 2001 From: Niklas von Hertzen Date: Sat, 21 Sep 2019 21:45:05 -0700 Subject: [PATCH] fix: null backgroundColor option as transparent (#2012) --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index b033223..271f510 100644 --- a/src/index.ts +++ b/src/index.ts @@ -101,7 +101,7 @@ const renderElement = async (element: HTMLElement, opts: Partial): Prom : COLORS.TRANSPARENT; const bgColor = opts.backgroundColor; - const defaultBackgroundColor = typeof bgColor === 'string' ? parseColor(bgColor) : 0xffffffff; + const defaultBackgroundColor = typeof bgColor === 'string' ? parseColor(bgColor) : bgColor === null ? COLORS.TRANSPARENT : 0xffffffff; const backgroundColor = element === ownerDocument.documentElement