mirror of
https://github.com/Mibew/simple-icons.git
synced 2025-01-17 23:51:08 +03:00
Convert hex code to upper case in add-icon-data
script (#8762)
This commit is contained in:
parent
b646880b54
commit
ab4fed9f82
@ -37,8 +37,10 @@ const hexTransformer = (text) => {
|
|||||||
const luminance = hexPattern.test(text)
|
const luminance = hexPattern.test(text)
|
||||||
? getRelativeLuminance.default(`#${color}`)
|
? getRelativeLuminance.default(`#${color}`)
|
||||||
: -1;
|
: -1;
|
||||||
if (luminance === -1) return text;
|
if (luminance === -1) return text.toUpperCase();
|
||||||
return chalk.bgHex(`#${color}`).hex(luminance < 0.4 ? '#fff' : '#000')(text);
|
return chalk.bgHex(`#${color}`).hex(luminance < 0.4 ? '#fff' : '#000')(
|
||||||
|
text.toUpperCase(),
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const aliasesTransformer = (text) =>
|
const aliasesTransformer = (text) =>
|
||||||
@ -55,7 +57,7 @@ const aliasesChoices = Object.entries(
|
|||||||
|
|
||||||
const getIconDataFromAnswers = (answers) => ({
|
const getIconDataFromAnswers = (answers) => ({
|
||||||
title: answers.title,
|
title: answers.title,
|
||||||
hex: answers.hex,
|
hex: answers.hex.toUpperCase(),
|
||||||
source: answers.source,
|
source: answers.source,
|
||||||
...(answers.hasGuidelines ? { guidelines: answers.guidelines } : {}),
|
...(answers.hasGuidelines ? { guidelines: answers.guidelines } : {}),
|
||||||
...(answers.hasLicense
|
...(answers.hasLicense
|
||||||
|
Loading…
Reference in New Issue
Block a user