fix: null backgroundColor option as transparent (#2012)

This commit is contained in:
Niklas von Hertzen 2019-09-21 21:45:05 -07:00 committed by GitHub
parent 00555cf1ef
commit 7d3456b78c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,7 +101,7 @@ const renderElement = async (element: HTMLElement, opts: Partial<Options>): Prom
: COLORS.TRANSPARENT; : COLORS.TRANSPARENT;
const bgColor = opts.backgroundColor; 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 = const backgroundColor =
element === ownerDocument.documentElement element === ownerDocument.documentElement