mirror of
https://github.com/RGBCube/color.v
synced 2025-07-31 09:57:47 +00:00
Make a factory method for PaintBrush (validate styles)
This commit is contained in:
parent
cae034cfb3
commit
712324f893
3 changed files with 36 additions and 10 deletions
|
@ -19,11 +19,11 @@ color.bold.cprintln('Hello World')
|
|||
```v
|
||||
import color
|
||||
|
||||
brush := color.PaintBrush{
|
||||
brush := color.new_brush(
|
||||
fg: color.rgb(0, 0, 0)!
|
||||
bg: color.hex(0xffffff)!
|
||||
styles: [color.bold, color.underline, color.italic]
|
||||
}
|
||||
style: [color.bold, color.underline, color.italic]
|
||||
)!
|
||||
|
||||
brush.cprintln('Hello World')
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue