toPaint method

Paint toPaint({
  1. double lightFactor = 1.0,
})

Implementation

Paint toPaint({double lightFactor = 1.0}) {
  final r = ((color.r * 255.0).round().clamp(0, 255) * lightFactor)
      .clamp(0, 255)
      .toInt();
  final g = ((color.g * 255.0).round().clamp(0, 255) * lightFactor)
      .clamp(0, 255)
      .toInt();
  final b = ((color.b * 255.0).round().clamp(0, 255) * lightFactor)
      .clamp(0, 255)
      .toInt();
  return Paint()
    ..color = Color.fromARGB((opacity * 255).toInt(), r, g, b)
    ..style = wireframe ? PaintingStyle.stroke : PaintingStyle.fill
    ..strokeWidth = wireframe ? 1.0 : 0
    ..blendMode = blendMode;
}