From e1df7f56e1ad3fddd8462ae76c050e86c5a0ac2e Mon Sep 17 00:00:00 2001 From: RGBCube Date: Fri, 18 Nov 2022 21:39:31 +0300 Subject: [PATCH] add a disabled parameter --- color/paintbrush.v | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/color/paintbrush.v b/color/paintbrush.v index d4a6969..6437bbb 100644 --- a/color/paintbrush.v +++ b/color/paintbrush.v @@ -6,6 +6,8 @@ pub: fg ?Color bg ?Color style []Style +__global: + disabled bool } [params] @@ -13,6 +15,7 @@ pub struct PaintBrushParams { fg ?Color bg ?Color style []Style + disabled bool } pub fn new_brush(p PaintBrushParams) !PaintBrush { @@ -34,7 +37,7 @@ pub fn new_brush(p PaintBrushParams) !PaintBrush { } pub fn (p &PaintBrush) render(msg string) string { - if no_color { + if no_color || p.disabled { return msg }