This repository has been archived on 2026-03-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
huepaper/src/huepaper/__main__.py
2023-08-10 14:02:29 +02:00

135 lines
3.7 KiB
Python

#!/usr/bin/env python
import argparse
from huepaper import generate
def print_greeter():
greeter = """
.lk.
cO.
cO.;:lc. ,c. .cc .,',c; .,c.;coc. ;,.,c. ':l.:lo: '',:c. '::.lo.
cO' kd .O; dO ,x...,Ox cO; lO: ;x xk OO. .kO. x;...x0' 0x. .
cO. xx .O; dO ko...... :O. Ox .,..xO kk ;0;;0...... 0d
cO. xx .O; xO dO. .. :O. .O; dk xO kk :O.'0o , 0d
.dk, .kk. okc;,ox' ckxllc. :Oc'.,l' oOl;'dO:. kO;..:l. ,xOolc; ,Ox.
:O. kk
lO, OO
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO00O0000000000000000;
"""
print(greeter)
def main():
parser = argparse.ArgumentParser(
description="Create wallpapers based on color hues."
)
parser.add_argument(
"--width",
default=1920,
help="width of the image (default: 1920)",
)
parser.add_argument(
"--height",
default=1080,
help="height of the image (default: 1080)",
)
parser.add_argument(
"-o", "--output", help="filepath where the huepaper will be saved"
)
parser.add_argument(
"-c",
"--color",
help="base color from which the huepaper is generated (default: random color)",
)
parser.add_argument(
"-l",
"--lines",
nargs="?",
const=0.3,
type=float,
help="include one to three random lines in base color with given opacity in range [0, 1] (default: 0.3)",
)
parser.add_argument(
"-lb",
"--lines_bright",
nargs="?",
const=0.1,
type=float,
help="include one to three bright random lines with given opacity in range [0, 1] (default: 0.1)",
)
parser.add_argument(
"-ld",
"--lines_dark",
nargs="?",
const=0.1,
type=float,
help="include one to three dark random lines with given opacity in range [0, 1] (default: 0.1)",
)
parser.add_argument(
"-p",
"--pixelate",
nargs="?",
const="16x9",
help="pixelate image with WIDTHxHEIGHT (default: 16x9)",
)
parser.add_argument(
"-e", "--emblem", help="emblem to add in the center of the huepaper"
)
parser.add_argument(
"-hue",
default=0.1,
type=float,
help="maximum hue to differ from given color in range [0, 1] (default: 0.1)",
)
parser.add_argument(
"-smin",
default=0.2,
type=float,
help="minimum saturation for colors in range [0, 1] (default: 0.2)",
)
parser.add_argument(
"-smax",
default=1.0,
type=float,
help="maximum saturation for colors in range [0, 1] (default: 1.0)",
)
parser.add_argument(
"-lmin",
default=0.2,
type=float,
help="minimum luminance for colors in range [0, 1] (default: 0.2)",
)
parser.add_argument(
"-lmax",
default=0.9,
type=float,
help="maximum luminance for colors in range [0, 1] (default: 0.9)",
)
# Get args
args = parser.parse_args()
print(args)
generate(
_output=args.output,
width=args.width,
height=args.height,
color=args.color,
lines=args.lines,
lines_bright=args.lines_bright,
lines_dark=args.lines_dark,
emblem=args.emblem,
pixelate=args.pixelate,
hue_max=args.hue,
sat_min=args.smin,
sat_max=args.smax,
lum_min=args.lmin,
lum_max=args.lmax,
)
if __name__ == "__main__":
main()