UNPKG

@thewtex/vtk.js-esm

Version:

Visualization Toolkit for the Web

25 lines (22 loc) 965 B
import { r as rgb } from './rgb.js'; import { g as genericArray } from './array.js'; import { d as date } from './date.js'; import { i as interpolateNumber } from './number.js'; import { o as object } from './object.js'; import { s as string } from './string.js'; import { c as constant } from './constant.js'; import { i as isNumberArray, n as numberArray } from './numberArray.js'; import { c as color } from '../../d3-color/src/color.js'; function interpolate(a, b) { var t = typeof b, c; return b == null || t === "boolean" ? constant(b) : (t === "number" ? interpolateNumber : t === "string" ? ((c = color(b)) ? (b = c, rgb) : string) : b instanceof color ? rgb : b instanceof Date ? date : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : interpolateNumber)(a, b); } export { interpolate as i };