diff --git a/packages/ui/src/utils/cell.ts b/packages/ui/src/utils/cell.ts index 7ccca7f2f9d..b72f5ddd291 100644 --- a/packages/ui/src/utils/cell.ts +++ b/packages/ui/src/utils/cell.ts @@ -205,9 +205,9 @@ export function handleStringToStyle($dom?: HTMLElement, cssStyle: string = '') { } // font color else if (key === 'color') { - const rgbStr = new ColorKit(value).toRgbString(); + const colorKit = new ColorKit(value); styleList.cl = { - rgb: rgbStr, + rgb: colorKit.isValid ? colorKit.toRgbString() : 'rgb(0,0,0)', }; } // fill color / background