Skip to content

pantoken-root / renderers/react-markdown/src / isColorValue

Funzione: isColorValue() ​

isColorValue(value): boolean

Beta

Vero quando una stringa è un valore CSS di colore autonomo (esadecimale o una funzione colore).

Parametri ​

value ​

string

Restituisce ​

boolean

Esempio ​

ts
import { isColorValue } from "@pantoken/react-markdown";

isColorValue("#03893D"); // true
isColorValue("oklch(0.7 0.1 200)"); // true
isColorValue("hello"); // false