Skip to content

Commit

Permalink
Add docstrings for kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
eylles committed Nov 26, 2024
1 parent 07d7bf3 commit ee2d603
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 21 deletions.
10 changes: 8 additions & 2 deletions pywal/backends/colorthief.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ def gen_colors(img):


def adjust(cols, light, **kwargs):
"""Create palette."""
"""Create palette.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand All @@ -54,7 +57,10 @@ def adjust(cols, light, **kwargs):


def get(img, light=False, **kwargs):
"""Get colorscheme."""
"""Get colorscheme.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand Down
10 changes: 8 additions & 2 deletions pywal/backends/colorz.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ def gen_colors(img):


def adjust(cols, light, **kwargs):
"""Create palette."""
"""Create palette.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand All @@ -37,7 +40,10 @@ def adjust(cols, light, **kwargs):


def get(img, light=False, **kwargs):
"""Get colorscheme."""
"""Get colorscheme.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand Down
10 changes: 8 additions & 2 deletions pywal/backends/fast_colorthief.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ def gen_colors(img):


def adjust(cols, light, **kwargs):
"""Create palette."""
"""Create palette.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand All @@ -38,7 +41,10 @@ def adjust(cols, light, **kwargs):


def get(img, light=False, **kwargs):
"""Get colorscheme."""
"""Get colorscheme.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand Down
10 changes: 8 additions & 2 deletions pywal/backends/haishoku.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ def gen_colors(img):


def adjust(cols, light, **kwargs):
"""Create palette."""
"""Create palette.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand All @@ -38,7 +41,10 @@ def adjust(cols, light, **kwargs):


def get(img, light=False, **kwargs):
"""Get colorscheme."""
"""Get colorscheme.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand Down
10 changes: 8 additions & 2 deletions pywal/backends/modern_colorthief.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ def gen_colors(img):


def adjust(cols, light, **kwargs):
"""Create palette."""
"""Create palette.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand All @@ -38,7 +41,10 @@ def adjust(cols, light, **kwargs):


def get(img, light=False, **kwargs):
"""Get colorscheme."""
"""Get colorscheme.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand Down
10 changes: 8 additions & 2 deletions pywal/backends/okthief.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def gen_colors(img):


def adjust(cols, light, **kwargs):
"""Create palette."""
"""Create palette.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand All @@ -35,7 +38,10 @@ def adjust(cols, light, **kwargs):


def get(img, light=False, **kwargs):
"""Get colorscheme."""
"""Get colorscheme.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand Down
10 changes: 8 additions & 2 deletions pywal/backends/schemer2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ def gen_colors(img):


def adjust(cols, light, **kwargs):
"""Create palette."""
"""Create palette.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand All @@ -31,7 +34,10 @@ def adjust(cols, light, **kwargs):


def get(img, light=False, **kwargs):
"""Get colorscheme."""
"""Get colorscheme.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand Down
10 changes: 8 additions & 2 deletions pywal/backends/wal.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ def gen_colors(img):

def adjust(cols, light, **kwargs):
"""Adjust the generated colors and store them in a dict that
we will later save in json format."""
we will later save in json format.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand All @@ -101,7 +104,10 @@ def adjust(cols, light, **kwargs):


def get(img, light=False, **kwargs):
"""Get colorscheme."""
"""Get colorscheme.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
Expand Down
17 changes: 12 additions & 5 deletions pywal/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ def colors_to_dict(colors, img):

def generic_adjust(colors, light, **kwargs):
"""Generic color adjustment for themers.
:keyword args: c16 - [ lighten | darken ]
:keyword-args:
- c16 - [ "lighten" | "darken" ]
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
else:
cols16 = False

if light:
for color in colors:
Expand Down Expand Up @@ -273,7 +276,11 @@ def binary_luminance_adjust(


def cache_fname(img, backend, light, cache_dir, sat="", **kwargs):
"""Create the cache file name."""
"""Create the cache file name.
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
- cst: palette contrast ratio - float
"""
color_type = "light" if light else "dark"
if 'c16' in kwargs:
cols16 = kwargs["c16"]
Expand Down Expand Up @@ -355,9 +362,9 @@ def get(
**kwargs,
):
"""Generate a palette.
:keyword args:
c16: [ lighten | darken ] - generates a 16 color palette
cst: float - applies contrast ratio to palette
:keyword-args:
- c16: use 16 colors through specified method - [ "lighten" | "darken" ]
- cst: apply contrast ratio to palette - float
"""
if 'c16' in kwargs:
cols16 = kwargs["c16"]
Expand Down

0 comments on commit ee2d603

Please sign in to comment.