nimpretty bandaid
This commit is contained in:
parent
3c3cd499ea
commit
29479a7c6a
22
README.md
22
README.md
|
@ -168,16 +168,7 @@ image.draw(lines)
|
|||
### Gradient
|
||||
[examples/gradient.nim](examples/gradient.nim)
|
||||
```nim
|
||||
image.fillPath(
|
||||
"""
|
||||
M 20 60
|
||||
A 40 40 90 0 1 100 60
|
||||
A 40 40 90 0 1 180 60
|
||||
Q 180 120 100 180
|
||||
Q 20 120 20 60
|
||||
z
|
||||
""",
|
||||
Paint(
|
||||
let paint = Paint(
|
||||
kind: pkGradientRadial,
|
||||
gradientHandlePositions: @[
|
||||
vec2(100, 100),
|
||||
|
@ -189,6 +180,17 @@ image.fillPath(
|
|||
ColorStop(color: rgba(255, 0, 0, 40).color, position: 1.0),
|
||||
]
|
||||
)
|
||||
|
||||
image.fillPath(
|
||||
"""
|
||||
M 20 60
|
||||
A 40 40 90 0 1 100 60
|
||||
A 40 40 90 0 1 180 60
|
||||
Q 180 120 100 180
|
||||
Q 20 120 20 60
|
||||
z
|
||||
""",
|
||||
paint
|
||||
)
|
||||
```
|
||||
![example output](examples/gradient.png)
|
||||
|
|
|
@ -1,19 +1,9 @@
|
|||
import pixie
|
||||
|
||||
let
|
||||
image = newImage(200, 200)
|
||||
|
||||
let image = newImage(200, 200)
|
||||
image.fill(rgba(255, 255, 255, 255))
|
||||
image.fillPath(
|
||||
"""
|
||||
M 20 60
|
||||
A 40 40 90 0 1 100 60
|
||||
A 40 40 90 0 1 180 60
|
||||
Q 180 120 100 180
|
||||
Q 20 120 20 60
|
||||
z
|
||||
""",
|
||||
Paint(
|
||||
|
||||
let paint = Paint(
|
||||
kind: pkGradientRadial,
|
||||
gradientHandlePositions: @[
|
||||
vec2(100, 100),
|
||||
|
@ -25,6 +15,17 @@ image.fillPath(
|
|||
ColorStop(color: rgba(255, 0, 0, 40).color, position: 1.0),
|
||||
]
|
||||
)
|
||||
|
||||
image.fillPath(
|
||||
"""
|
||||
M 20 60
|
||||
A 40 40 90 0 1 100 60
|
||||
A 40 40 90 0 1 180 60
|
||||
Q 180 120 100 180
|
||||
Q 20 120 20 60
|
||||
z
|
||||
""",
|
||||
paint
|
||||
)
|
||||
|
||||
image.writeFile("examples/paint.png")
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import pixie
|
||||
|
||||
let
|
||||
image = newImage(200, 200)
|
||||
|
||||
let image = newImage(200, 200)
|
||||
image.fill(rgba(255, 255, 255, 255))
|
||||
|
||||
image.fillPath(
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import pixie
|
||||
|
||||
let
|
||||
image = newImage(200, 200)
|
||||
|
||||
let image = newImage(200, 200)
|
||||
image.fill(rgba(255, 255, 255, 255))
|
||||
|
||||
var path: Path
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Loading…
Reference in a new issue