From ab4fed9f821c0194f7294b83c3b2f9fac20e6d09 Mon Sep 17 00:00:00 2001 From: LitoMore Date: Sat, 10 Jun 2023 23:33:26 +0800 Subject: [PATCH] Convert hex code to upper case in `add-icon-data` script (#8762) --- scripts/add-icon-data.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/add-icon-data.js b/scripts/add-icon-data.js index 93852dc10..c816a26e6 100644 --- a/scripts/add-icon-data.js +++ b/scripts/add-icon-data.js @@ -37,8 +37,10 @@ const hexTransformer = (text) => { const luminance = hexPattern.test(text) ? getRelativeLuminance.default(`#${color}`) : -1; - if (luminance === -1) return text; - return chalk.bgHex(`#${color}`).hex(luminance < 0.4 ? '#fff' : '#000')(text); + if (luminance === -1) return text.toUpperCase(); + return chalk.bgHex(`#${color}`).hex(luminance < 0.4 ? '#fff' : '#000')( + text.toUpperCase(), + ); }; const aliasesTransformer = (text) => @@ -55,7 +57,7 @@ const aliasesChoices = Object.entries( const getIconDataFromAnswers = (answers) => ({ title: answers.title, - hex: answers.hex, + hex: answers.hex.toUpperCase(), source: answers.source, ...(answers.hasGuidelines ? { guidelines: answers.guidelines } : {}), ...(answers.hasLicense