Add smoothstep function for color interpolation

This commit is contained in:
2026-04-28 14:25:28 +02:00
parent f32592876f
commit 52087e8db4

View File

@@ -42,6 +42,12 @@ function lerp(left: number, right: number, amount: number) {
return left + (right - left) * amount;
}
function smoothstep(edge0: number, edge1: number, value: number) {
const amount = clamp((value - edge0) / (edge1 - edge0), 0, 1);
return amount * amount * (3 - 2 * amount);
}
function resolveGradientColors(background: WorldBackgroundSettings) {
if (background.mode === "solid") {
return {