FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pixie-python/examples/gradient.py at master · treeform/pixie-python · GitHub
treeform
/
pixie-python
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
112
Code
Issues
7
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pixie-python
/
examples
/
gradient.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (21 loc) · 704 Bytes
Breadcrumbs
pixie-python
/
examples
/
gradient.py
Copy path
File metadata and controls
28 lines (21 loc) · 704 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import
pixie
image
=
pixie
.
Image
(
200
,
200
)
image
.
fill
(
pixie
.
Color
(
1
,
1
,
1
,
1
))
paint
=
pixie
.
Paint
(
pixie
.
RADIAL_GRADIENT_PAINT
)
paint
.
gradient_handle_positions
.
append
(
pixie
.
Vector2
(
100
,
100
))
paint
.
gradient_handle_positions
.
append
(
pixie
.
Vector2
(
200
,
100
))
paint
.
gradient_handle_positions
.
append
(
pixie
.
Vector2
(
100
,
200
))
paint
.
gradient_stops
.
append
(
pixie
.
ColorStop
(
pixie
.
Color
(
1
,
0
,
0
,
1
),
0
))
paint
.
gradient_stops
.
append
(
pixie
.
ColorStop
(
pixie
.
Color
(
1
,
0
,
0
,
0.15625
),
1
))
path
=
pixie
.
parse_path
(
"""
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
"""
)
image
.
fill_path
(
path
,
paint
)
image
.
write_file
(
"examples/gradient.png"
)
Back
|
FazBrowse Home
|
New Git URL