Skip to content

🎥 Make videos programmatically with React

use different variable names for color

Jonny Burger80e322fa7800
diff --git a/packages/docs/docs/interpolate-colors.md b/packages/docs/docs/interpolate-colors.md
index bfb94fb294..c3d2a26aef 100644
--- a/packages/docs/docs/interpolate-colors.md
+++ b/packages/docs/docs/interpolate-colors.md
@@ -26,18 +26,16 @@ In this example, we are interpolating colors from red to yellow. At frame 0 (the
Using the following snippet, we can calculate the current color for any frame:
```tsx twoslash
-let color = ''
-// ---cut---
import {useCurrentFrame, interpolateColors} from 'remotion';
const frame = useCurrentFrame(); // 10
-color = interpolateColors(frame,
+const color = interpolateColors(frame,
[0, 20],
['red', 'yellow']
); // rgba(255, 128, 0, 1)
-color = interpolateColors(frame,
+const color2 = interpolateColors(frame,
[0, 20],
['#ff0000', '#ffff00']
); // rgba(255, 128, 0, 1)
@@ -50,20 +48,18 @@ In this example, we are interpolating colors from red to yellow. At frame 0 (the
Using the following snippet, we can calculate the current color for any frame:
```tsx twoslash
-let color = ''
-// ---cut---
import {useCurrentFrame, interpolateColors} from 'remotion'
const frame = useCurrentFrame(); // 10
// RGB colors
-color = interpolateColors(frame,
+const color = interpolateColors(frame,
[0, 20],
['rgb(255, 0, 0)', 'rgb(255, 255, 0)']
); // rgba(255, 128, 0, 1)
// RGBA colors
-color = interpolateColors(frame,
+const color2 = interpolateColors(frame,
[0, 20],
['rgba(255, 0, 0, 1)', 'rgba(255, 255, 0, 0)']
); // rgba(255, 128, 0, 0.5)
@@ -76,19 +72,17 @@ In this example, we are interpolating colors from red to yellow. At frame 0 (the
Using the following snippet, we can calculate the current color for any frame:
```ts twoslash
-let color = ''
-// ---cut---
import {useCurrentFrame, interpolateColors} from 'remotion'
const frame = useCurrentFrame(); // 10
//hsl example
-color = interpolateColors(frame,
+const color = interpolateColors(frame,
[0, 20],
['hsl(0, 100%, 50%)', 'hsl(60, 100%, 50%)']
); // rgba(255, 128, 0, 1)
//hsla example
-color = interpolateColors(frame,
+const color2 = interpolateColors(frame,
[0, 20],
['hsla(0, 100%, 50%, 1)', 'hsla(60, 100%, 50%, 1)']
); // rgba(255, 128, 0, 1)