mirror of
https://github.com/RGBCube/color.v
synced 2025-08-01 10:27:45 +00:00
add a disabled parameter
This commit is contained in:
parent
e147a4de42
commit
e1df7f56e1
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue