1
Fork 0
mirror of https://github.com/RGBCube/color.v synced 2025-07-31 09:57:47 +00:00

add a disabled parameter

This commit is contained in:
RGBCube 2022-11-18 21:39:31 +03:00
parent e147a4de42
commit e1df7f56e1

View file

@ -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
}