from static method

CSSColorName? from(
  1. Object? color
)
override

Implementation

static CSSColorName? from(Object? color) {
  if (color == null) return null;

  if (color is CSSColorName) {
    return color;
  } else if (color is String) {
    return CSSColorName.parse(color);
  }

  return null;
}