去掉自动在颜色值前面添加#的功能。

This commit is contained in:
徐涛 2025-01-06 15:14:16 +08:00
parent 97a00f08ca
commit 9f603df57a

View File

@ -8,11 +8,7 @@ export function useCopyColor() {
const [cpState, copyToClipboard] = useCopyToClipboard(); const [cpState, copyToClipboard] = useCopyToClipboard();
const copyAction = useCallback((color: string) => { const copyAction = useCallback((color: string) => {
if (isNil(color)) return; if (isNil(color)) return;
if (color.startsWith('#')) {
copyToClipboard(color); copyToClipboard(color);
} else {
copyToClipboard(`#${color}`);
}
}, []); }, []);
useEffect(() => { useEffect(() => {