from static method

CSSColorRGB? from(
  1. Object? color
)
override

Implementation

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

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

  return null;
}