1
Fork 0
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:
RGBCube 2022-11-18 21:30:28 +03:00
parent cae034cfb3
commit 712324f893
3 changed files with 36 additions and 10 deletions

View file

@ -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')
```