Skip to content

pbun206/thaimeleon_github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thaimeleon

Gif demo of Thaimeleon palettes

An opinionated color scheme generator that uses a wallpaper input!

  • Supports for light themes ☀️ and dark themes 🌑

  • Generates a forty-five color palette, ensuring accessibility for every TUI and GUI situation!

  • Uses k-means, weighted ward's method of minimum variance, and Oklab to determine representative background colors and foreground colors of a wallpaper

  • Uses Oklch to ensure perpetual chromatic clarity 🌈

  • In addition to json, toml, yaml, and ron, Thaimeleon can generate a rhai file to allow perfect integration with Yolk ⚙️

  • Thaimeleon uses Rust 🦀

  • Configuration file to change contrast to how you like it

  • Enable cache to make Thaimeleon run at lightning speed ⚡

  • Although not compliant to, this project uses a formula built on Andrew Somers' DPS Contrast, in order to retain reasonable contrast

Installation

From crates.io (Stable Version)

With cargo installed, do the following command in your shell:

cargo install thaimeleon

Make sure the cargo binary location is in PATH

Compile from source (Unstable Version)

If you do this, git tag to a previous version because unstable is/will be broken.

With cargo and git installed, do the following commands in your shell:

git clone https://codeberg.org/thairanaru/thaimeleon.git
cd thaimeleon
cargo install --path .

Usage

The recommended method of using Thaimeleon is to generate a palette file, which is then processed by a dot file manager. For reference, in my wallpaper changer script, I have:

    thaimeleon "$selected_wallpaper" -w ~/.config/yolk/chameleon.rhai 
    yolk sync

However, thaimeleon will adjust contents by the file extension. Currently, json, toml, yaml, rhai, and ron are supported.

For details of the color palette, read here.

To enable experimental base16 output, add the --base16 or -b flag. Note that Thaimeleon isn't designed around base 16 (because Thaimeleon color palette is superior) nor I have tested results.

For screenshots, add the --print-pretty-palette or -p flag.

Configuration

Thaimeleon can be configured in ~/.config/thaimeleon/thaimeleon.toml. Generate a default config with thaimeleon --generate-config-file and read the default config file for documentation. I recommend turning on cache once you get settled. It does have options to configure Thaimeleon's algorithm but caution! Once you start changing the defaults, you now hold responsibility for accessibility. For a more detailed understanding, check out here for information how the algorithm works.

Road Map

Here are some things planned for next release:

  • Thaimeleon library
    • Replace distance formulas with CIED2000
    • Hue data from UW's color dataset
    • Expand Thaimeleon's palette to support color schemes that flips foreground and background for colored surfaces
      • Make a condition for Thaimeleon to filp polarity for colored surfaces
    • Material you comptiable output
    • Document extensions of Thaimeleon palette
  • Thaimeleon CLI
    • Refactor code
  • Add css output
  • Rewrite config integration
    • In particular, adding marcos
  • Add debug/verbose printing

Contributing

Pull requests are welcomed, though be warned that I am entirely self taught and haven't programmed since I was 12, so the codebase might be difficult to work with.

The algorithm is constructed largely through experimentation and personal taste rather than scientific theory. In other words, feel free to play around with it. Check out here for information how the algorithm works.

Suggestions for dot file manager/theming templating integration are also welcomed. As you see, I only use yolk.

Licensing

With the exception of the dps_contrast module in src/contrast.rs, this project is licensed under the AGPL v3.

The dps_contrast module is licensed under the DPS CONTRAST (DELTA PHI STAR) LICENSE, a modified version of the AGPL v3 license. All rights of the formula to Andrew Somers.

For the licenses of the images shown in the demo, check out LICENSES/licenses.md

Similar projects to try out

  • Matugen - uses Material You which uses HCT, so this should be good. I haven't tried this personally yet, but I don't see how anything could go wrong with that approach.

About

Official mirror of Codebergy repo. I have to manually push every time so this repo will only be up to date during tag releases. Go to the actual codeberg for actual development.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages