fromString MethodStatic

Create a ColorDef from a string representation. The following representations are supported: "rgb(255,0,0)" "rgba(255,0,0,.2)" "rgb(100%,0%,0%)" "hsl(120,50%,50%)" "#rrbbgg" "blanchedAlmond" (see possible values from ColorByName). Case-insensitive.

If val is not a valid color string, this function returns black.

fromString(val: string): ColorDef

@see isValidColor to determine if val is a valid color string.

Parameter Type Description
val string  

Returns - ColorDef

Defined in

Last Updated: 17 December, 2024