ColorPicker: display colors as rgba in input (#37231)

* SpectrumPalette: change input to display rgba string

* fieldOverrides: remove extra hex string check
This commit is contained in:
nikki-kiga 2021-07-26 15:54:13 -07:00 committed by GitHub
parent 154c380c8c
commit 01e984c394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -226,7 +226,7 @@ function cachingDisplayProcessor(disp: DisplayProcessor, maxCacheSize = 2500): D
// convert to hex6 or hex8 so downstream we can cheaply test for alpha (and set new alpha)
// via a simple length check (in colorManipulator) rather using slow parsing via tinycolor
if (v.color && v.color[0] !== '#') {
if (v.color) {
v.color = asHexString(v.color);
}

View File

@ -36,7 +36,7 @@ const SpectrumPalette: React.FunctionComponent<SpectrumPaletteProps> = ({ color,
return (
<div className={styles.wrapper}>
<RgbaStringColorPicker className={cx(styles.root)} color={rgbaString} onChange={setColor} />
<ColorInput theme={theme} color={currentColor} onChange={setColor} className={styles.colorInput} />
<ColorInput theme={theme} color={rgbaString} onChange={setColor} className={styles.colorInput} />
</div>
);
};