From a0f8f3d9b4c3fd81672415d1a8766d377dac65cf Mon Sep 17 00:00:00 2001 From: lyndsiWilliams Date: Wed, 2 Nov 2022 15:06:27 -0500 Subject: [PATCH 1/2] Change downloadAsImage to use superset theme --- superset-frontend/src/utils/downloadAsImage.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/superset-frontend/src/utils/downloadAsImage.ts b/superset-frontend/src/utils/downloadAsImage.ts index 145fb86508acf..0cfeca667017a 100644 --- a/superset-frontend/src/utils/downloadAsImage.ts +++ b/superset-frontend/src/utils/downloadAsImage.ts @@ -19,15 +19,9 @@ import { SyntheticEvent } from 'react'; import domToImage from 'dom-to-image-more'; import kebabCase from 'lodash/kebabCase'; -import { t } from '@superset-ui/core'; +import { t, supersetTheme } from '@superset-ui/core'; import { addWarningToast } from 'src/components/MessageToasts/actions'; -/** - * @remark - * same as https://github.com/apache/superset/blob/c53bc4ddf9808a8bb6916bbe3cb31935d33a2420/superset-frontend/src/assets/stylesheets/less/variables.less#L34 - */ -const GRAY_BACKGROUND_COLOR = '#F5F5F5'; - /** * generate a consistent file stem from a description and date * @@ -77,7 +71,7 @@ export default function downloadAsImage( return domToImage .toJpeg(elementToPrint, { quality: 0.95, - bgcolor: GRAY_BACKGROUND_COLOR, + bgcolor: supersetTheme.colors.primary.light3, filter, }) .then(dataUrl => { From 34ab7e753991aa3f61d5f13819bb7db70ced9a42 Mon Sep 17 00:00:00 2001 From: lyndsiWilliams Date: Wed, 2 Nov 2022 18:03:22 -0500 Subject: [PATCH 2/2] Changed bgcolor to use correct gray --- superset-frontend/src/utils/downloadAsImage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/src/utils/downloadAsImage.ts b/superset-frontend/src/utils/downloadAsImage.ts index 0cfeca667017a..de7454364637b 100644 --- a/superset-frontend/src/utils/downloadAsImage.ts +++ b/superset-frontend/src/utils/downloadAsImage.ts @@ -71,7 +71,7 @@ export default function downloadAsImage( return domToImage .toJpeg(elementToPrint, { quality: 0.95, - bgcolor: supersetTheme.colors.primary.light3, + bgcolor: supersetTheme.colors.grayscale.light4, filter, }) .then(dataUrl => {