mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-24 14:36:25 +02:00
Rename test to tests; fix equator length.
This commit is contained in:
parent
f744c601d0
commit
ba26c1d4d7
19 changed files with 71 additions and 33 deletions
26
tests/test_color.py
Normal file
26
tests/test_color.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
"""
|
||||
Test color functions.
|
||||
"""
|
||||
from colour import Color
|
||||
|
||||
from roentgen.color import get_gradient_color, is_bright
|
||||
from roentgen.util import MinMax
|
||||
|
||||
__author__ = "Sergey Vartanov"
|
||||
__email__ = "me@enzet.ru"
|
||||
|
||||
|
||||
def test_is_bright() -> None:
|
||||
"""Test detecting color brightness."""
|
||||
assert is_bright(Color("white"))
|
||||
assert is_bright(Color("yellow"))
|
||||
assert not is_bright(Color("brown"))
|
||||
assert not is_bright(Color("black"))
|
||||
|
||||
|
||||
def test_gradient() -> None:
|
||||
"""Test color picking from gradient."""
|
||||
color: Color = get_gradient_color(
|
||||
0.5, MinMax(0, 1), [Color("black"), Color("white")]
|
||||
)
|
||||
assert color == Color("#7F7F7F")
|
Loading…
Add table
Add a link
Reference in a new issue