Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use optional kwarg for cols16 accross pywal API #77

Closed
deviantfero opened this issue Oct 31, 2024 · 1 comment
Closed

use optional kwarg for cols16 accross pywal API #77

deviantfero opened this issue Oct 31, 2024 · 1 comment

Comments

@deviantfero
Copy link
Contributor

this gives developers freedom in terms of choosing to use this option or not, making a transition between pywal and pywal16 smoother, moreover it adds a bit of consistency between cache_fname and color.get.

for now I have to do something ugly like:

    if __check_is_pywal16cols():
        filename = cache_fname(filepath, backend, False, False, WPG_DIR)
    else:
        filename = cache_fname(filepath, backend, False, WPG_DIR)

just to avoid not passing cols16.

@eylles
Copy link
Owner

eylles commented Nov 1, 2024

yeh that will not be the only change needed... since now pywal has the contrast option...

so current master's cache_fname looks like this:

def cache_fname(img, backend, cols16, light, cache_dir, sat="", contrast=""):

while pywal's 3.3.0 cache_fname is:

def cache_fname(img, backend, light, cache_dir, sat=""):

that would mean slapping both cols16 and contrast into the same **kwargs dict ending up with an heterogeneous dict that contains a truthy string that can be lighten or darken and a float... now in cases like wpgtk it doesn't matter that the pywal16 API is uglier as things such as contrast and 16 colors are implemented inside wpgtk in it's own manner, but for those who want to use the pywal16 specific features OR simply collaborate to the project the codebase will come as more ugly and hard to read than already is, something i wanted to help by not just formatting the code with black but also start adding type annotations across the code, i hate to delay the release of pywal16 further but will have to since i want to both add type annotations and provide a more compatible API for programs using pywal as a library...

eylles added a commit that referenced this issue Nov 25, 2024

Verified

This commit was signed with the committer’s verified signature.
This improves the backwards compatibility of the API.

Closes #77
eylles added a commit that referenced this issue Nov 25, 2024

Verified

This commit was signed with the committer’s verified signature.
This improves the backwards compatibility of the API.

Closes #77
eylles added a commit that referenced this issue Nov 25, 2024

Verified

This commit was signed with the committer’s verified signature.
This improves the backwards compatibility of the API.

Closes #77
@eylles eylles closed this as completed in 07d7bf3 Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants