Install & Compatibility
Where this runs
tested against v3.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.014s · 42MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.3s · import 0.014s · 39MB
38MB installed
● package 38MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Hct
✓ from materialyoucolor.hct.hct import Hct
QuantizerCelebi
✓ from materialyoucolor.quantize.quantizer_celebi import QuantizerCelebi
SchemeFidelity
✓ from materialyoucolor.scheme.scheme_fidelity import SchemeFidelity
✗ from materialyoucolor.scheme import SchemeFidelity
Scheme classes are directly under `materialyoucolor.scheme.<scheme_name>` in v3.x, not directly under `materialyoucolor.scheme`.
TonalPalette
✓ from materialyoucolor.palettes.tonal_palette import TonalPalette
✗ from materialyoucolor.palette.tonal_palette import TonalPalette
The top-level module is `palettes` (plural), not `palette` (singular).
This quickstart demonstrates how to generate a Material You color scheme using a seed color. It shows how to convert a hex string to the `Hct` format and then use a `SchemeFidelity` to create both light and dark themes, printing some of the key generated colors.
from materialyoucolor.hct.hct import Hct
from materialyoucolor.scheme.scheme_fidelity import SchemeFidelity
# Define a seed color (e.g., from an image or a brand color)
seed_hex = "#FF00A3" # A vibrant magenta
# Convert hex string to integer for Hct
seed_argb_int = int(seed_hex[1:], 16)
seed_color_hct = Hct.from_int(seed_argb_int)
# Generate a Material You color scheme
# You can choose different schemes like SchemeVibrant, SchemeContent, etc.
# Set is_dark=True for a dark theme
scheme_light = SchemeFidelity(seed_color_hct, is_dark=False, contrast_level=0.0)
scheme_dark = SchemeFidelity(seed_color_hct, is_dark=True, contrast_level=0.0)
print("--- Light Scheme ---")
print(f"Primary color: {scheme_light.primary.hex}")
print(f"On Primary color: {scheme_light.on_primary.hex}")
print(f"Background color: {scheme_light.background.hex}")
print(f"Surface color: {scheme_light.surface.hex}")
print(f"Error color: {scheme_light.error.hex}")
print("\n--- Dark Scheme ---")
print(f"Primary color: {scheme_dark.primary.hex}")
print(f"Background color: {scheme_dark.background.hex}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'materialyoucolor.palettes'
Attempting to import from an incorrect or deprecated module path. Common when migrating from v2.x to v3.x where the module structure changed.
fixVerify the correct module path in the v3.x documentation. For example, `from materialyoucolor.palettes.tonal_palette import TonalPalette`.
ValueError: invalid literal for int() with base 10: '#FF00A3'
Passing a hex color string directly to a function that expects an integer (e.g., `Hct.from_int()`).
fixConvert the hex string to an integer: `Hct.from_int(int(hex_string[1:], 16))`.
AttributeError: 'Hct' object has no attribute 'get_argb'
Using an outdated method call (`get_argb`) on an `Hct` object after upgrading to version 3.x.
fixAccess the ARGB integer directly via the `argb` attribute: `hct_instance.argb`.
Upgrade
Version history
3.0.2latest on PyPI · released Feb 22, 2026
Audit
Dependencies
No dependency data recorded yet.