GamutMapMethod.fromName constructor

GamutMapMethod.fromName(
  1. String name, [
  2. String? argumentName
])

Parses a GamutMapMethod from its Sass name.

Throws a SassScriptException if there is no method with the given name. If this came from a function argument, argumentName is the argument name (without the $). This is used for error reporting.

Implementation

factory GamutMapMethod.fromName(String name, [String? argumentName]) =>
    switch (name) {
      'clip' => GamutMapMethod.clip,
      'local-minde' => GamutMapMethod.localMinde,
      _ => throw SassScriptException(
          'Unknown gamut map method "$name".', argumentName)
    };