summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-color/animation/color-composition.html
blob: c3e481830b6155114e6e6f543acc27c02c59c687 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<meta charset="UTF-8">
<title>color composition</title>
<link rel="help" href="https://drafts.csswg.org/css-color/#the-color-property">
<meta name="assert" content="color supports animation by computed value type">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>

<style>
.target {
  width: 40px;
  height: 40px;
  background-color: black;
}
.expected {
  background-color: green;
}
</style>

<body>
<script>
test_composition({
  property: 'color',
  underlying: 'rgb(50, 50, 50)',
  addFrom: 'rgb(10, 10, 10)',
  replaceTo: 'rgb(30, 30, 30)',
}, [
  {at: 0, expect: 'rgb(60, 60, 60)'},
  {at: 0.2, expect: 'rgb(54, 54, 54)'},
  {at: 1, expect: 'rgb(30, 30, 30)'},
  {at: 1.2, expect: 'rgb(24, 24, 24)'},
  {at: 1.5, expect: 'rgb(15, 15, 15)'},
]);

test_composition({
  property: 'color',
  underlying: 'rgb(60, 60, 60)',
  addFrom: 'rgb(0, 0, 0)',
  replaceTo: 'rgb(50, 50, 50)',
}, [
  {at: 0, expect: 'rgb(60, 60, 60)'},
  {at: 0.5, expect: 'rgb(55, 55, 55)'},
  {at: 1, expect: 'rgb(50, 50, 50)'},
  {at: 1.2, expect: 'rgb(48, 48, 48)'},
  {at: 1.5, expect: 'rgb(45, 45, 45)'},
]);
</script>
</body>