from static method

CSSColorHEX? from(
  1. Object? color
)
override

Implementation

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

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

  return null;
}