mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 18:30:41 -06:00
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:
parent
154c380c8c
commit
01e984c394
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user