X Tutup
Skip to content

T-Dynamos/materialshapes-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

materialshapes-python

A complete Python port of the official Material Design 3 shape system from Android. It includes rounded polygon generation, shape morphing, and smooth transitions based on Google's original Java source.

Uses both ThorVG and PyCairo for 2D graphics rendering. Both backends return RGBA bytes of shapes. In ThorVG, it uses a centralized engine with multi-threading to maximize performance. A Kivy widget is already included.

Rendering Backends

The materialshapes.renderer module supports two backends:

  • ThorVG: Uses thorvg-python bindings.
  • PyCairo: Uses pycairo for rendering.

Both backends are accessible through the render function.

Material Design Shape System

Docs

There is no separate documentation yet.

The examples serve as the documentation and cover all major features. Check them out to understand usage and integration.

Install

You can install the core library, but you must install at least one rendering backend:

# To use ThorVG (Recommended for performance)
pip3 install "materialshapes[thorvg]"

# To use Cairo
pip3 install "materialshapes[cairo]"

# To install both
pip3 install "materialshapes[all]"

Examples

File: kivy.py

Run using:

python3 -m examples.kivy
vid.mp4

File: loading_indicator.py

Run using:

python3 -m examples.loading_indicator
vid.mp4

About

Material shapes in pure python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

X Tutup