colorFromName function

Color? colorFromName(
  1. String val
)

Looks up a named web colour, such as 'Light Sea Green'.

Ignores case and spaces. Returns null if val isn't a known colour name. See x11Colours for the full list.

Implementation

Color? colorFromName(String val) =>
    x11Colours[val.trim().replaceAll(' ', '').toLowerCase()];