summaryrefslogtreecommitdiff
path: root/test/painter/color.c
blob: bdfe9b38a24b1e7b70c2d9eb7171b7892814f336 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "painter/color.h"
#include <assert.h>

static void test_color_blend() {
  Color a = {{1, 10, 100, 200}}, b = {{100, 1, 200, 10}};
  assert(color_equals(color_blend(a, b, TIME_ORIGIN), a));
  assert(color_equals(color_blend(a, b, TIME_UNIT), b));
  assert(color_equals(color_blend(a, b, 0.25), (Color) {{50, 9, 132, 173}}));
}

int main(int argc, char **argv) {
  test_color_blend();
  return 0;
}