shadowEllipse static method

Image shadowEllipse(
  1. double width,
  2. double height,
  3. double spreadRadius,
  4. double blurRadius,
  5. PdfColor color,
)

Implementation

static im.Image shadowEllipse(
  double width,
  double height,
  double spreadRadius,
  double blurRadius,
  PdfColor color,
) {
  final shadow = im.Image(
    width: (width + spreadRadius * 2).round(),
    height: (height + spreadRadius * 2).round(),
    format: im.Format.uint8,
    numChannels: 4,
  );

  im.fillCircle(
    shadow,
    x: (spreadRadius + width / 2).round(),
    y: (spreadRadius + height / 2).round(),
    radius: (width / 2).round(),
    color: im.ColorUint8(4)
      ..r = color.red * 255
      ..g = color.green * 255
      ..b = color.blue * 255
      ..a = color.alpha * 255,
  );

  return im.gaussianBlur(shadow, radius: blurRadius.round());
}