From 0811ba4131e769f2df70483667235f82b779525d Mon Sep 17 00:00:00 2001 From: Jin-Hee Park <53548023+jhee564@users.noreply.github.com> Date: Thu, 3 Jun 2021 16:51:09 +0900 Subject: [PATCH] =?UTF-8?q?[#820]=20[3.0]=20Bar=20Chart=20=EA=B7=B8?= =?UTF-8?q?=EB=9D=BC=EB=8D=B0=EC=9D=B4=EC=85=98=20=EA=B0=92=20rgba=20?= =?UTF-8?q?=EC=A7=80=EC=9B=90=20=5F=5F=20=ED=88=AC=EB=AA=85=EA=B0=92=200?= =?UTF-8?q?=20=EC=B2=98=EB=A6=AC=20(#821)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [#820][3.0] Bar Chart 그라데이션 값 rgba 지원 __ 투명값 0 처리 - rgba에서 투명도 값으로 0을 지정할 경우 rgba 입력값인지 판단하는 정규표현식에서 false 처리하여 수정 - 그라데이션 입력에서 startColor 값을 지정안 할 경우 '#FFFFFF'으로 임의 처리하였지만 투명도 100으로 보이게끔 rgba(0, 0, 0, 0)으로 변경함 * [#820][3.0] Bar Chart 그라데이션 값 rgba 지원 __ 투명값 0 처리 - rgba에서 투명도 값으로 0을 지정할 경우 rgba 입력값인지 판단하는 정규표현식에서 false 처리하여 수정 - 그라데이션 입력에서 startColor 값을 지정안 할 경우 '#FFFFFF'으로 임의 처리하였지만 투명도 100으로 보이게끔 rgba(0, 0, 0, 0)으로 변경함 Co-authored-by: jinhee park --- src/components/chart/helpers/helpers.canvas.js | 2 +- src/components/chart/helpers/helpers.util.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/chart/helpers/helpers.canvas.js b/src/components/chart/helpers/helpers.canvas.js index 08ea1f043..7937f5288 100644 --- a/src/components/chart/helpers/helpers.canvas.js +++ b/src/components/chart/helpers/helpers.canvas.js @@ -253,7 +253,7 @@ export default { for (let ix = 0; ix < stops.length; ix++) { const stopIdx = stops[ix][0] ?? 0; - const stopColor = stops[ix][1] ?? '#FFFFFF'; + const stopColor = stops[ix][1] ?? 'rgba(255, 255, 255, 0)'; const noneDownplayOpacity = stopColor.includes('rgba') ? Util.getOpacity(stopColor) : 1; const opacity = isDownplay ? 0.1 : noneDownplayOpacity; diff --git a/src/components/chart/helpers/helpers.util.js b/src/components/chart/helpers/helpers.util.js index c68b2d9e4..4c1a0534d 100644 --- a/src/components/chart/helpers/helpers.util.js +++ b/src/components/chart/helpers/helpers.util.js @@ -36,7 +36,7 @@ export default { const noneWhiteSpaceColorStr = colorStr.replace(/ /g, ''); const isHEX = /^#(?:[A-Fa-f0-9]{3}){1,2}$/.exec(noneWhiteSpaceColorStr); const isRGB = /^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/.exec(noneWhiteSpaceColorStr); - const isRGBA = /^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1(?:\.0*)?)\s*[)]$/.exec(noneWhiteSpaceColorStr); + const isRGBA = /^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1?)\s*[)]$/.exec(noneWhiteSpaceColorStr); let result = ''; if (isHEX) {