asColor property

Color get asColor

Implementation

Color get asColor {
  var c = this;
  if (c is PColorRGBA) {
    return Color.fromRGBO(c.r, c.g, c.b, c.alpha);
  } else if (c is PColorRGB) {
    return Color.fromARGB(255, c.r, c.g, c.b);
  } else {
    throw StateError("Can't convert Color type `${c.runtimeType}`: $c");
  }
}