Compare commits
2 Commits
ce752d30e2
...
70d0279cb9
Author | SHA1 | Date | |
---|---|---|---|
70d0279cb9
|
|||
62ef828e4b
|
@@ -18,7 +18,7 @@ pip install --index-url https://git.end-play.xyz/api/packages/profitroll/pypi/si
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```example
|
```example
|
||||||
usage: huepaper [-h] [--width WIDTH] [--height HEIGHT] [-c COLOR] [-np] [-o OUTPUT] [-l [LINES]] [-lb [LINES_BRIGHT]] [-ld [LINES_DARK]] [-P [PIXELATE]] [-e EMBLEM] [-hue HUE] [-smin SMIN] [-smax SMAX] [-lmin LMIN] [-lmax LMAX]
|
usage: huepaper [-h] [--width WIDTH] [--height HEIGHT] [-c COLOR] [-np] [-o OUTPUT] [-l [LINES]] [-lb [LINES_BRIGHT]] [-ld [LINES_DARK]] [-p [PIXELATE]] [-e EMBLEM] [-hue HUE] [-smin SMIN] [-smax SMAX] [-lmin LMIN] [-lmax LMAX]
|
||||||
|
|
||||||
Create wallpapers based on color hues.
|
Create wallpapers based on color hues.
|
||||||
|
|
||||||
@@ -28,7 +28,6 @@ optional arguments:
|
|||||||
--height HEIGHT height of the image (default: 1080)
|
--height HEIGHT height of the image (default: 1080)
|
||||||
-c COLOR, --color COLOR
|
-c COLOR, --color COLOR
|
||||||
base color from which the huepaper is generated (default: random color)
|
base color from which the huepaper is generated (default: random color)
|
||||||
-np, --no-preview don't preview the huepaper
|
|
||||||
-o OUTPUT, --output OUTPUT
|
-o OUTPUT, --output OUTPUT
|
||||||
filepath where the huepaper will be saved
|
filepath where the huepaper will be saved
|
||||||
-l [LINES], --lines [LINES]
|
-l [LINES], --lines [LINES]
|
||||||
@@ -116,7 +115,7 @@ huepaper -hue 1.0 -lmin 0.3 -lmax 0.6 -smin 0.8 -smax 1.0
|
|||||||

|

|
||||||
|
|
||||||
``` example
|
``` example
|
||||||
huepaper -hue 0.3 -lmin 0.5 -lmax 0.5 -l 0.5 -P 64x36
|
huepaper -hue 0.3 -lmin 0.5 -lmax 0.5 -l 0.5 -p 64x36
|
||||||
```
|
```
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
from os import remove
|
from os import remove
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from subprocess import run
|
||||||
|
|
||||||
from PIL.Image import Image
|
from PIL.Image import Image
|
||||||
|
|
||||||
@@ -12,6 +13,47 @@ def test_generation():
|
|||||||
assert isinstance(image, Image)
|
assert isinstance(image, Image)
|
||||||
|
|
||||||
|
|
||||||
|
def test_saving():
|
||||||
|
image = generate(
|
||||||
|
500,
|
||||||
|
500,
|
||||||
|
hue_max=1.0,
|
||||||
|
lum_min=0.3,
|
||||||
|
lum_max=0.6,
|
||||||
|
sat_min=0.8,
|
||||||
|
sat_max=1.0,
|
||||||
|
lines=0.0,
|
||||||
|
)
|
||||||
|
save_image(image, Path("tests/image.jpg"))
|
||||||
|
assert Path("tests/image.jpg").exists()
|
||||||
|
remove(Path("tests/image.jpg"))
|
||||||
|
|
||||||
|
|
||||||
|
def test_shell():
|
||||||
|
assert (
|
||||||
|
run(
|
||||||
|
[
|
||||||
|
"huepaper",
|
||||||
|
"-hue",
|
||||||
|
"0.3",
|
||||||
|
"-lmin",
|
||||||
|
"0.5",
|
||||||
|
"-lmax",
|
||||||
|
"0.3",
|
||||||
|
"-l",
|
||||||
|
"0.5",
|
||||||
|
"-p",
|
||||||
|
"64x36",
|
||||||
|
"-o",
|
||||||
|
"tests/image.jpg",
|
||||||
|
],
|
||||||
|
check=False,
|
||||||
|
).returncode
|
||||||
|
== 0
|
||||||
|
)
|
||||||
|
remove(Path("tests/image.jpg"))
|
||||||
|
|
||||||
|
|
||||||
def test_generation_example_1():
|
def test_generation_example_1():
|
||||||
image = generate(color="lightgreen")
|
image = generate(color="lightgreen")
|
||||||
assert isinstance(image, Image)
|
assert isinstance(image, Image)
|
||||||
@@ -40,27 +82,3 @@ def test_generation_example_5():
|
|||||||
emblem=Path("tests/assets/emblem.png"),
|
emblem=Path("tests/assets/emblem.png"),
|
||||||
)
|
)
|
||||||
assert isinstance(image, Image)
|
assert isinstance(image, Image)
|
||||||
|
|
||||||
|
|
||||||
def test_generation_example_6():
|
|
||||||
image = generate(
|
|
||||||
width=500,
|
|
||||||
height=500,
|
|
||||||
)
|
|
||||||
assert isinstance(image, Image)
|
|
||||||
|
|
||||||
|
|
||||||
def test_saving():
|
|
||||||
image = generate(
|
|
||||||
500,
|
|
||||||
500,
|
|
||||||
hue_max=1.0,
|
|
||||||
lum_min=0.3,
|
|
||||||
lum_max=0.6,
|
|
||||||
sat_min=0.8,
|
|
||||||
sat_max=1.0,
|
|
||||||
lines=0.0,
|
|
||||||
)
|
|
||||||
save_image(image, Path("tests/image.jpg"))
|
|
||||||
assert Path("tests/image.jpg").exists()
|
|
||||||
remove(Path("tests/image.jpg"))
|
|
Reference in New Issue
Block a user