mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-29 00:46:27 +02:00
Add gradient test.
This commit is contained in:
parent
867001d797
commit
cb988db033
1 changed files with 11 additions and 1 deletions
|
@ -3,7 +3,8 @@ Test color functions.
|
||||||
"""
|
"""
|
||||||
from colour import Color
|
from colour import Color
|
||||||
|
|
||||||
from roentgen.color import is_bright
|
from roentgen.color import is_bright, get_gradient_color
|
||||||
|
from roentgen.util import MinMax
|
||||||
|
|
||||||
__author__ = "Sergey Vartanov"
|
__author__ = "Sergey Vartanov"
|
||||||
__email__ = "me@enzet.ru"
|
__email__ = "me@enzet.ru"
|
||||||
|
@ -18,3 +19,12 @@ def test_is_bright() -> None:
|
||||||
assert not is_bright(Color("brown"))
|
assert not is_bright(Color("brown"))
|
||||||
assert not is_bright(Color("black"))
|
assert not is_bright(Color("black"))
|
||||||
|
|
||||||
|
|
||||||
|
def test_gradient() -> None:
|
||||||
|
"""
|
||||||
|
Test color picking from gradient.
|
||||||
|
"""
|
||||||
|
assert (
|
||||||
|
get_gradient_color(0.5, MinMax(0, 1), [Color("black"), Color("white")])
|
||||||
|
== Color("#7F7F7F")
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue