Skip to main content

No project description provided

Project description

🎨 Paletted

A lightweight CLI utility for dynamic theme generation. It derives color palettes from live wallpapers or images and applies them across the system through configurable templates and appliers

How It Works

  1. Extract a frame from the wallpaper (or use the image directly)
  2. Generate a Material Design color palette with Matugen
  3. Apply colors to templates and appliers
  4. Execute configured commands and wallpaper backend

Installation

Dependencies:

  • python >= 3.11
  • magentum
  • ffmpeg
  • pipx
pipx install paletted

Configuration

paletted/
├── appliers/
│   └── hyprland.py               # Custom theme applier
├── templates/
│   └── hyprland.conf.template    # Example configuration template
├── config.toml                   # Main configuration file
└── another_config.toml           # Included configuration module

Main Configuration

The main configuration file contains global settings, notification options, wallpaper backends, and imported modules

# config.toml

# Include external modular configurations
[[include]]
target = "./another_config.toml"

[settings]
# Path to save the extracted frame preview
save_frame_to = "./wallpaper_preview.png"

[notification]
enable = true
summary = "Paletted-Themes"
text = "Theme applied. Wallpaper updated"

# Executed when the wallpaper source is a video
[[backend]]
type = "video"
exec = "smooth-slapper %wallpaper_path%"

# Executed when the wallpaper source is a static image
[[backend]]
type = "image"
exec = "smooth-slapper %wallpaper_path%"

# Target package application mapping
[[package]]
name = "hyprland"
template = "hyprland.conf.template"
target = "~/.config/hypr/theme.conf"
exec = [["hyprctl", "reload"], ["echo", "Goida"]]

Theme template

Colors can be referenced using placeholders and modifiers:

  • {{color.modifier(factory)}}

where color is the base color, modifier is the transformation to apply, and factory is the modifier parameter

Modifiers:

.alpha(factor) -> Sets opacity (0.0 to 1.0)       | Example: {primary.alpha(0.5)}
.dark(factor)  -> Darkens the color (factor > 1)  | Example: {primary.dark(1.2)}
.light(factor) -> Lightens the color (factor > 1) | Example: {secondary.light(1.5)}
.sat(factor)   -> Modulates saturation (0.0 - 5)  | Example: {tertiary.sat(0.5)}
.rgb           -> Formats to CSS rgb/rgba string  | Example: {surface.rgb}
.strip         -> Removes the '#' prefix symbol   | Example: {error.strip}

Palette Colors:

# Primary
accent              = "{primary}"
on_accent           = "{on_primary}"
container           = "{primary_container}"
on_container        = "{on_primary_container}"

# Secondary
accent              = "{secondary}"
on_accent           = "{on_secondary}"
container           = "{secondary_container}"
on_container        = "{on_secondary_container}"

# Tertiary
accent              = "{tertiary}"
on_accent           = "{on_tertiary}"
container           = "{tertiary_container}"
on_container        = "{on_tertiary_container}"

# Surface
background          = "{background}"
on_background       = "{on_background}"
surface             = "{surface}"
on_surface          = "{on_surface}"
variant             = "{surface_variant}"
on_variant          = "{on_surface_variant}"

# Borders
outline             = "{outline}"
outline_variant     = "{outline_variant}"

# Error
accent              = "{error}"
on_accent           = "{on_error}"
container           = "{error_container}"
on_container        = "{on_error_container}"

# Inverse
surface             = "{inverse_surface}"
on_surface          = "{inverse_on_surface}"
primary             = "{inverse_primary}"

Example:

# hyprland.conf.template

$active_border_1 = {{on_secondary.strip}}  ->  313032
$active_border_2 = {{outline.strip}}       ->  929095
$inactive_border = {{surface.strip}}       ->  141314
$shadow = {{outline.strip}}                ->  929095

Custom appliers

Appliers provide a programmatic way to generate output when template-based substitution is not flexible enough

Each Applier must define a function whose name matches the file name:

# hyprland.py

def hyprland(color_parser) -> None:
  print(color_parser("primary.rgb"))

The provided color_parser callable can be used to resolve any supported color placeholder

Usage

Generate and apply a theme:

palleted apply /path/to/wallpaper/  # --source-index 0-1 --config-dir /path/to/paletted_configs/

Restore the previous wallpaper:

palleted restore  # --config-dir /path/to/paletted_configs/

Why Paletted?

Unlike static themes, Paletted automatically generates a cohesive color scheme based on your wallpaper and applies it to your entire desktop environment and applications, in accordance with templates and appliers.

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

paletted-1.0.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

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

paletted-1.0.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file paletted-1.0.0.tar.gz.

File metadata

  • Download URL: paletted-1.0.0.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for paletted-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3f30e48876b1b8ae82ea7ae5e2dc476bd204b6ec743a19fe61b2dcc336529047
MD5 a6da16b2af7866e1fa4f64216d021944
BLAKE2b-256 6689fc7c977b150d376c0114325233b0dc83bb28b18f3ab49f5fd1feff1cf426

See more details on using hashes here.

Provenance

The following attestation bundles were made for paletted-1.0.0.tar.gz:

Publisher: python-publish.yml on PixelLoop-uwu/Paletted

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file paletted-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: paletted-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for paletted-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c0b653beab1b31f8dfc4717e2f20fb0014dd5b85941bb65a790d05dcadbcf51
MD5 4dd41b13380563d9ab8273037862078d
BLAKE2b-256 b14babec0a585b432acfdea8eaf0f552ba5ecce0b861e7261e421c1eb8c9fffb

See more details on using hashes here.

Provenance

The following attestation bundles were made for paletted-1.0.0-py3-none-any.whl:

Publisher: python-publish.yml on PixelLoop-uwu/Paletted

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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