| 276 | } |
| 277 | |
| 278 | function writeTransform(list0, list1, ratio) { |
| 279 | // check if we should just use the original transform strings: |
| 280 | if (ratio === 1) { return list1[1]; } |
| 281 | if (ratio === 0 || !list1[0]) { return list0[1]; } |
| 282 | |
| 283 | // they match, we want to apply the ratio: |
| 284 | var str = "", l=list0.length, i, j, jl; |
| 285 | for (i=2; i<l; i++) { |
| 286 | var component0 = list0[i], component1 = list1[i]; |
| 287 | str += component0[0]+"("; |
| 288 | for (j=1, jl=component0.length; j<jl; j+=2) { |
| 289 | str += component0[j]+(component1[j]-component0[j])*ratio; // value |
| 290 | str += component1[j+1] || component0[j+1]; // unit |
| 291 | if (j < jl-2) { str += ", "; } |
| 292 | } |
| 293 | str += ")"; |
| 294 | if (i < l-1) { str += " "; } |
| 295 | } |
| 296 | return str; |
| 297 | } |
| 298 | |
| 299 | /* |
| 300 | |