Skip to main content

Material You color generation algorithms in pure python!

Project description

materialyoucolor-pyhton

Material You color algorithms for python (crossplatform)!

SEE : https://m3.material.io/styles/color/dynamic-color/overview

How does it works?

Android performs the following steps to generate color schemes from a user's wallpaper.

  1. The system detects the main colors in the selected wallpaper image and extracts a source color.

  2. The system uses that source color to further extrapolate five key colors known as Primary, Secondary, Tertiary, Neutral, and Neutral variant.

img Figure 1. Example of source color extraction from wallpaper image and extraction to five key colors

  1. The system interprets each key color into a tonal palette of 13 tones.

img2 Figure 2. Example of generating a given tonal palettes

  1. The system uses this single wallpaper to derive five different color schemes, which provides the basis for any light and dark themes.

SEE MORE: https://developer.android.com/develop/ui/views/theming/dynamic-colors

Where to use this colors?

SEE : https://m3.material.io/styles/color/the-color-system/color-roles

Install

Always prefer master branch

pip3 install https://github.com/T-Dynamos/materialyoucolor-pyhton/archive/main.zip

or

pip3 install materialyoucolor

Documentation

Please see example.py, its well documented by AI.

Example

Install kivy,pillow, kivymd and then run example.py file.

Make sure to edit variables in example.py file, like

IMAGE_FILE = "/home/tdynamos/Downloads/test.png"  # file
Input Output
Image 1 Image 2

See all tokens : https://m3.material.io/styles/color/the-color-system/tokens

Credits

https://github.com/fengsp/color-thief-py/blob/master/colorthief.py

https://github.com/avanisubbiah/material-color-utilities

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

materialyoucolor-1.1.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

materialyoucolor-1.1-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file materialyoucolor-1.1.tar.gz.

File metadata

  • Download URL: materialyoucolor-1.1.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for materialyoucolor-1.1.tar.gz
Algorithm Hash digest
SHA256 a5b9487de469ee2a48ad7708dbbd28b3c7bdb3b0b508a2f2cd4d43e432896d77
MD5 92b67569b2c9ed4067f715e95e8d16db
BLAKE2b-256 8d7ba6f47b82068718029c4f624834d0b884b18f6bd3d1be3a38d0b8e741e938

See more details on using hashes here.

File details

Details for the file materialyoucolor-1.1-py3-none-any.whl.

File metadata

  • Download URL: materialyoucolor-1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for materialyoucolor-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c5c049d49fd39e173ddd463d5e21d5b6e76b7f8f79bd09dbe10e823060c855c
MD5 6918347c0a05be109b5548cad408d31b
BLAKE2b-256 1ac1349af748ea71fe845aeff98ce5982b5f3e469b90c7ee3dc15e481026c76b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page