diff options
author | pacien | 2017-12-28 01:22:41 +0100 |
---|---|---|
committer | pacien | 2017-12-28 01:22:41 +0100 |
commit | 190449ee18bec69b2e385dccd9bd42ddc83dd418 (patch) | |
tree | 6038429dcdd01def5410183148e582256d461fcc /test | |
parent | c970da3f5830fae5b4d98dcdcc8d34d678ec0434 (diff) | |
download | morpher-190449ee18bec69b2e385dccd9bd42ddc83dd418.tar.gz |
Refactor and test color
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'test')
-rw-r--r-- | test/painter/color.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/painter/color.c b/test/painter/color.c new file mode 100644 index 0000000..bdfe9b3 --- /dev/null +++ b/test/painter/color.c | |||
@@ -0,0 +1,14 @@ | |||
1 | #include "painter/color.h" | ||
2 | #include <assert.h> | ||
3 | |||
4 | static void test_color_blend() { | ||
5 | Color a = {{1, 10, 100, 200}}, b = {{100, 1, 200, 10}}; | ||
6 | assert(color_equals(color_blend(a, b, TIME_ORIGIN), a)); | ||
7 | assert(color_equals(color_blend(a, b, TIME_UNIT), b)); | ||
8 | assert(color_equals(color_blend(a, b, 0.25), (Color) {{50, 9, 132, 173}})); | ||
9 | } | ||
10 | |||
11 | int main(int argc, char **argv) { | ||
12 | test_color_blend(); | ||
13 | return 0; | ||
14 | } | ||