docs: fix wrong brightness value in Palette Generation Tool (#48973)

This commit is contained in:
afc163 2024-05-18 21:23:45 +08:00 committed by GitHub
parent 51ec7e39a3
commit 253b45eceb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,14 +11,14 @@ const primaryMinBrightness = 70; // 主色推荐最小亮度
const locales = {
cn: {
saturation: (s: string) => `饱和度建议不低于${primaryMinSaturation}现在${s}`,
brightness: (b: string) => `亮度建议不低于${primaryMinBrightness}现在${b}`,
saturation: (s: string) => `饱和度建议不低于${primaryMinSaturation}当前值 ${s}`,
brightness: (b: string) => `亮度建议不低于${primaryMinBrightness}当前值 ${b}`,
},
en: {
saturation: (s: string) =>
`Saturation is recommended not to be lower than ${primaryMinSaturation}currently${s}`,
`Saturation is recommended not to be lower than ${primaryMinSaturation} (currently ${s})`,
brightness: (b: string) =>
`Brightness is recommended not to be lower than ${primaryMinBrightness}currently${b}`,
`Brightness is recommended not to be lower than ${primaryMinBrightness} (currently ${b})`,
},
};
@ -41,7 +41,7 @@ const ColorPaletteTool: React.FC = () => {
text += locale.saturation((s * 100).toFixed(2));
}
if (b * 100 < primaryMinBrightness) {
text += locale.brightness((s * 100).toFixed(2));
text += locale.brightness((b * 100).toFixed(2));
}
}
return <span className="color-palette-picker-validation">{text.trim()}</span>;