retrieveFillColor function

Color retrieveFillColor(
  1. GeometryMixin node
)

Converts the fills of a given node to a single Color object.

Implementation

Color retrieveFillColor(GeometryMixin node) {
  if (node.fills.isEmpty) {
    return const Color(0x00000000);
  }

  final fill = node.fills.first;
  if (fill.visible == false) {
    return const Color(0x00000000);
  }
  if (fill.color != null) {
    return fill.toFlutterColor()!;
  }

  return const Color(0xff000000);
}