2024-06-04 13:41:33 +02:00

6 lines
179 B
JavaScript

// Color interpolation hint exponential function
const midpoint = (H = 0.5) => t =>
H <= 0 ? 1 : H >= 1 ? 0 : Math.pow(t, Math.log(0.5) / Math.log(H));
export default midpoint;