Skip to content

pantoken / renderers/react-markdown/src / isColorValue

פונקציה: isColorValue()

isColorValue(value): boolean

בטא

נכון כאשר מחרוזת היא ערך צבע CSS עצמאי (hex או פונקציית צבע).

פרמטרים

value

string

מחזיר

boolean

דוגמה

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

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