-
In the code below, have two circles that operate 'division', but I wonder if it possible to assign colors to the result? I would like one path to be a color and the other path to be transparent / no-fill. CODE ) c1 = circle((60, 60), 50, fill='magenta', stroke_width=4).to_path() I was recommended to try python zip function which would assign different colors. But it doesn't work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
c1 = circle((60, 60), 50, fill='magenta', stroke_width=4).to_path()
c2 = circle((90, 60), 50, fill='cyan', stroke_width=4).to_path()
color_list = ['red', 'none']
objs = apply_path_operation('division', [c1, c2])
for o, color in zip(objs, color_list):
o.style(fill=color) Does that do what you want? |
Beta Was this translation helpful? Give feedback.
zip
is a perfectly reasonable approach. To produce a transparent object you can specify its color asnone
, as in the following code:Does that do what you want?