@xtia/timeline 1.1.13 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/internal/tween.js +13 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -107,8 +107,8 @@ const filenameEmitter = range
|
|
|
107
107
|
.dedupe()
|
|
108
108
|
.map(n => `animation-frame-${n}.png`);
|
|
109
109
|
|
|
110
|
-
// filenameEmitter will emit filenames as the Timeline passes through
|
|
111
|
-
// it can be listened directly or further transformed
|
|
110
|
+
// filenameEmitter will emit filenames as the Timeline passes through
|
|
111
|
+
// 'range'. it can be listened directly or further transformed
|
|
112
112
|
const urlEmitter = filenameEmitter
|
|
113
113
|
.map(filename => `http://www.example.com/${filename}`);
|
|
114
114
|
|
package/internal/tween.js
CHANGED
|
@@ -134,7 +134,19 @@ function parseColour(code) {
|
|
|
134
134
|
}
|
|
135
135
|
function blendColours(from, to, bias) {
|
|
136
136
|
const blended = from.map((val, i) => clamp(blendNumbers(val, to[i], bias), 0, 255));
|
|
137
|
-
|
|
137
|
+
if (blended[3] === 255) {
|
|
138
|
+
return "#" +
|
|
139
|
+
Math.round(blended[0]).toString(16).padStart(2, "0") +
|
|
140
|
+
Math.round(blended[1]).toString(16).padStart(2, "0") +
|
|
141
|
+
Math.round(blended[2]).toString(16).padStart(2, "0");
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
return "#" +
|
|
145
|
+
Math.round(blended[0]).toString(16).padStart(2, "0") +
|
|
146
|
+
Math.round(blended[1]).toString(16).padStart(2, "0") +
|
|
147
|
+
Math.round(blended[2]).toString(16).padStart(2, "0") +
|
|
148
|
+
Math.round(blended[3]).toString(16).padStart(2, "0");
|
|
149
|
+
}
|
|
138
150
|
}
|
|
139
151
|
const tweenableTokenRegex = /(#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\b|[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;
|
|
140
152
|
function tokenise(s) {
|