Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

parseColor

Parse color string into {@link ParsedColorValue} (if possible). Color value will first be matched to theme object before parsing. See also color.tests.ts for more examples.

@example
Parseable strings:
'red' // From theme, if 'red' is available
'red-100' // From theme, plus scale
'red-100/20' // From theme, plus scale/opacity
'[rgb(100,2,3)]/[var(--op)]' // Bracket with rgb color and bracket with opacity
function parseColor(body: string, theme: Theme): ParsedColorValue | undefined;
§
parseColor(body: string, theme: Theme): ParsedColorValue | undefined
[src]

§Parameters

§
body: string
[src]
  • Color string to be parsed.
§
theme: Theme
[src]

§Return Type

§
ParsedColorValue | undefined
[src]

{@link ParsedColorValue} object if string is parseable.