-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
There are multiple options for the API to add styles.
Circle(fill="green")
Circle(style=Style(fill="green"))
Circle() | Style(fill="green")
The first one looks too low-level. Every shape must handle fill, store, store-width etc. When support for gradients etc. added, then every shape must support them too.
Moving all the styles to a Style object looks like a good idea to me. It is not clear if we should see that as a property or a transform. My preference as of now is to make it a property.
# as property
shape = Group([Circle(), Rectangle()], style=Style(stroke="red"))
# as transform
shape = Circle() + Rectangle()
shape = shape | Stlye(stroke="red")
Style is both a noun and a verb. In the first case, it is used as a noun and the in the second case it used as a verb.
@amitkaps do you have any suggestions?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels