import constant_default from "./constant.js";
function linear(e, n) {
	return function(r) {
		return e + r * n;
	};
}
function exponential(e, n, r) {
	return e **= +r, n = n ** +r - e, r = 1 / r, function(i) {
		return (e + i * n) ** +r;
	};
}
function hue(r, i) {
	var a = i - r;
	return a ? linear(r, a > 180 || a < -180 ? a - 360 * Math.round(a / 360) : a) : constant_default(isNaN(r) ? i : r);
}
function gamma(n) {
	return (n = +n) == 1 ? nogamma : function(i, a) {
		return a - i ? exponential(i, a, n) : constant_default(isNaN(i) ? a : i);
	};
}
function nogamma(r, i) {
	var a = i - r;
	return a ? linear(r, a) : constant_default(isNaN(r) ? i : r);
}
export { nogamma as default, gamma, hue };
