diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-12-14 19:27:22 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-12-14 19:52:36 -0500 |
commit | bfbe9e43e108f6816c17b9b7764b75284ac78313 (patch) | |
tree | 189f85eeec18a76ccb626e45455fa7e45406db7c /libdimension-python/tests | |
parent | 7db5342a36341b061a8785a3b349cf0fcad69ebf (diff) | |
download | dimension-bfbe9e43e108f6816c17b9b7764b75284ac78313.tar.xz |
Re-think colors.
Color is a property of light, and thus doesn't include information
about transparency. But canvas pixels and object pigments represent
a color and a degree of transparency. The new type dmnsn_tcolor/
TColor encapsulates that information.
Also, fix the transparent shadow implementation.
Diffstat (limited to 'libdimension-python/tests')
-rwxr-xr-x | libdimension-python/tests/color.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/libdimension-python/tests/color.py b/libdimension-python/tests/color.py index 9482545..8bf1836 100755 --- a/libdimension-python/tests/color.py +++ b/libdimension-python/tests/color.py @@ -24,21 +24,15 @@ from dimension import * # Treat warnings as errors for tests die_on_warnings(True) -c = Color(0, 0.5, 1, trans = 0.5, filter = 0.35) -assert repr(c) == "dimension.Color(0.0, 0.5, 1.0, 0.5, 0.35)", repr(c) -assert str(c) == "Color<0.0, 0.5, 1.0, trans = 0.5, filter = 0.35>", str(c) +c = Color(0, 0.5, 1) +assert repr(c) == "dimension.Color(0.0, 0.5, 1.0)", repr(c) +assert str(c) == "Color<0.0, 0.5, 1.0>", str(c) assert c.red == 0, c.red assert c.green == 0.5, c.green assert c.blue == 1, c.blue -assert c.trans == 0.5, c.filter -assert c.filter == 0.35, c.trans - -c = Color(1, 0.5, 0) -assert str(c) == "Color<1.0, 0.5, 0.0>", str(c) assert Black == Color(0, 0, 0), Black assert White == Color(1, 1, 1), White -assert Clear == Color(0, 0, 0, trans = 1), Clear assert Red == Color(1, 0, 0), Red assert Green == Color(0, 1, 0), Green assert Blue == Color(0, 0, 1), Blue |