Spaces:
Paused
Paused
Download node_modules/@plotly/mapbox-gl/src/style-spec/util/interpolate.js from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 527 Bytes
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/mapbox-gl/src/style-spec/util/interpolate.js
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@plotly/mapbox-gl/src/style-spec/util/interpolate.js
-
curl -L -o interpolate.js https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/mapbox-gl/src/style-spec/util/interpolate.js
527 Bytes
| // @flow | |
| import Color from './color'; | |
| export function number(a: number, b: number, t: number) { | |
| return (a * (1 - t)) + (b * t); | |
| } | |
| export function color(from: Color, to: Color, t: number) { | |
| return new Color( | |
| number(from.r, to.r, t), | |
| number(from.g, to.g, t), | |
| number(from.b, to.b, t), | |
| number(from.a, to.a, t) | |
| ); | |
| } | |
| export function array(from: Array<number>, to: Array<number>, t: number): Array<number> { | |
| return from.map((d, i) => { | |
| return number(d, to[i], t); | |
| }); | |
| } | |