recolor
Turns one colour into another and leaves the rest: a red cup made green.
tsx
import { Clip, Composition, Track } from "@uberscene/kit";
// recolor: Turns one colour into another and leaves the rest: a red cup made green.
export default function Video() {
return (
<Composition fps={30} width={640} height={360}>
<Track id="main">
<Clip
id="shot"
src="asset:redCup"
in={18}
out={21}
fit="cover"
effects={[
{
type: "recolor",
from: "#c4202b",
to: "#2f9e4f",
amount: [
{ at: 0.5, value: 0, easing: "easeInOut" },
{ at: 1.5, value: 1 },
],
},
]}
/>
</Track>
</Composition>
);
}The coffee footage is Pixabay videos 209419, 209424, 46989 and 251, under the Pixabay Content License. The maker of the machine in the red cup shot has nothing to do with this project.
Params
Drawn as a shader.
| param | type | default | description |
|---|---|---|---|
from | string | "#c4202b" | The colour to change: the object's colour as it was filmed. |
to | string | "#2f9e4f" | The colour it becomes. |
tolerance | number (0..0.5) | 0.06 | How far a hue may lie from from's and still turn fully, as a part of the colour circle (0.5 is half a turn). |
softness | number (0..0.5) | 0.05 | How wide the fade is between turned and kept hues, past tolerance. |
amount | number (0..1) | 1 | How much of the effect to mix in: 0 leaves the picture as it was, 1 is the full effect. |