-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkitt.php
47 lines (41 loc) · 1.57 KB
/
kitt.php
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
<?php
use Scheb\QlcGenerator\Qlc\Sequence;
require __DIR__ . '/vendor/autoload.php';
$alphaAnim = [
[0.8, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
[0.6, 0.8, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0],
[0.4, 0.6, 0.8, 0.1, 0.0, 0.0, 0.0, 0.0],
[0.2, 0.4, 0.6, 0.8, 1.0, 0.0, 0.0, 0.0],
[0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 0.0, 0.0],
[0.0, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 0.0],
[0.0, 0.0, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0],
[0.0, 0.0, 0.0, 0.0, 0.2, 0.4, 0.6, 1.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.4, 1.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 1.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.8],
[0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.8, 0.6],
[0.0, 0.0, 0.0, 0.0, 1.0, 0.8, 0.6, 0.4],
[0.0, 0.0, 0.0, 1.0, 0.8, 0.6, 0.4, 0.2],
[0.0, 0.0, 1.0, 0.8, 0.6, 0.4, 0.2, 0.0],
[0.0, 1.0, 0.8, 0.6, 0.4, 0.2, 0.0, 0.0],
[1.0, 0.8, 0.6, 0.4, 0.2, 0.0, 0.0, 0.0],
[1.0, 0.6, 0.4, 0.2, 0.0, 0.0, 0.0, 0.0],
[1.0, 0.4, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0],
[1.0, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
];
// Generate Sequence in each color
foreach (COLORS as $colorName => $color) {
$scene = new Sequence('Kitt ' . $colorName);
foreach ($alphaAnim as $stepAlphas) {
$deviceValues = [];
foreach ([BAR1, BAR2] as $device) {
$deviceValues[$device] = [];
foreach ($stepAlphas as $alpha) {
$deviceValues[$device] = array_merge($deviceValues[$device], getRGB($color, $alpha));
}
}
$scene->addStep($deviceValues);
}
echo $scene->generate();
}