From dbe17805e04370643a6a11ba6d192de44eec1f87 Mon Sep 17 00:00:00 2001 From: ruinivist Date: Mon, 11 Aug 2025 21:52:46 +0000 Subject: [PATCH] more config params to dot grid bg --- lib/core/background.dart | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/core/background.dart b/lib/core/background.dart index d7456b6..ba02f76 100644 --- a/lib/core/background.dart +++ b/lib/core/background.dart @@ -37,14 +37,20 @@ class SingleColorBackround extends CanvasBackground { class DotGridBackground extends CanvasBackground { final double size; final double spacing; - final Color color; + final Color dotColor; + final Color backgroundColor; - const DotGridBackground({this.size = 2.0, this.spacing = 50.0, this.color = Colors.black12}) : super(); + const DotGridBackground({ + this.size = 2.0, + this.spacing = 50.0, + this.dotColor = Colors.black12, + this.backgroundColor = Colors.white, + }) : super(); @override void paint(Canvas canvas, Offset screenOffset, Offset canvasOffset, double scale, Size canvasSize) { final paint = Paint() - ..color = color + ..color = backgroundColor ..strokeWidth = 1.0 * scale; double scaledSpacing = spacing * scale; double scaledSize = size * scale; @@ -69,7 +75,7 @@ class DotGridBackground extends CanvasBackground { for (double x = screenStartX; x < screenOffset.dx + canvasSize.width + scaledSpacing; x += scaledSpacing) { for (double y = screenStartY; y < screenOffset.dy + canvasSize.height + scaledSpacing; y += scaledSpacing) { - canvas.drawCircle(Offset(x, y), scaledSize, paint); + canvas.drawCircle(Offset(x, y), scaledSize, paint..color = dotColor); } } }